6
« on: May 23, 2012, 04:50:40 AM »
Thanks for your reply, i must say that am new to plcs. Before going to the 32 bit problem, first of all i would like to establish a connection between the nano and the flow meter and read a 16 bit register into the DM. I found out that the readmodbus is not working between the two devices.
If i connect either the flow meter or nano plc using the rs485 to usb on my pc, i would then get a reading with my scada software. This means that my serial setup is right. Please find here attached my ladder diagram, i may be doing something wrong, also find here the custom function codes used.
Cusfn for rs485;
SETBAUD 1,&H03
Cus_auto;
if DM[1]=1 then
setio pump
endif
if DM[1]=0 then
ClRIO pump
endif
rdmod1s;
DM[2]= READMODBUS(1,1,1442)
DM[3]= READMODBUS(1,1,158)