Lost Buffer

Post your LabVIEW discussions here
Post Reply
Posts: 0
Joined: Tue Sep 28, 2021 6:11 pm

Lost Buffer

Post by ArtistUSA »

Attached are two simplified VIs that were created to illustrate a problem I am having in a much larger application. The B version works. When the START button is pressed data is collected from a PicoScope 5242D. When the same is done with the C version I get all zeros for output from the PicoScope.

The difference is that in the B version the "PicoScope5000aStartStreaming.vi" where the data buffer is allocated is located outside the inner While Loop that contains the Event Structure, and in the C version this is inside. In this C version the data buffer pointer is getting lost due to, I believe, this data buffer being copied into a new allocation when fed into the shift register within the While Loop.

I have attempted several ways to solve this including a modified version of "PicoScope5000aStartStreaming.vi" that takes a reference to a front panel array object in the main program.

Is there away to prevent the original buffer pointer from being lost when allocated within the While Loop?

It is desirable to have this allocated within this while loop, and Event Structure so that between data collections acquisition, and trigger, settings can be changed. I could put the equivalent of the all in the outer While Loop in its own thread in the much larger application. This thread would then be a lot like the B version. I am hoping to avoid this.
PicoScope5000aExampleStreamingMSO event frame shift register test C.vi
(50.33 KiB) Downloaded 154 times
PicoScope5000aExampleStreamingMSO event frame shift register test B.vi
(49.64 KiB) Downloaded 172 times

Post Reply