c3lighting Posted June 1, 2012 Share Posted June 1, 2012 Our custom LED light control PCBA with PIC24FJ64GA104 using RS-485 to Ethernet adapter connected to PC. Successfully sending Force Coil (5) commands to PIC from DaqFactory and controlling the PCBA. Using Modbus RTU protocol. I want a button to use Force Coil (5) and send FF hex the first time it is pressed and 00 hex the second time it is pressed. I thougt that using the Toggle Between would handle this but apparently I was wrong. Using the Button Component with Action set to Toggle Between with values 0 to 1. The following is transmitted and observed in the Comm Monitor: 01 05 00 0C 00 00 0D C9 (all in hex) Modbus Protocol Specification V1.1b: Address (DaqFactory Device#), Function, Output Address Hi, Output Address Lo (DaqFactory Ch#), Output Value Hi, Output Value Lo, CRC, CRC I thought that the output value Lo would change from 00 to FF hex as stated in the Modbus spec? Or that the output value Lo would go from 0 to 1? The output in the Comm Monitor and in my PIC controller is always the same 01 05 00 0C 00 00 0D C9 when the button is pushed. This is Modbus write coil OFF (00) If I change the Toggle Between with values 1 to 0 I get the following in the Comm Monitor: \x01 \x05 \x00 \x0c \xFF \x00L9 If I change to 01 05 00 01 FF 00 DD FA hex the Modbus ON command is sent (FF). Regards, Bob Taylor Link to comment Share on other sites More sharing options...
This topic is now archived and is closed to further replies.