![]() All program logic should take place in subroutines. Use the Main Routine to execute subroutines and execute initial (startup) actions only. If you need to wait for a condition to be true before executing code, set a bit to be true when that condition exists and use it as a gate for that logic or subroutine. Think out every condition that turns the output on and place it in a single rung. The important thing to remember is that each Output Coil should exist in only one ladder rung. ![]() You cannot have the program stop and wait - it will create a watchdog timer alarm. PLC software is a loop - it executes and repeats infinitely. Normal software is linear and runs from beginning to end. It's important to understand the PLC workflow. This should be basically possible with any PLC programming technique. Use a counter or a count variable and a timer respectively one of the available systimer ticks instead. ![]() A loop effectively holds execution of PLC cycle. However, if I use a positive contact saying "If pressure is <= x" and then write a coil that shuts the valve, won't the program just skip the rung (because in the beginning it would just evaluate as false) and end the program without waiting for the condition to be fulfilled? A similiar logic shouldnt be realized with loops in ST or any other PLC programming language. I am new to ladder logic and the Unitronics system, and I had two questions:ġ) Is there any way to simulate a project WITHOUT connecting the PLC controller to it? I want to see how some of the example projects run but I don't have the actual console yet.Ģ) How would I make the program wait for a specific condition to be met before moving on with the code? For example, I want to open a valve, and then once the pressure goes down to a certain level, shut off the valve. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |