Comparing results

tactical

Member
Join Date
Nov 2012
Location
NE
Posts
41
Im using the Do more designer. The PLC is going to read in values from WX0 and then display in D1. Does every new value read from WX0 rewrite over the previous value that is read in? Is there a way I can store the very 1st value that is read in from WX0?

What I want to do is use the ALDEV command and if the change between the very 1st WX0 value and any other value is greater than sum number, active Y1.
 
You need to establish - the first first value after what? PLC power up? Monitored machine power up? Activating some reset command? Should the 'very first value' be tested, possibly for a certain minimum, to ensure the one you store is a valid reading?

Lots of things to think about. But yes, then all readings after that can be compared to a deviation from the first. Check out the ALDEV instruction.
 
Last edited:
You need to establish - the first first value after what? PLC power up? Monitored machine power up? Activating some reset command? Should the 'very first value' be tested, possibly for a certain minimum, to ensure the one you store is a valid reading?

Lots of things to think about. But yes, then all readings after that can be compared to a deviation from the first. Check out the ALDEV instruction.

Right Now I have once the monitored machine is powered up and the first value that is great than zero is displayed. Now I want to compared the first MX0 to the next value of MX0. To use the ALDEV command, I need to store the first value of MX0. How would one do this?
 
Once you heve loaded the program to the simulator set it to 'run' make sure X0 is off. Use the slider to set your 'initial value of WX0. Then turn X0 ON. The slider value at that instant will bet set in D0. After that it won't change. Now move the WX0 slider back and forth above and below your initial value. Watch C1 and C2 indicate the 'out of range' condition. I used '100' as the amount above and below. You could also use a memory location so that the detected deviation could be varied at runtime.
 
Last edited:
Once you heve loaded the program to the simulator set it to 'run' make sure X0 is off. Use the slider to set your 'initial value of WX0. Then turn X0 ON. The slider value at that instant will bet set in D0. After that it won't change. Now move the WX0 slider back and forth above and below your initial value. Watch C1 and C2 indicate the 'out of range' condition. I used '100' as the amount above and below. You could also use a memory location so that the detected deviation could be varied at runtime.
Awesome. That is exactly what I am looking for. Now how to I go about resetting the values?
 
After playing with it I'm understanding it more and more.
Now, WX1, WX2 AND WX3 are values that will be read into the PLC every so often. How do I display the maximum value and the average value of each if X0 is ON?

I'm starting to understand this, the only hard thing for me is dealing with values that are continuously read into the PLC.
 
Maximum Value is rather simple. As you power up store zero to a value, let's call it 'Max'. A simple rung compares the current value to 'Max'. If the current is greater then copy the current value into the 'Max' value.

'Average' is another matter. Normally you would add up all your samples then divide by the number of samples. But doing this each scan may (probably will) overflow any integer register. You can try it if you want to.

To try this stzrt wil zero in a 'Total' register and in 'Samples' register. In a rung add 'Current' to 'Total', add 1 to 'Samples' then divide 'Total' by 'Samples' into 'Average.

It may be ok at first but watch the value in 'Total'. If it wraps and becomes a lower number then this won't work. You may have to switch to a floating point register for 'Total' and 'Average' but then you will begin to loose accuracy in the rightmost decimal position.
 

Similar Topics

I’m running a micro 820 to measure a tank level, then turning on equipment at certain levels. I have an analog input (4-20) that I’m storing and...
Replies
10
Views
279
How do you go about implementing, on the M580 PLC, how many days, hours, minutes before a predefine event in the future? The RRTC_DT yields the...
Replies
3
Views
1,815
This is a Citect SCADA question I have Six variables of type REAL (Float) to compare and determine (identify) which variable has the highest...
Replies
4
Views
1,421
I have currently made a logic to read Serial input from a barcode scanner. The situation is that I need to read the barcode from the machine and...
Replies
5
Views
2,039
Hello, We are using Schneider SCADAPack 357 and Trimble Acutime 2000GPS. We are getting the data as a string(ASCII) from...
Replies
3
Views
1,477
Back
Top Bottom