News:

  • June 28, 2026, 10:30:06 AM

Login with username, password and session length

Author Topic: Modbus and floating point data  (Read 11026 times)

Henryp

  • Hero Member
  • *****
  • Posts: 161
Modbus and floating point data
« 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.

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Modbus and floating point data
« Reply #1 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?
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Modbus and floating point data
« Reply #2 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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Modbus and floating point data
« Reply #3 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.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Modbus and floating point data
« Reply #4 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. :-[
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Henryp

  • Hero Member
  • *****
  • Posts: 161
Re: Modbus and floating point data
« Reply #5 on: October 08, 2013, 05:38:34 PM »
Thanks for the help