Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

07-17-2020 02:25 PM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

I am trying to add bound variables to my modbus server from a device that has a data format I have never before. First the data is either 16 bit (single register) or a 32 bit (two register) each type can also be signed or unsigned. The data represents an integer part and a fractional part which is defined as a number of bits for each part. The manufacture supplies a "scaling factor" represented by 8.24, where the first 8 bits is the integer and the remaining 24 bits is the fractional part. Because my explanation may not be clear I have attached screen captures from the manual. Also I have attached how to get the real value using labview code.

However I would like to add this to my Modbus server (Labview DSC Module) and was wondering if there was a modbus function to deal with this type of data, Like a F400001 for floats or 300001.1 for individual bits.

I was hoping that there might be something directly from the modbus server I could just read the registrar and display a value directly from the modbus server.

Solved! Go to Solution.

Highlighted
Options

07-17-2020 02:58 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi Terry,

you can use U32/I32 to store those values. Scaling to/from float by 2**X, with X as the number of fractional bits...

Best regards,

GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO

GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO

Highlighted
Options
I think what you'll have to do is read that as a 32 bit integer. Than do some math on it manipulating the bits to break them down into integer and fractional, then doing the math and combining the parts. Perhaps you can create a fixed point data type and try type casting the 32 bit integer into the FXP type. But that is speculation on my part. I haven't needed to mess with FXP types.

07-17-2020 03:00 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Highlighted
Options

Solution

Accepted by topic author Terry_S

07-19-2020 11:34 AM - edited 07-19-2020 11:38 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi Terry,

now providing an example:

No need for FXP, only simple scaling using simple math…

Best regards,

GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO

GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO

Highlighted
Options

08-04-2020 10:18 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

thanks very much for the help