2.4
Programming
This example program achieves the purpose: Timer 1 and Timer 2 repeat the set and reset
operations in the 5S interval.
In the device view, the default POU is "PLC_PRG". Double-click "PLC_PRG" in the device view
to automatically open it in the LD language editor in the middle of the CODESYS user interface.
The LD language editor includes a declaration part and an implementation part.
The declaration part includes: the line number, the POU type and name (eg "PROGRAM
PLC_PRG") displayed in the left border, and the variable declaration between the keywords
"VAR" and "END_VAR".
The implementation section shows a contact and an output coil.
1、Declare variables in PLC_PRG
In the Declarations section of the editor, move the cursor to VAR, hit Enter, insert a new blank
line, and declare the variables you need to use. Or in the implementation part of the program,
use the automatic declaration function: enter the command in the implementation part of the
program, click Enter, if there are undeclared variables in the new line, the system will open the
automatic declaration dialog box, where you can make declaration settings. The declaration part
of this example is as follows:
19
Need help?
Do you have a question about the MAT-LC-C Series and is the answer not in the manual?