08-07-2017 04:16 AM
Hello, LabView masters!
This is my first post, please be merciful 🙂 I implemented a VI which uses a state machine (via while loop and case structure), it reads the data from sensor and works nicely. It calls a DLL file under the hood, provided by Thorlabs.
However, after I wrapped it as an FGV (functional global variable), it does not update the sensor reading anymore. I read a lot of seemingly related posts, but nowhere could find an answer. Can anyone give me a hint what am I doing wrong? Please see my VIs attached and screenshots below.
I am using LabView 2016.
Thanks!
Solved! Go to Solution.
08-07-2017 04:38 AM - edited 08-07-2017 04:39 AM
Hi vladim,
welcome to the LabVIEW board!
Notes/hints:
- don't use so many local variables, especially when their terminals are unused! Use more wire! Use more shift registers!
- place all terminals, which are connected in the connector pane, outside of any structure in your block diagram! (Controls/inputs should be placed left, indicators/outputs on the right side of the block diagram.)
08-07-2017 04:55 AM
Hi, GerdW,
Thanks for tips! I think I used only 2 local variables, spots_x, spots_y, but I can surely replace them with shift registers. I monitored their values via debugging, they are essentially constants here (no race conditions). With the terminals, I will clean up more, thanks!
08-07-2017 05:33 AM
Here is the simple VI which calls my FGV twice, and the FGV returns identical values form the sensor: Measurement 1 = Measurement 2 (always).
I hope it clarifies a bit my problem.
08-07-2017 05:48 AM
08-07-2017 06:42 AM
Ups, yes, you are right. Although that VI with locals works, so it is not the problem. Thanks for pointing out!
08-07-2017 08:17 AM
Still, the problem remains unsolved. When I substitute the DLL-calling subVI (sensor-reading) with a random number generator, the result changes after every call to FGV, as expected. So, the DLL-calling subVI is a problem. Anyone has some hints?
08-07-2017 08:34 AM
08-07-2017 10:03 AM
Hi, GerdW,
I am glad it is not some well-known LabView feature. I surely read the drivers manual, but I can ask the manufacturer directly, it might be a good idea. I will keep my progress posted.
08-09-2017 05:18 AM
Solved the problem myself
There was a missing VI which explicitly commanded the sensor to take an image. It was not required in the While loop state machine (probably implicitly called), but was required in FGV VI.
Thanks for checking my trouble!