elektronik67
Üye
- Katılım
- 20 Eyl 2006
- Mesajlar
- 440
- Puanları
- 1
- Yaş
- 39
Arkadaşlar Merhaba,
Bir tane flow metreden geçen hava miktarını ölçmek için aşağıdaki gibi totalizer yaptım. 1 Khz pulse değeri girdiğimde doğru değer veriyor. ancak yaptıklarımın doğru olup olmadığını tam bilmiyorum. Yardımlarınızı rica ederim.
REGION _name_
// Statement section REGION
END_REGION
REGION _name_
// Statement section REGION
IF #bEnabe THEN
REGION PulseCounting
// Statement section REGION
IF #bPulse AND NOT #bOldPulse THEN
#nPulseTrainer[1] := #nPulseTrainer[0];
#nPulseTrainer[0] := 0;
#rTotalizerValue.TotalValue += #rConsPulsValue;
END_IF;
END_REGION
#nPulseTrainer[0] += #nOBCycle;
REGION //x/s calculation
// Statement section REGION
IF #nPulseTrainer[1] > 0 THEN
#tempFlow.Sec := 1000 * #rConsPulsValue / #nPulseTrainer[1];
#tempFlow.Min := #tempFlow.Sec*60;
#tempFlow.Hour := #tempFlow.Min*60;
END_IF;
END_REGION
REGION Totalizer
// Statement section REGION
#rTotalizerValue.sec:= #tempFlow.Sec;
#rTotalizerValue.min := #tempFlow.Min;
#rTotalizerValue.hour := #tempFlow.Hour;
END_REGION
REGION Output
// Statement section REGION
#rFlowVolumeSec:= #tempFlow.Sec;
#rFlowVolumeMin := #tempFlow.Min;
#rFlowVolmeHour := #tempFlow.Hour;
END_REGION
REGION Edge Detection
// Statement section REGION
#bOldPulse := #bPulse;
END_REGION
END_IF;
REGION Enable detection
// Statement section REGION
IF #bEnabe= FALSE THEN
#rTotalizerValue.sec :=0;
#rTotalizerValue.min := 0;
#rTotalizerValue.hour := 0;
#rFlowVolumeSec:=0;
#rFlowVolumeMin := 0;
#rFlowVolmeHour := 0;
END_IF;
END_REGION
END_REGION
Bir tane flow metreden geçen hava miktarını ölçmek için aşağıdaki gibi totalizer yaptım. 1 Khz pulse değeri girdiğimde doğru değer veriyor. ancak yaptıklarımın doğru olup olmadığını tam bilmiyorum. Yardımlarınızı rica ederim.
REGION _name_
// Statement section REGION
END_REGION
REGION _name_
// Statement section REGION
IF #bEnabe THEN
REGION PulseCounting
// Statement section REGION
IF #bPulse AND NOT #bOldPulse THEN
#nPulseTrainer[1] := #nPulseTrainer[0];
#nPulseTrainer[0] := 0;
#rTotalizerValue.TotalValue += #rConsPulsValue;
END_IF;
END_REGION
#nPulseTrainer[0] += #nOBCycle;
REGION //x/s calculation
// Statement section REGION
IF #nPulseTrainer[1] > 0 THEN
#tempFlow.Sec := 1000 * #rConsPulsValue / #nPulseTrainer[1];
#tempFlow.Min := #tempFlow.Sec*60;
#tempFlow.Hour := #tempFlow.Min*60;
END_IF;
END_REGION
REGION Totalizer
// Statement section REGION
#rTotalizerValue.sec:= #tempFlow.Sec;
#rTotalizerValue.min := #tempFlow.Min;
#rTotalizerValue.hour := #tempFlow.Hour;
END_REGION
REGION Output
// Statement section REGION
#rFlowVolumeSec:= #tempFlow.Sec;
#rFlowVolumeMin := #tempFlow.Min;
#rFlowVolmeHour := #tempFlow.Hour;
END_REGION
REGION Edge Detection
// Statement section REGION
#bOldPulse := #bPulse;
END_REGION
END_IF;
REGION Enable detection
// Statement section REGION
IF #bEnabe= FALSE THEN
#rTotalizerValue.sec :=0;
#rTotalizerValue.min := 0;
#rTotalizerValue.hour := 0;
#rFlowVolumeSec:=0;
#rFlowVolumeMin := 0;
#rFlowVolmeHour := 0;
END_IF;
END_REGION
END_REGION