07-11-2016 03:46 PM
Good Afternoon;
I am trying to do the same thing. I am reading 8 bytes of data from a modbus gateway.
I grab the substring that I am interested in....if I set the display to normal the reading is non printable.....set to hex display the reading is 3098 should be decimal 12440 I believe?
This feels like I am close but not quite.............
Solved! Go to Solution.
07-11-2016 08:40 PM
@mned wrote:Good Afternoon;
I am trying to do the same thing. I am reading 8 bytes of data from a modbus gateway.
I grab the substring that I am interested in....if I set the display to normal the reading is non printable.....set to hex display the reading is 3098 should be decimal 12440 I believe?
This feels like I am close but not quite.............
If you have the section of the string that is your data, use Unflatten From String to convert to your number (either I16 or U16). I say to use the Unflatten instead of the Type Cast since you can specify Big Endian or LIttle Endian.
07-11-2016 09:05 PM
@mned wrote:Good Afternoon;
I am trying to do the same thing. I am reading 8 bytes of data from a modbus gateway.
I grab the substring that I am interested in....if I set the display to normal the reading is non printable.....set to hex display the reading is 3098 should be decimal 12440 I believe?
This feels like I am close but not quite.............
You do have it.
Decimal 12440, whether it is U16 or I 16, will directly typecast to hex 3098.
If you don't think you have it, then post a VI that shows the data you have saved as default in a control and the way you are trying to manipulate. it.
07-12-2016 06:29 AM
Here it is, String2 and substring are set to hex display.
String2 is read directly from a device.
The payload of the string is 08B6.
I need to convert this to decimal......should be 2230.
the 2230 / 100 = the position that I sent the actuator to.......22.3mm.
I can not get the conversion......
07-12-2016 06:30 AM
I know my last post was with a different value than the first.....I have 2 different axis
07-12-2016 06:37 AM - edited 07-12-2016 06:44 AM
@mned wrote:I can not get the conversion......
Did you even try our suggestions (Type Cast or Unflatten From String)?
07-12-2016 06:39 AM
THANK YOU!!!!!!!