10-27-2009 10:25 AM
Hi All,
A rather strange bit of LabVIEW black magic as far as i can see..............
In the attached picture the bits of interest are highlighted with red circles. The VI is for streaming data from a Picoscope (see http://downloads.picotech.com/drivers/ps2000sdk_r6_2_14_0.zip for the files - this is ps2000_fast_stream.vi) and is what is provided from Picotech. When i run the vi, "buffer 2" gets loaded up with 1 million zeros (as expected) while the Picoscope is being set up and settings written to it. We then enter the while loop where data is acquired quickly and displayed on a graph. The values from "buffer 2" get passed through the tunnel highlighted in red. What is odd (at least i find it odd - perhaps i just don't know LabVIEW very well) is that each time the while loop iterates "buffer" is updated with live data from the oscilloscope. It is 1 million points long, but the first n data points are the live measurement from the scope.
As far as i can see the tunnel is not retaining and passing through the historic data passed to it (as i would expect it to do), but is passing through the live data from the Picoscope. In other words it seems that the bit of memory that retains the value for the tunnel is being over written with the live data from the Picoscop. This seems very sneaky 🙂
Any thoughts?
Dr Phil
10-27-2009 11:37 AM
10-27-2009 12:01 PM
Hi Dennis,
Thanks for replying. VI is in the link. Buffer does change once the while loop starts, so i really don't understand what is happening!
Best regards,
Dr Phil
10-27-2009 12:04 PM
10-27-2009 12:19 PM
Hi Dennis,
File attached.
Best regards,
Dr Phil
10-27-2009 12:21 PM
10-27-2009 12:35 PM
10-27-2009 01:24 PM
Hi Dennis,
Modified file attached. The only modifications that i am aware of is to insert the two graphs buffer and buffer 2.
This VI runs and buffer updates!
Dll's and other dependant vi's should be in the zip that i previously attached.
Dr Phil
10-27-2009 02:10 PM
10-27-2009 02:52 PM
Oh yes something is going on! I haven't downloaded the code but--- look at the sequence locals- two SL writes and I only see 1 SL out terminal. Someone has overlaped tunnels and SL nodes from the other frames.
Just another reason to stick with a good programming style guide: avoid stacked sequences (use a state machine), avoid local variables. and never never stack tunnels.
Attached is a piece of write only code to show what I mean