CX-Programmer CJ1M

jerryvd3

Member
Join Date
Nov 2017
Location
USA
Posts
10
I am using sensors to track container data down a line. I use am using mov instructions but every so often the data isn't deleted as the container moves past the sensor (location of this changes each time) Below is the only logic that effects those memory bits.

q4tAAS4moaamcCVF6


Am I missing something obvious? Any help would be greatly appreciated.

https://photos.app.goo.gl/q4tAAS4moaamcCVF6
 
Last edited:
What TS14 is? I mean is there any chance it becomes "true" (even for 1 scan) per 0.6s? (I hope you realize it resets timer)
 
TS14 is a Keyence distance sensor. I see no sign of it going true, although I realize it may or may not been noticeable by eye. I do see, the few times I've caught it in time to get to that line of logic that the timer is showing 1, but the mov instructions just didn't seem to have processed it.
 
TS14 is a Keyence distance sensor. I see no sign of it going true, although I realize it may or may not been noticeable by eye. I do see, the few times I've caught it in time to get to that line of logic that the timer is showing 1, but the mov instructions just didn't seem to have processed it.

didn't seem to have processed WHAT?

I use am using mov instructions but every so often the data isn't deleted

Does we talking about rung 46? Or I am wrong?
If I'm right then:
- please read attentively TIM instruction help data
- draw rung 78 timing chart
 
didn't seem to have processed WHAT?



Does we talking about rung 46? Or I am wrong?
If I'm right then:
- please read attentively TIM instruction help data
- draw rung 78 timing chart


Rung 46 will show green(on) on T0512 and through to the mov instructions. however both mov instructions did not actually move &0 (source) to the destination.
 
I think I didn't explain well enough.

Container moves in front of sensor TS14. Depending on compare instruction being true moves the data from 4 locations to another 4 locations.

Container moves away from sensor TS14 timer 0512 starts.

Timer expires and turns T0512 to true.

(Here is the problem)
Usually the 2 @mov statements write 0 to the two memory locations.
Sometimes the 2 @mov don't

I understand they are a one shot, but they are sometimes not doing that even though T0512 has went from off to on they arn't actually moving the data. But this only happens sometimes.
 
The data moves into the location when the container moves in front of TS14 but then didn’t overwrite the data with 0 when the container passed.
 
Are you absolutely sure that T0512 went from off to on in cases where it didn't overwrite data whith 0?
Have you checked it?
 
Do I understand correctly that you don't know exactly whether T0512 goes from false to true in cases where @MOV 0 is not executed?

If so. The first thing that came to mind: add a @+(400) #1 ADDR ADDR to rung 46, and see if the value in the ADDR will change in cases where @MOV 0 is not executed
 
I am not normal able to see the ladder logic as it happens. One time today I was and it did go from false to true.

However I am reasonable sure due the fact every time it happens the data does transfer in (meaning TS14 was true, meaning timer should be false) before it doesn't delete.

I am not opposed to adding that logic tomorrow to verify.
 
The data moves into the location when the container moves in front of TS14 [TS14 becomes 1] but then didn’t overwrite the data with 0 when the container passed [TS14 became 0 and stayed 0 for more than 600ms (0.6s].

This is the behavior you are seeing?

Especially the part about "stayed 0 for more than 600ms (0.6s]?" So you saw T0512 expire after those 600ms and you saw T0512 change from 0 to 1?

In other words, is it possible that another container moves in front of TS14, so TS14 becomes 1, and timer T0512 resets to a value of 0 before timer T0512 expires?

Because if you did see T0512 expire, and it is not possible that T0512 did not expire, then @MaxK is right in suggesting that this rung 46/3227 was not evaluated.

TL;DR

  • Rung 13/3048 ensures that the value of D4113 cannot be 0 whenever
    • The value of TS14 is 1 (Elvis is in the building)
    • AND
    • DS4112 is greater than 320
  • Rung 78/3311 is a debounce timer to ignore short periods i.e. of less than 600ms, when the value of TS14 is 0 (Elvis is not in the building on this scan cycle)
  • Rung 48/3227 puts a value of 0 into D4113 whenever the debounce timer T0512 expires (Elvis has left the building)
Another possibility is that we are not perceiving the actual order of the evaluation of these rungs' logic and the execution of their outputs because of how they are arranged in the image: on each scan cycle, is Rung 13/3048 evaluated before Rung 78/3311, and is Rung 78/3311 then evaluated before Rung 46/3227? I don't think it makes a difference as it should only delay the expected logic by a scan cycle or so, but I have not looked at it too hard.

Remember: the PLC cares not a whit what you want (or expect or think) it will do, but it will mercilessly and inexorably to exactly what you tell it to do.
logic.PNG
 

Similar Topics

I've been having trouble getting online with a CJ1M-13. i am using a Keyspan USB-Serial cable and all of the com settings look fine. Everytime I...
Replies
4
Views
7,229
Dear All, I need a sample PLC program to count the output pulse of a mass flow meter so that a specific amount of mass (for example 100gm)can be...
Replies
2
Views
79
I need a good website or tutorial to learn plc programming Thank you
Replies
10
Views
461
Hello ! I am trying to use an omron cj2m-cpu33 with a CP1W-CIF01 plug in serial connector to talk to a zebra ZT610 printer. I am getting the data...
Replies
8
Views
316
Dear all, First of all thanks for letting me join this forum. I just need some help in one of my programming exercises. Being a beginner...
Replies
6
Views
548
Back
Top Bottom