05-18-2020 10:01 AM
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.
Solved! Go to Solution.
05-19-2020 06:20 AM - edited 05-19-2020 06:21 AM
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.
05-19-2020 06:34 AM
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?
05-19-2020 06:44 AM
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.
05-19-2020 06:47 AM
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…
05-19-2020 06:59 AM
As I wrote before ..... how can I fill an array in FOR loop with new data.??????
Or should I use other technics?
05-19-2020 07:12 AM
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!
05-20-2020 05:16 AM - edited 05-20-2020 05:22 AM
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.
05-20-2020 06:30 AM
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!
05-20-2020 06:57 AM
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.