generate output if the value changes

panthripu

Member
Join Date
Mar 2004
Posts
228
I wish to generate an output if the analog value changes. I compare the old value with new ,every 30 seconds , if old value and new value are not equal. output is triggered.

How can i do same independent of timer , I mean whenever the input value changes (either increases or decreases ), output will be generated.
 
Use a comparison instruction to compare current "New Value" to a saved "Old Value" (New Value NOT EQUAL to Old Value). If different, do TWO things: Turn on the Output, and save the New Value to Old Value.

The important questions are: What will the Output operate? Is it okay for this Output to go on for random periods of time? Is it okay for the output to go on for 1 PLC scan, then immediately off?

Panthripu's Comparison.jpg
 
Last edited:
attachment.php
 
panthripu - it might be more useful to know the the use of 'output'. With your stated method, assuming that 'output', once turned ON, stayed on until the next test, guaranteed that the output, if turned on, stayed on for at least 30 seconds.

If the easiest method is done, eliminate the 30 second wait between tests, then 'output' may be on for only one scan.

This is also assuming the 'old' value is the the value preserved from the previous 'new'.

What are you trying to accomplished by the more frequent test? What is the problem with a test every 30 seconds?

The answers given, while technically correct as an answer to your question as stated, may not be best for the situation you are addressing. More details may yield an answer which meets your needs.

It is also best to indicate the PLC system being used. Your previous posts seem to indicate that you are mainly concerned with Siemens systems.
 
Last edited:
Thanks to all of you.
Just for your understanding , there is a system where the temperature is being measured randomly . This instrument sends data to siemens PLC once the measurement is done.
Now when the PLC receives this new temperature value , I wish to send it to another system (level-2) for their recording purpose. My intention is to find out a way to trigger this transfer of data .The difference between two measurement is random but more than 30 seconds usualy. But some time less than 30 sec also.
SO i wanted PLC to keep monitoring the value.Once the new value is received and comparing it with old value (if not equal means the new value is received)will trigger the sending the value to other system.
Only problem will remain if the new value is same as old ( which is rare )
Any other idea is welcomed.
 
You make this too complex.

Just send the data anyway every few seconds - it will not matter if the value hasn't changed.

Level-2 is recording, so it is perfectly valid to send it duplicate values.
 
there is a system where the temperature is being measured randomly . This instrument sends data to siemens PLC once the measurement is done.
Now when the PLC receives this new temperature value , I wish to send it to another system (level-2) for their recording purpose. My intention is to find out a way to trigger this transfer of data .The difference between two measurement is random but more than 30 seconds usualy. But some time less than 30 sec also.
SO i wanted PLC to keep monitoring the value.Once the new value is received and comparing it with old value (if not equal means the new value is received)will trigger the sending the value to other system.
Only problem will remain if the new value is same as old ( which is rare )
Then Lancie's method should work fine. You will use the output to trigger your message instruction to the 'level-2' system. The 'level-2' system will only get a message if the temperature has changed since the last reading received from the instrument.

🍻

-Eric
 

Similar Topics

Hello Friends, I am looking for a way to take my PID Output( it is the result of my PI Algorithm in Real format) and generate a PWM Signal in...
Replies
16
Views
2,507
I've developed a simple batch script to test communications with a couple of ethernet devices one of our clients has out in the field. The script...
Replies
5
Views
5,201
Does anyone know how to generate output pulse in plc CP1E-N40DR-A??? What instruction i need to make pulse output working.....
Replies
1
Views
1,898
Hi All, I have an application where I have to change the frequency to be given to a 'frequency to voltage' convertor in the panel. I have read up...
Replies
10
Views
16,067
Hi everyone, just gettin so confused, i want to make an internal output of 4Hz, which i`ll use as a condition for outputs to different LED`s so...
Replies
9
Views
3,254
Back
Top Bottom