Writing ladder logic for a PLC project can be time consuming. One shortcut in this process is on-the-fly variable creation. While programming ladder logic, it’s required that each function block, relay, or coil to have a respective memory location. Memory locations are formatted ‘%[type][number]’. Here are some examples:
%I00001 = Digital input 1
%Q00045 = Digital output 45
%R01001 = Register 1001
%AI00002 = Analog input 2
First, double click on any ladder instruction to trigger a popup window.
This window is prompting for a variable choice. Only premade variables will make this list. Creation of a new variable at this instance can be done in three ways. The first way is to simply type a memory location outright like '%R45'. The second is to type a variable as a string like 'Pump_Start'. Last but not least, the short hand method involves typing ‘45q’.
After hitting enter, the ladder object in this example now has a variable. The second method falls short in that a memory location must still be established at a later time even though a title is in place. Method 1 and 3 fulfill the name and memory location requirement immediately.