LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When is dataflow not data flow? Updating LabVIEW Arrays through Call Library Function Nodes?

I recently was tasked with using a PicoScope and ended up as flabbergasted as the rest of you.  To further muddy the water, here is another example.  I cleaned up the example code which resulted in the following.  The buffers are put into a queue where the driver then updates their data.  The stacked sequence structure contains a SetDataBuffers for each enabled channel.

 

terickson_1-1583180066201.png

 

 

CLA
Message 11 of 17
(2,330 Views)

This is utterly obscure and only appears to work thanks to LabVIEW's lazy memory reallocation for optimization purposes. It is definitely not valid dataflow and can break by any number of reasons, including future LabVIEW memory allocation changes for reasons like optimization or security improvements.

The proper implementation would export additional functions from the DLL that are specifically written for LabVIEW and work with proper memory allocation schemes with a defined allocation and deallocation routine for the buffers.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 12 of 17
(2,298 Views)

I absolutely agree with you.  Is anyone aware of any attempts to contact PicoScope and make them aware of this?  Currently their SDK only includes the scope specific DLL's and their associated header files.

CLA
0 Kudos
Message 13 of 17
(2,284 Views)

Dang... I know this isn't guaranteed to always work, but I have a project right now that uses shared memory to do very high speed data synchronization over SCRAMNet. I might have to actually try to pull this one off; right now, copying all of the data from the SCRAMNet memory location to a LabVIEW wire is taking something like half of my total loop time. Since LV doesn't normally provide ways to write directly to a memory location I have to rely on some looped dll calls anyway... and this MIGHT let me squeeze a bit more performance out of my code.

 

Of course any old update might break it, but I like to live dangerously. 😉

0 Kudos
Message 14 of 17
(2,256 Views)

Just saw you post on Pico forum and was intrigued. I have been using the version of rapid block mode with the DVR and was quite confused as how/why it actually worked. I tried to make the code more efficient (recreating the DVRs takes several 10s of ms) to no avail as the data "vanishes" as soon as I try something more fancy like using the in place node...

I am not super hopeful they will provide something too definite as their LV examples are not far from spaghetti code.

L.

0 Kudos
Message 16 of 17
(2,148 Views)

I was hoping for some interaction over the the Pico forum but it has been crickets.

0 Kudos
Message 17 of 17
(2,143 Views)