LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Manipulating bytes in a byte array and displaying them as 16 bit signed int in a waveform chart

Solved!
Go to solution

Where is the sign bit in the 12 bit representation? How are the 12 bits encoded? Are negative values in two's complement?  Is there any only documention for this instrument on how to communicate with it?

0 Kudos
Message 11 of 23
(2,125 Views)

Sorry I meant to ask what you meant by place the string into a new VI diagram. Excuse my ignorance. Would you be able to attach a diagram including manipulating the data aswell.

 

REALLY APPRECIATE THE HELP.

0 Kudos
Message 12 of 23
(2,120 Views)

Yes it is a two's complement output.

0 Kudos
Message 13 of 23
(2,118 Views)

Did you get the string diagram constant? Now simply open a new blank VI and drag the diagram constant to the new diagram. Save the new VI uder a new name and attach it here.

 

You still have not answered my question about sign and such.

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

Yes sorry I got the first diagram you sent. I think the two's complement take care of the negative numbers?

0 Kudos
Message 15 of 23
(2,112 Views)

The diagram in post #2 here assumes big endian. You should use unflatten from string instead, where you can set the byte order.

0 Kudos
Message 16 of 23
(2,108 Views)

Ok thank you. Will I then be able to manipulate each byte as I said earlier.

0 Kudos
Message 17 of 23
(2,106 Views)

I don't know what you want to "manipulate" and why?

0 Kudos
Message 18 of 23
(2,102 Views)

I need to manipulate them because I need to left shift the first byte 8 places. That first byte has the four MSBs of a twelve bit ADC output so I have to left shift and then join it to the second byte (the other 8 bits of 12 bit ADC output) so I can then convert it to a signed 16 bit integer by left shifting that four places as this is what I want to plot.

0 Kudos
Message 19 of 23
(2,097 Views)

Sorry when I said manipulate i just meant rearrange the bits.

0 Kudos
Message 20 of 23
(2,085 Views)