CCW, Eql instruction is not going false after the first time of being true.

Verne LaRue

Member
Join Date
Nov 2023
Location
Columbia City
Posts
3
Software Ver. 22.00.00,

After the 1st time of being true the EQL. instruction is still allowing the rung to be true even though the inputs are not equal.

I am using as input #1 a Dint Tag, and as input #2 is static. I am moving different values into tag from input #1 and that value is updating fine.

I am normally using this "EQL" comment in the start of the rung but even with Input #1 = 0 and input #2 static = 25 rung is still true?
 
post the code, please, preferably in online mode showing the input values.

I am not familiar with the EQL "instruction" in CCW.
 
Your step 35 is pretty simple, consisting of a single subtraction instruction; the rest of the rung is step management.

Assuming the rest of your logic is similar, i.e. sequential expressions being evaluated, consider that large portions of your sequence may be executing in one scan, and that you are seeing multiple repetitions of the sequence rather than a "stuck" EQU.

When sequence steps are constructed like this, timer and counter instructions may never see rung-in-false conditions.
 
What @Cheeseface said.

TL;DR
  • PLC programming is primarily about time, and the scan cycle is the clock.
  • Also, PLCs are discrete devices, that is, they only do one thing at a time.
  • When we "observe" something in the online ("Connected") mode of CCW, anything we see was sampled at a discrete point in time,
    • so even if the value of your sequence step tag is shown in multiple instructions, that does not mean that was that value of that tag at the time each of those instructions was evaluated.
      • For example, see the attached program and images: the PDF is the static program; the PNG are instantaneous screenshots of the running program.
        • Note especially that the value of step must change throughout the program, but the online-mode-displayed (i.e. sampled) value of step is the same single value i.e. the value at the time step was sampled by online mode.
        • So even though the EQU (=) comparison instructions display a True result for a displayed value of 0 for step being equal to 1 or 2 or 3, at the time those instructions were evaluated, step had different values than that displayed 0.
 

Attachments

  • sequence.pdf
    746.2 KB · Views: 0
  • seq00.png
    seq00.png
    102.7 KB · Views: 1
  • seq01.png
    seq01.png
    42.4 KB · Views: 1
TL;DR II

Consider the same program and a snapshot of its online state (attached), but with the steps reversed (EQU step 3 before EQU step 2 before EQU step 1 etc.), so only one step's EQU comparison can be True for any single scan sequence (e.g. if step is 1, then at the end of the rung guarded by EQU step 1 the value of step will be incremented to 2, and since that rung with EQU step 2 is executed before the rung with EQU step 1 in any single scan cycle, that EQU step 2 will not be be evaluated, and produce a True result, until the next scan cycle.

Also note that, in the attached image of the online state:
  • The value of step is displayed as 2,
    • while the values of stepinitial and step3 and step2 are displayed as 1,
      • which means that the value of step was 1 at the start, and 2 at the end, of the scan cycle when step was sampled for online mode display
  • Also, the state of the displayed Rung 3 comparison (EQU step 3) is True, and the state of the displayed Rung 5 comparison (EQU step 2) is False,
    • which suggests that the online states of the rungs are sampled, asynchronously, i.e. at different times, from the states of the tags.
Bottom line

The online (Connected) mode display is not always a useful tool for knowing the state of a running PLC program.​
This is why it is important in PLC programming to be able the "play" the program in our heads, i.e. to predict the behavior of the program over time, because PLC programming is primarily about time; when something happens is more important than what happens.​
 

Attachments

  • sequence_reverse.pdf
    752 KB · Views: 0
  • seq02.png
    seq02.png
    33.3 KB · Views: 1
The LES, also known as the Less Than, is an instruction used to compare two values against each other. The instruction takes two integers, floats or constants and will return TRUE if the value specified in “Source A” is less than the one in “Source B. The “Source B” operand must be strictly less than the one specified in “Source A”. In other words, the instruction will return FALSE if they are equal.

This instruction can be used to test for an upper limit for an analog sensor and reliably notify the programmer should the value be exceeded.

In RSLogix 500, you may not compare two constants; this restriction is not present in RSLogix 5000 as well as Studio 5000. This is also the case for all comparison instructions.
 

Similar Topics

Hello. Has anyone ran into an issue with HSC on 2080-LC20. It run a cut off press and every so often after resetting to 0 it does not count...
Replies
0
Views
63
I am running CCW 13 trying to upload to a micro 820 vers.12 I get an output message OPC server is unable to load project controller. Please help!
Replies
5
Views
235
How to retain Values in CCW software? I am using CCW software and I can not find the Retain function in this software. Not even local or global...
Replies
2
Views
171
I am new In a CCW and as a beginner I am trying to learn programming but i am noticing that my CCW software is taking around 1 minute to download...
Replies
2
Views
105
Back
Top Bottom