LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting digital waveform into bit sequence

Dear friends,

I am stuck with the task of converting a digital waveform (16 bit values) into the following waveform:

each sample of the original waveform should be represented by a sequence of bits (or H and L analog values) in the second waveform,
the duration of the bit sequence should be half (in general arbitrary fraction) of the sample clock period of the original waveform,
the bit sequence should be padded by zeros so that the total duration of the bit sequence and the pad equals to the sample clock period of the first waveform.

I tried to represent these two waveforms in the picture attached.

It would be really great if someone could give me hints/suggestions to this problem!

Thanks in advance!


0 Kudos
Message 1 of 9
(7,976 Views)
Hi ampm,

If I understand correctly, this boils down to a few major steps:
1) Determine the sample clock period
2) Create an array of 0s, whose length is equal to this sample clock period -16(the number of bits in the original waveform)
3) Convert the original 16-bit number to a boolean array
4) Use build array, with the converted number first and then the padded 0 array (and make sure you right click to go to concatenate inputs

And the output of build array will be this padded number.

That should do the trick!
-Sam F, DAQ Marketing Manager
0 Kudos
Message 2 of 9
(7,910 Views)

Hi SamboNI,

Thanks for your reply!

I have couple of notes:

I tried to implement your instructions but the LabView gives error message (please see the screenshot attached).
I guess there should be "Boolean to (1,0)" VI between "Number to Boolean Array" and "Build Array" VIs (?)

The problem I have is a bit more complex:
I have a digital waveform (16 bit integers). I need to transform the waveform in the easiest and fastest way into the following form:
Each sample of the original waveform (16 bit integer number, i.e. 5) should be represented by a sequence of 0s and 1s corresponding to the bit sequence of that number (0000000000000101 for 5) padded by a sequence of zeros (i.e. 00000) in the final waveform. I will use the final waveform to drive single line of the 6534 board instead of 16 lines of this bopard in the case of the original waveform.

More generally:
I need to realize communication protocol with the AD5541 Digital-to Analog converter from Analog Devices ( http://www.analog.com/en/prod/0%2C2877%2CAD5541%2C00.html ) using 6534 NI board. Therefore I need also build SCLK and CS waveforms and synchronize them with the DATA waveform I was talking above. Is there a way to do this?

By the way 🙂 - do LabView have standard means to communicate with devices like AD5541? Does it require a special software module and/or hardware board?

Thanks in advance!


0 Kudos
Message 3 of 9
(7,895 Views)

Hi there ampm,

The reason you have a broken arrow there is that the variable being wired into the initialize array is not of type boolean. You should put down a false constant from the boolean palette for that input terminal for "element" if you want to make an array of 0s for padding.

As far as communicating with your device, you could probably use one of the shipping examples such as Cont Write Dig Chan-Burst.vi, Available in the example finder under Hardware Input and Output->DAQmx->Digital Generation. But other than that, I'm not sure of any standards, other than SPI.....

I see that that device uses SPI, so you could potentially use the USB-8451

 
-Sam F, DAQ Marketing Manager
0 Kudos
Message 4 of 9
(7,830 Views)
Hi SamboNI,

Thanks for your reply!

I came across USB-8451 recently. There is one thing that I am concerned about using this device. -- I need to synchronize its output with the output of a board in my PXI chassis. But it seems like 8451 can not accept external triggers. Is it so or not? Is there a way to synchronize it with PXI boards?

Thanks!
0 Kudos
Message 5 of 9
(7,825 Views)
Hi ampm,

The 8451 does not support external triggering.  As far as synchronizing it with PXI, it would have to be done on the PXI side using an output from the 8451.  What PXI module are you using?

Hope this helps!

Adam W
Applications Engineering
National Instruments

0 Kudos
Message 6 of 9
(7,734 Views)
Hi Adam,

Thanks for your reply!
I am using 1042 PXI module with 6602, 5122, 6220 and 6534 boards.

Regards,
ampm
0 Kudos
Message 7 of 9
(7,692 Views)
Hello Ampm,


As Adam is suggesting, use the 8451 to trigger those devices you have:
6602 and 5122 have a PFI input.
6220 and 6534 have many PFI lines that you can use for triggering (i.e. PFI0).
Use all these lines to sync your devices.
As an alternative, you can trigger one of these devices and use the PXI backplane to trigger all the others.
I would recommend to open the help file for each of these devices and start locating which are the trigger inputs (PFI lines), then decide who will first receive the trigger and how you should propagate this trigger signal into the other cards.
Hope this helps,
Gerardo O.
RF SW Engineering R&D
National Instruments
0 Kudos
Message 8 of 9
(7,651 Views)
Thanks!
0 Kudos
Message 9 of 9
(7,637 Views)