LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between run and run continuously?

Hello,
I have written a sub-vi to construct two synchronised square waveforms and intend to use it in another program for (analog) output to channels one and two of my 6062E card using LabVIEW 6.1. However, I have run into a problem. When I run the sub-vi by itself by pressing the 'Run' arrow, I get the same waveforms constructed everytime, which is the behavior I want. I would like the other program to call this sub-vi and get the same waveform array each time.

That is not what happens, though. Successive calls to this sub-vi produce an ever-extending waveform. I also see this extending behavior when I run the sub-vi by itself using 'run continuously'. The waveform builds up in a repeating fashion. I have attached the sub-vi below so that you may play with it.

Why is the behavior of pressing 'Run' several times consecutively giving me a different behavior than when I run the vi continuously? I suspect that the 'build array' call I make has something to do with it, but I don't know for sure. I have been unable to zero/clear the 'waveforms' array variable.

Thanks up front for any tips you could give.

Cheers,
~Dave
0 Kudos
Message 1 of 4
(4,978 Views)
Maybe you want to wire a TRUE to the "reset signal" input of your two waveform generators?
Message 2 of 4
(4,971 Views)

Hi,

First of all i couldnt get the array to build up. It always contained 2 elements in it, which i suppose is correct.

If you are facing this problem then follow the steps below to clear the array and waveform chart.

In the first sequence of your program, create a local variable of the array. Right click on the variable and select "Change to write" and right click again and create a "Control" for it. This will ensure that the previous data is removed from the array before writing new data.

In the first sequence of your program, create a property node of the "Wave Form chart" you are using and select "History". Right click on history and select "Change to write" and right click again and create a "Control" for it. This will ensure that the previous data is removed from the Wave form chart before writing new data.

I have attached the modified code. Look in sequence zero.

Rgds

Prithvi.

 

Message 3 of 4
(4,954 Views)
Awesome! Thanks for the replies. Both solutions seem to work well. I had to slap my forehead when I saw that 'reset signal' input!

Cheers,
~Dave
0 Kudos
Message 4 of 4
(4,916 Views)