08-26-2016 01:28 PM
I have this very simple VI that read voltage from a DAQ until I stop the loop, it then saves the data into a .wav file.
My problem is: everytime I stop the VI, I would expect the shift register to clear. But if I restart the VI it saves the old data from the shift register and the new data into the .wav file. I just want the new data when I run the .VI, without having to close the program everytime.
Please help.
Solved! Go to Solution.
08-26-2016 01:39 PM
Pop-up on the SR and create a constant.
Ben
08-26-2016 01:43 PM
08-26-2016 01:51 PM
We I'll be... !
I never use the dynamic data type so I can only offer a possible work-around.
Cntrl-copy the the Waveform Graph 2.
Right-click and select "Change to Constant"
Wire that newly created constant to the outside of the SR.
Does that work?
Ben
08-26-2016 02:02 PM
That allows me to create a constant(a very weird looking one), but it does not clear the shift register.
08-26-2016 02:06 PM
right click the array control and choose "clear array" (or whatever tht option os called) and try it again. that is a cluster of an array of waveform data types. You can right-click (afterwards) and choose "view as icon".
Ben
08-26-2016 02:07 PM - edited 08-26-2016 02:08 PM
When you use that method to create a constant, it keeps the data from the control that it originated from.
Right click on the edge of the array constant until you see an option that says "Data Operations" > "Empty Array".
That should clear it out.
EDIT: oops, Ben posted the same thing while I was typing.
08-26-2016 02:10 PM
You need to initialize the shift register. The best way I've found to do that with dynamic data is to use a conversion to a blank array constant. See the attached screen capture
08-26-2016 02:12 PM
Perfect!! But the name was "delete element"! Great idea with the "replace" option!!
08-26-2016 02:12 PM
Perfect!! But the name was "delete element"! Thank you