You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old October 21st, 2021, 10:01 PM   #1
kratos1
Member
Viet Nam

kratos1 is offline
 
Join Date: May 2017
Location: viet nam
Posts: 20
Transfer 32 bit floating point to 16 bit integer via Modbus TCP/IP

Hi eveyone. I need transfer signal from system 1 to DCS via modbus. System 1 only can send 32 bit floating point. DCS receive 16 bit integer. How should I do?
For example, system 1 send signal at address 1 (32 bit floating), DCS will receive at address 1 and 2 (16 bit integer), and we need convert address 1 and 2 in DCS...I don't know about that. Could anyone help to explain and solve this issue. Thanks
  Reply With Quote
Old October 21st, 2021, 11:28 PM   #2
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 3,867
We need more information to be able to offer useful help.

What make and model are the [system 1] and [DCS] devices? Can you provide PDF manuals for the devices?

Which system initiates the transfer? That is,

  • Is the [system 1] device writing the 32-bits to the [DCS] device?
  • OR
  • Is the [DCS] device reading the 32-bits from the [system 1] device?
Explanation


The Modbus protocol only provides two kinds of access
  • single-bit: read or write single or multiple Coils; read single or multiple Discrete Inputs)
  • 16-bit: write single or multiple Holding Registers; read multiple Input or Holding Registers; etc.
This process will be using 16-bit access.

The REAL value in [system 1] probably comprises 32 contiguous bits, like this:

(Cf: https://en.wikipedia.org/wiki/Single...rmat:_binary32)


Let us assume that the [DCS] device is going to initiate a Modbus TCP/IP read of those 32 bits as two 16-bit integers. So, bits [0:15] on the left half of the image above map to (will be) one 16-bit integer (Register), and bits [16:31] on the right half map to (will be) another 16-bit integer (Register).

Read the [system 1] programming manual to determine the addresses of the two 16-bit Modbus Registers that map (point) to the 32 bits of the real number, and also what type of reg; they will almost certainly be adjacent e.g. 40011 and 40012.

Once that Modbus transfer is working, we now have the bits of the real value on the [DCS] device as two 16-bit integers; that is the easy part.

We do not know the word order, or the byte order, of the bits on either the [system 1] device or the [DCS] device. Also, because we know nothing about the DCS system, we do not know how to recombine the two 16-bit integers into a single 32-bit real.

The best way to proceed would be to do the transfer, and then post the results here in this thread:
  • The value of the real on the [system 1] device
  • The value (hexadecimal preferred, decimal also okay) of the two 16-bit integers received by the [DCS] device, as interpreted by the [DCS] device.
    • In fact, you should probably make the Modbus read operation retrieve at least three or four contiguous 16-bit integers and post all of the values.
__________________
i) Take care of the bits, and the bytes will take care of themselves.
ii) There is no software problem that cannot be solved with another layer of indirection.
  Reply With Quote
Old October 22nd, 2021, 03:56 AM   #3
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,963
What model is the DCS and system1? Without that the only thing we can say is "yes".
There's always some instruction (or flexibility in the variable address space) to do this.

In Rockwell, you'd use a COP instruction, in Siemens you'd write the two 16 bit words continuously and then read the address as a floating point value.

But without knowing the platforms it's impossible to say more.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Flags, Tags, industry terminology and acronyms. FORGETFULL MEMBER LIVE PLC Questions And Answers 10 September 25th, 2020 02:59 PM
AB ML1500 Floating point to integer conversion opamp LIVE PLC Questions And Answers 9 November 29th, 2013 10:51 PM
What is D in PID? ... fundamentals of Derivative Ron Beaufort LIVE PLC Questions And Answers 20 March 2nd, 2005 03:26 AM
Convert Floating point to Interger Scorpio LIVE PLC Questions And Answers 6 April 1st, 2004 12:28 PM
Encoder Rollover Guest LIVE PLC Questions And Answers 11 March 26th, 2004 11:15 AM


All times are GMT -4. The time now is 08:51 AM.


.