ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

hex convert to decimal

  • Hi, Im trying to read DYN-200 torque sensor. My value from the read buffer is quite weird it show 2D30 2E30 302D 302E

IMG_20230410_105338.jpg

0 Kudos
Message 1 of 13
(2,722 Views)

How are you communicating with this sensor? Which Modbus library are you using? You might want to share the code so that we can understand better.

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Message 2 of 13
(2,713 Views)

Hi, i dont have the code..

 

but this sensor got three kind of communication mode.Im currently doing the mode 0 which will provide torque and speed value.

 

mode 2 only provide torque value

i will send the picture.

 

Screenshot_2023-04-10-11-17-55-17_e2d5b3f32b79de1d45acd1fad96fbb0f.jpg

Screenshot_2023-04-10-12-27-30-45_e2d5b3f32b79de1d45acd1fad96fbb0f.jpg

Screenshot_2023-04-10-12-27-36-23_e2d5b3f32b79de1d45acd1fad96fbb0f.jpg

Screenshot_2023-04-10-12-27-42-22_e2d5b3f32b79de1d45acd1fad96fbb0f.jpg

  

0 Kudos
Message 3 of 13
(2,695 Views)

I am new to labview. For mode 0 need to use modbus library? 

 

0 Kudos
Message 4 of 13
(2,694 Views)

Based on the screenshots of the user manual you shared, Mode 0 of HEXactive upload protocol is meant for the upper machine designed by the company. 

Since you mentioned that you don't have any code, I guess you are using the NI-VISA Interactive Panel right now. NI-VISA sends and reads the data in the ASCII format, thus you should use the Mode 2 of ASCII Active Upload Protocol instead. In page 6 of the manual, it states that:

A piece of its data format such as: 2B 30 2E 30 30 30 31 0D

This aligns with what you are seeing currently.

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 Kudos
Message 5 of 13
(2,634 Views)

So you get a raw string of six bytes, which consists of three 16bit values. The first is toque (U16), the second is speed (I16) and the third is a checksum. Once you can read these size bytes into LabVIEW, the rest is trivial.

 

0 Kudos
Message 6 of 13
(2,624 Views)

So for mode 0, im not able to use NI-VISA to read the value?

 

For mode 2, it only sends torque value. I test it out and is able to receive the torque value. 

0 Kudos
Message 7 of 13
(2,595 Views)

I uses VISA-Ni to read but get random value

0 Kudos
Message 8 of 13
(2,594 Views)

@abcdefgjdjejd wrote:

I uses VISA-Ni to read but get random value


You need to be significantly more specific.

0 Kudos
Message 9 of 13
(2,519 Views)

thanks for replying me, I planned to use modbus 

0 Kudos
Message 10 of 13
(2,489 Views)