From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does a digital 0,1,1,0 convert to a -1, 0, 0, -1?

Solved!
Go to solution

Using Digital to Analog waveform function why does the following:

0

1

1

0

 

convert to:

 

-1

0

0

-1

 

Code:

Image 10.png

 

Result:

Image 11.png

 

I was expecting:

0

1

1

0

0 Kudos
Message 1 of 4
(1,028 Views)
Solution
Accepted by topic author flycast

The data format defaults to offset binary, you want unsigned binary. 

Message 2 of 4
(997 Views)

That was indeed it. Now, what is signed binary and why would it be used? I've honestly never heard of that before.

Actually a better question. If a waveform has been saved in signed binary in a TDMS file is there a way to detect that when loading and reading the TDMS file?

0 Kudos
Message 3 of 4
(960 Views)

The waveform datatype will be in the waveform attributes. 

 

You may have to play detective on the exact attribute name but, "NI_Datatype" might be close.  The TDMS import addon for Excel should help you find out.


"Should be" isn't "Is" -Jay
Message 4 of 4
(955 Views)