VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading serial data in binary

I want to read serial data from a device which outputs data in a somewhat complicated manner which will require me to open a COM port, read the serial data as it comes in and update an array with the bits so that I can rearrange them into a binary number. There are 48 bits at a time, and I care about 13 of them. The full definition is here (page 5 has the last 32 bits I acutally care about):

 https://www.innovatemotorsports.com/support/downloads/Seriallog-2.pdf

 

For example, as a test I used the visa test panel in MAX to read the data coming out of the unit and it recorded the data as hex.

b2 82 43 13 04 1a

 

Convert that to binary:

10110010 10000010 01000011 00010011 00000100 00011010

 

Grab bits 35-40, 42-48

0001000011010

 

Which converted to dec is 538. Divide by 1000 and add 0.5=

1.038 which is what the final engineering unit value should be.

 

For some reason I can read the hex data above using MAX, but not in veristand using the instrument addon custom device (https://github.com/NIVeriStandAdd-Ons/Instrument-Custom-Device). It will never return any numbers, binary, hex, or otherwise. It works fine for another module I have that sends standard RS232 signals.

 

 I think my best bet would be to figure out a way to read the data in any form in veristand, then create a simulation from a labview model to convert that into the engineering unit. 

 

0 Kudos
Message 1 of 2
(2,146 Views)

Hi larboc,

 

Someone here might be able to help you with this problem, but you'd have better luck filing an issue on the github page:

 

https://github.com/NIVeriStandAdd-Ons/Instrument-Custom-Device/issues

 

The developers for the custom device monitor that page and should be able to provide some better troubleshooting for this issue.

 

-Jordan

 

 

0 Kudos
Message 2 of 2
(2,117 Views)