Const Device = CB405 '******************************************************************** Opencom 1,115200,3,80,80 'Open COM1 for MODBUS communication. Set Modbus 1,1,1 'Mode=RTU, Slave Adress=1, Return Adress=1 '******************************************************************** '******************************************************************** '*** Set P5, P6 & P7 as inputs Usepin 5,In Usepin 6,In Usepin 7,In '*** Set P33, P34 & P34 as outputs Usepin 33,Out Usepin 34,Out Usepin 35,Out '*** Turn ON Ladder execution Set Ladder On 'Must be done to enable PLC ladder. '*** Loop BASIC, do nothing. Do Loop