Source code for MSB
#include "MSB6XX"
' Enable the PLC's COM1 serial port
Opencom 1,115200,3,1024,1024
' Enable the built-in Modbus RTU slave on
' COM1, slave address 1
Set Modbus 1,1,20
' Tell the MSB PLC which inputs to use
Usepin 8,In
Usepin 9,In
Usepin 10,In
Usepin 11,In
Usepin 12,In ' Not used in the demonstration, but can be used
Usepin 13,In ' Not used in the demonstration, but can be used
Usepin 14,In ' Not used in the demonstration, but can be used
Usepin 15,In ' Not used in the demonstration, but can be used
' Tell the MSB PLC which outputs to use
Usepin 32,Out
Usepin 33,Out
Usepin 34,Out
Usepin 35,Out
' Enable Ladder Logic scan to read/write Modbus
' inputs and outputs to/from memory
Set Ladder On
' Run the program forever in an infinite loop
Do
Loop
Back to ComfileHMI