02-06-2014 02:15 PM
I'm working with a lot of sine waves of differing phases, so I made a quick oscilloscope VI. It has a zero crossing detector to act as a trigger so the display is stable and an input to specify the number of points to sample.
Simple enough, I got the thing working quickly but I ran into trouble making a standalone vi with a generic array output instead of having the display control embedded in the loop where the Output Array is in the diagram below. . Issue was, unless I hook up a strobe signal (circled) which is only true when the display updates and put a waveform graph control update in a little T/F case statement a waveform graph mostly displays a blank, every now and again you can see the display flash briefly. If the waveform graph is strobed the display is as expected.
I thought that if an array was put in a case statement it was updated when the case executed and the value remained (i.e. was latched) until the next update. This one does not act that way, the variable goes invalid or "not executed" most of the time.
If anyone can shed light on what I am not understanding about how LabVIEW updates and holds values I would really appreciate it. My code is working, but I wasted a lot of time on this and it does not seem to make sense.
Thanks in advance,
Bill
The code showing the output array and strobe pins for the output to display case:
Necessary code to get the display to be viewable, the local variable 1GEN... is a Waveform Graph:
02-06-2014 02:18 PM
The documentation is wrong, should say output array not cluster. Fixed...
02-06-2014 02:30 PM
Untill we see the other cases of that action engine we can't really figure out what the values that come out of the case tunnels and feed into the uninitiallized feedback nodes are (nor can we look at the initiallization options of the feedback nodes)
But, that should at least point you to a few possible areas where you can find trouble with your code
02-06-2014 02:47 PM
Hi Jeff,
Diagrams below for cases zero and 1, case 2 is above. vi also attached.
Thanks in advance,
Bill
Case zero: Waiting for zero cross
Case zero: Got zero cross
Case 1: Gathering samples to show on the scope
Case 1: All samples in
02-06-2014 02:58 PM - edited 02-06-2014 03:10 PM
Do you have the Clear Indicators When Called option turned on?
EDIT: Never mind. Just looked at your VI.
02-06-2014 03:11 PM
No, it's unchecked.
02-06-2014 03:11 PM
@crossrulz wrote:
Do you have the Clear Indicators When Called option turned on?
No, but the logic in the "Accumulate Data" case is inverted (Replace data if new sample count is less than the current number of samples)
02-06-2014 03:41 PM
Jeff,
I think not. The snippet in question is:
in the >= node, top node is X, bottom node is Y, output is true only if X >= Y which is what I want, if it's less then the array is being built and we don't display the array.
The code does work. If you put the Waveform Graph control right inside the Display Data case then all is fine. However, if you don't to make it more general then the display is no good unless you use the strobe.