LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subVI does not update measurement when called as FGV (functional global variable)

Solved!
Go to solution

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!

Screen-StateMachine (working).pngScreen-FGV (non-working).png

 

0 Kudos
Message 1 of 10
(4,794 Views)

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.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(4,781 Views)

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!

0 Kudos
Message 3 of 10
(4,767 Views)

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.

 

Screen-Sequential calling of FGV.png

0 Kudos
Message 4 of 10
(4,749 Views)

Hi vladim,

 

there are far more locals like "wf data"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 10
(4,743 Views)

Ups, yes, you are right. Although that VI with locals works, so it is not the problem. Thanks for pointing out!

0 Kudos
Message 6 of 10
(4,740 Views)

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?

0 Kudos
Message 7 of 10
(4,722 Views)

Hi vladim,

 

then it seems related to your Thorlabs device. Did you read its manual? Did you ask its manufacturer?

(I don't have those driver installed and will surely not install it on my side…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 10
(4,713 Views)

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.

0 Kudos
Message 9 of 10
(4,699 Views)
Solution
Accepted by nvladim

Solved the problem myself Smiley Wink 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!

0 Kudos
Message 10 of 10
(4,664 Views)