fg71
Siemens LOGO have function block called Analog Threshold Trigger.
It have Analog input and Digital output. There Threshold On and Off is set.
 
In other words if PV is greater and Threshold On the output is True.
If PV is greater or equal to Threshold Off the output is True, else its False.
 
That was what I got from it in the Simulator in LogoSoft Comfort..
 
PV = INT
ThresholdOn = INT
ThresholdOff = INT
OUT = BOOL
 
So I made Function block in ST
IF PV > ThresholdOn OR PV >= ThresholdOff THEN
  OUT := TRUE;
ELSE
  OUT := FALSE;
END_IF;
Is this Function Block correct to simulate a Threshold Trigger ??
Reply 0 0
thiagoralves
I'm not familiar with Siemens LOGO, but this function does not make sense to me. I would say that if PV is greater than ThresholdOn, then OUT is true. If PV is less than or equal to ThresholdOff then OUT is false. This creates a hysteresis effect that is ideal to analog input comparison.
Reply 0 0
fg71
I think you are right, about the ThresholdOff, I will change and do some test and make other post with it.
Thanks.
Reply 0 0
fg71
I made new test with your inputs.
IF PV > ThresholdOn THEN
  OUT := TRUE;
ELSIF PV < ThresholdOff OR PV = ThresholdOff THEN
  OUT := FALSE;
END_IF;
 
Here is the Function Block Analog Threshold Trigger
 
[203128%2F9059033%2Fmceclip0]
Reply 0 0
fg71
I did a new test in Siemens LOGO there I had Threshold On that was greater and also less and Threshold Off.
So to simulate this 2 things I need other if statement if Threshold On is greater or less and Threshold Off.
 
[203128%2F9059064%2Fmceclip0]
Reply 0 0
richw
It would be nice to have a timed delay on and off, as analog input values are not very stable and if close to the threshold value could cause the output to rapidly turn on and off.
Reply 0 0
fg71
Thanks for your suggestion, I could use other input to the block to set the delay of PT, i have to check the structure text how to do that.
Reply 0 0
thiagoralves
Ideally you shouldn't have to do that if you properly define the threshold on and off with the correct distance (hysteresis). That's why you have two thresholds, one to turn on and another to turn off. So if the analog input oscillates it will not turn the output on/off while still inside the hysteresis range
Reply 1 0
fg71
Aha... that sounds like a correct statement. If the case is rapidly turn on and off the Threshold offset is wrong.
Reply 0 0
richw
@thiagoralves That is what I was trying to suggest, I just didn't know how to word it or the proper way to implement it. Thanks for the Help.
Reply 0 0
Reply