Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Henryp on October 08, 2013, 01:24:10 PM

Title: Modbus and floating point data
Post by: Henryp on October 08, 2013, 01:24:10 PM
I understand that the Modbus protocol does not define a floating point data type but a Direct logic PLC will allow a SCADA system using the Modbus protocol to write a floating point number into the PLC's memory. In DS5 the data can then be displayed as a real double word. The Do more designer will not allow me to enter a floating point number into a Modbus holding or image register. So had do I accomplish what I can do in a DL PLC using a Do more CPU.
Title: Re: Modbus and floating point data
Post by: plcnut on October 08, 2013, 02:14:34 PM
The Do more designer will not allow me to enter a floating point number into a Modbus holding or image register.
Are you talking about DataView?
Title: Re: Modbus and floating point data
Post by: BobO on October 08, 2013, 04:10:45 PM
You can easily put a floating point number into a Modbus register, using either the PUBLISH instruction, or if byte ordering/offset permits, using the float cast operator :R. With the cast option, it must be DWORD aligned, so MHR10:R works, but MHR9:R does not. If it must be on an odd boundary, or the byte/word ordering is wrong, use PUBLISH.
Title: Re: Modbus and floating point data
Post by: franji1 on October 08, 2013, 04:36:01 PM
Use SUBSCRIB on MHR's being written to by your SCADA, and PUBLISH on MIRs/MHRs being read by your SCADA.
Title: Re: Modbus and floating point data
Post by: BobO on October 08, 2013, 04:55:45 PM
Use SUBSCRIB on MHR's being written to by your SCADA, and PUBLISH on MIRs/MHRs being read by your SCADA.

Oops...yeah. It does appear that he was looking at the SUBSCRIB side. :-[
Title: Re: Modbus and floating point data
Post by: Henryp on October 08, 2013, 05:38:34 PM
Thanks for the help