Add contacts to the first ladder rung
Use the steps to add ladder diagram (LD) contact elements to the first ladder rung, and then assign variables to the contacts. After you complete the steps, rung 0 of the program will operate as follows:
If the North-South red traffic lights and the East-West green traffic lights are on, and a car trips either the North sensor or the South sensor for at least five seconds, then change the East-West traffic lights from green to yellow.
Prerequisites
To add contacts to the first ladder rung
- InProject Organizer, double-clickTraffic_Controller_FBto open the language editor.
- Create an XIC for the North-South red traffic light.
- InToolbox, locate and drag theXICto the first rung.
- In the variable selector, selectNS_RED_LIGHTS, and then selectSelect.
- Repeat step 2 to create an XIC forEW_GREEN_LIGHTS.
- Create the XIC for the North car sensor.Two XICs are to be created for the North car sensor and South car sensor. The two XICs are created in parallel because there is either a North car sensor or a South car sensor.
- FromToolbox, drag
to the end of the first rung.
- FromToolbox, locate and dragXICto the upper branch.
- In the variable selector, selectN_CAR_SENSOR, and then selectSelect.
- Create an XIC for the south car sensor.
- FromToolbox, locate and drag theXICto the lower branch.
- In the variable selector, selectS_CAR_SENSOR, and then selectSelect.
- Save the project by doing one of the following:
- From the menu bar, select
.
- From theFilemenu, selectSave.
The rung looks similar to the following image:

Provide Feedback