LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extract a channel from a digital waveform

Solved!
Go to solution

I am using the I2C Digital Waveform Reference Libarary to create a WDT that consists of two lines/channels.  I was wondering how I could extract/remove a channel from the waveform and how I can add/merge waveform channels into a single WDT?  I have looked around for VIs but nothing seems to work with the WDT.

 

Right now my WDT is like this:

 

WDT.png

 

waveform pic.png

 

How could I get these two lines into seperate WDTs?  And then how would I be able to merge them again?  Naturally, I don't want to simply remove them and merge them, but that would be a good practice example to demonstrate.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 1 of 5
(3,779 Views)
Solution
Accepted by topic author MrHappyAsthma

After much trial and frustration, I have found a way to do what I was looking for.  It isn't the most elegant, but it works!

 

This is how I extract both channels into an array, and then merge them back to recreate the original graph:

 

*Note:  The reason why there are 2's in the Waveform Data array is because my waveform contains 0's and Z's instead of 0's and 1's.  The tri-state Z corresponds to the numeric 2.

 

Conversion.JPG

 

output.JPG

 

I even took this a step further and extracted a single line.  This could be modified to extract any line and eventually merge together your own custom signals:

 

Extract channel.JPG

 

output2.JPG

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
Message 2 of 5
(3,748 Views)

Seems trying to do this in labview 2020, forces the Get Digital Data Components to turn into Get Waveform Components resulting in a bad or unwired terminal error that makes it so your VI can't run. NI really doesn't want you to use single channel digital data waveforms for some reason. 

0 Kudos
Message 3 of 5
(728 Views)

Hi new account,

 

what exactly are you complaining about?

 

This is the LV2021 way:

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(712 Views)

My main complaint is: 
Wiring a digital waveform into Get Digital Data Components automatically turns it into Get Waveform Components, which I think is expecting an analog waveform and results in a bad or unwired terminal error. 

 

But thanks I could use your example. Seems a bit roundabout, but i think it should work. 

0 Kudos
Message 5 of 5
(682 Views)