uPLC example programs - Instruction List (IL)

In order to write or edit the program please use the uPLC editor inside the NiLAB Starter software :https://www.nilab.at/dokuwiki/doku.php?id=nilab_starter:uplc_editor

1) Enable the motor using digital input 1

This is a simple program to enable the motor with digital input 1. Parameter 4620 is the status of the digital inputs, Parameter 4096 is the command word of the drive (3⇒motor enable, 4⇒ motor disable)

LD 4620.1
OUT 4096.0
OUT 4096.1
LDn 4620.1
OUT 4096.2
END

sim_example.jpg

2) Enable the motor after 6 seconds from plc start

This program set the Timer 1 to 1000 (using constant parameter 8680) and a flag bit (8683.0) to start counting 6 x 1000 = 6 secs.
After 6 seconds Digital output 0 is set to 1 and the motor is enabled using control word (Parameter 4096).

LD 8671.0
ANDn 8683.0
SET 8683.0
ADD 8028 8680 8028
LD 8671.0
AND 8683.0
OUT 4621.0
LD 4621.0
OUT 4096.0
END

plc_prg_2.jpg