LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to collapse boolean sequence into digital waveform

Solved!
Go to solution

Hello,

 

I'm trying to build a kind of logic analyzer using digital waveform subVI.

 

What I'm doing :

1) Read all data

I'm reading from the VISA (UART) sequence of bytes (it represent a package of analog & digital information receiving from my board).

 

2) Parsing string of HEX package to relevant sections: digital bytes, analog bytes ...

 

3) Convert the string into bytes 

 

4) (Meanwhile) Each byte represents bool ( true/false ), so I'm converting them into boolean.

 

5) Collapse all boolean into bool array so I can send it to the digital waveform.

 

Results :

Each line in the digital waveform represents the logic level for each boolean but there is no toggle.

What I'm looking for: for example time scale for X will be 3 seconds and my data will change every 200 mS, for example.

 

You can find attached my VI.

I really appreciate any help.

 

Thanks in advance.

 

 

 

0 Kudos
Message 1 of 15
(3,846 Views)

My problem is that using FOR loop there is no new data insert for each loop iteration.

So the array build inside the loop is filled with the same value for each line.

And that's why I see on the waveform same level on each line and there is no line toggling. 

 

Please advise how can I implement such a thing. 

It should be kind of FIFO I assume.

 

Thanks in advance.

0 Kudos
Message 2 of 15
(3,771 Views)

Hi moran,

 

it would help when you downconvert your VI to an older LabVIEW version, LV2020 is quite new and notused so much until now…

 


@moranfarky wrote:

My problem is that using FOR loop there is no new data insert for each loop iteration.

So the array build inside the loop is filled with the same value for each line.

And that's why I see on the waveform same level on each line and there is no line toggling. 

 

Please advise how can I implement such a thing. 

It should be kind of FIFO I assume.


You don't need a FIFO to filter "no new data" events: why do you try to insert "no new data" into an array at all?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 15
(3,767 Views)

Hi,

 

I want to collect the data ( that changed) and show it on the digital waveform.

Meanwhile, I can only display the line-level because I don't collect new data in the FOR loop. 

 

 

0 Kudos
Message 4 of 15
(3,764 Views)

Hi moran,

 


@moranfarky wrote:

I want to collect the data ( that changed) and show it on the digital waveform.


So you want to collect data? Usually you should use an array to "collect" several elements of the same datatype…

Best regards,
GerdW


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

As I wrote before ..... how can I fill an array in FOR loop with new data.??????

Or should I use other technics?

 

 

0 Kudos
Message 6 of 15
(3,757 Views)

Hi moran,

 


@moranfarky wrote:

As I wrote before ..... how can I fill an array in FOR loop with new data.??????


Usually you use autoindexing to generate an array in a FOR loop.

You could use conditional tunnels to exclude certain elements from your generate array.

Or you use a shift register with a BuildArray node…

All this is pretty basic LabVIEW stuff!

 

As I wrote before: you are using a very new LabVIEW version and it would allow far more people (including me) to open your VI if you would attach a down-converted version of this VI!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 15
(3,753 Views)

Probably I missed something.

 

It doesn't help me any indexing at the input stage because I "got in hand" only stream of boolean that changed every ~300mS.

 

How can I take this stream and build from it a bool array?

 

I know that the below solution doesn't do the work due to the fact that the bool input doest change for each iteration inside the loop.

* Meanwhile, the boolean push-button just simulate my stream.

 

Please advise.

I really appreciate if someone can send a solution. 

 

 

 

 

moranfarky_1-1589969449643.png

 

0 Kudos
Message 8 of 15
(3,715 Views)

Hi moran,

 


@moranfarky wrote:

How can I take this stream and build from it a bool array?

 

I know that the below solution doesn't do the work due to the fact that the bool input doest change for each iteration inside the loop.

* Meanwhile, the boolean push-button just simulate my stream.

 

Please advise.

I really appreciate if someone can send a solution. 


Your image already shows the steps needed: receive a boolean value, use BuildArray to append this boolean to an array, use shift register to store the array. What else do you want?

 

On your image: We cannot debug images with LabVIEW, we prefer real code as VI file.

Why do you iterate the FOR loop 8 times for a single boolean value?

Why do you only append TRUE values? What do you do in the other case? (See the point on not able to debug images?)

Why do you AND with TRUE? This is a classic Rube-Goldberg operation!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 15
(3,707 Views)

GerdW thanks for your help.

 

### I'm using Labview 2020 - how to downgrade and send you VI for 2019 ? or drug and drop image?

 

At the end, I need a bool array that filled with 8 elements, while each element is a sample of my pushbutton.

MyArray[0] = pushbutton level at t0

MyArray[1] = pushbutton level at t0 + 200mS

MyArray[2] = pushbutton level at t0 + 400mS

.......

 

The result of my "solution": at the end ( 8x200mS ) --> all the 8 ( That's why the For loop iteration is 8 ) elements are High or all of them are Low.

 

 

 
 

 

 

 

 

 

0 Kudos
Message 10 of 15
(3,704 Views)