Quick Question on PLC Ladder Logic Execution

Daba I think i see what your saying.. maybe..

Basically my program has for example 5 steps to run in order (when it is told to run them). When running each step, it has a few operations that it needs to perform like setting an output to move a motor. Since this operation takes maybe 2 seconds, i've got it setup with a timer and some toggle bits so that we set the output and then toggle a bit, then the next pass through it wont set the motor position but will instead count up the timer..

Each of these operations should only happen once, and i also dont want the other operations to happen for the other steps/subsequent operations prior to this one completing, so i employed toggle bits and TND's... I think it may not be the correct way of doing things but I as of yet see no reason why it shouldn't work. I'm open to enlightenment though!
 
Yes, I still think you are viewing the ladder code as if it were "in sync" with your sequence. This is not the way PLCs are designed to be used.

Think of the PLC code as a "problem solver", and think of your individual sequence steps as problems to be solved. Now consider that there may be several problems to be solved, some associated with your sequence steps, and some not part of the sequence.

Skipping code because it is not yet at that part of the sequence is not considered good programming practice. I've seen it done, yes, and in very simple applications it can be "got away with". As your applications get bigger, more complex, multiple sequences to deal with, sequence diversions, stepping back, looping etc., you will definitely come unstuck with your current thinking.

I'll try to find a post where I described a much more accepted and flexible way of writing a sequence of operations.....

Try reading this...http://www.plctalk.net/qanda/showpost.php?p=453796&postcount=8
 
Last edited:

Similar Topics

I apologize for not having the model of the plc. I am trying to get it. I have a print out of the program and it seems straight fwd. One...
Replies
12
Views
3,435
What is the current cable to use to connect a laptop PC to a PLC-5 channel 0 (25 pin connector). I have a homemade cable that is just like...
Replies
3
Views
1,537
I have a solenoid powered off a 1756-OA16I. The output has a fuse and then runs off to the solenoid. Now I am not able to change the card at...
Replies
4
Views
1,432
Hi everybody i am currently working with a project at my company and i have spent mostly of the evening yesterday and the morning today trying to...
Replies
8
Views
4,017
E
I am new in the field so bare with me please. I just programmed this PLC controlling this machine. I want to test my process to see if it works...
Replies
38
Views
12,189
Back
Top Bottom