LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay When Reading Network Variable from VBAI in LabVIEW

Solved!
Go to solution

Hello everyone,

I'm currently integrating Vision Builder AI (VBAI) with LabVIEW using a network shared variable.

In VBAI, I update the variable just before the end of each inspection. Then, in LabVIEW, I read this variable to retrieve the inspection result.

However, I'm experiencing a delay:
LabVIEW consistently reads the value from the previous inspection, not the current one — as if the variable update hasn't propagated in time.

Has anyone encountered a similar issue?
Any advice on how to ensure LabVIEW reads the latest value right after the inspection ends?

Thanks in advance for your help!

0 Kudos
Message 1 of 11
(385 Views)

Hi Salim,

 


@Salim28 wrote:

In VBAI, I update the variable just before the end of each inspection. Then, in LabVIEW, I read this variable to retrieve the inspection result.

 

LabVIEW consistently reads the value from the previous inspection, not the current one — as if the variable update hasn't propagated in time.

 

Any advice on how to ensure LabVIEW reads the latest value right after the inspection ends?


  • How does your LabVIEW VI know when to read that NSV? (Is there a race condition?)
  • How do you read the NSV? (Do you use the timestamp feature of the NSV?)
  • How does your code look like?

 

Best regards,
GerdW


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

 

Good morning Sir,

Thank you for your response. Below is a diagram explaining how the variable is configured and created. I then use this variable in LabVIEW to read its value.

 

 

 

Salim28_0-1751872092555.png

Salim28_1-1751872121028.png

Salim28_2-1751872181984.png

Salim28_3-1751872329717.png

 

 

0 Kudos
Message 3 of 11
(315 Views)

Hi Salim,

 

you forgot to show your LabVIEW code: how do you read the NSV and do you use its timestamp feature?

Best regards,
GerdW


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

Hello again sir,

I just call the variable inside the while loop, that's it."

 

Salim28_0-1751875948796.png

 

0 Kudos
Message 5 of 11
(235 Views)

Hi Salim,

 

I repeat from my first message: WHEN do you read the NSV? Is there a race condition?

 

Race condition: two processes accessing the same resource (here: your NSV) in a non-syncronized way.

 

How does process2 (LabVIEW-VI) know that process1 (VBAI) already updated the NSV?

 

You can check for updated values of the NSV by reading their "last written" timestamp!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 11
(209 Views)
Vision Builder problème

Hello my friend,

Would it be possible for you to share your email or LinkedIn profile so I can send you a Meet link to show you the problem in real time? Unfortunately, the program is restricted and cannot be shared or displayed publicly online.

Thank you very much for your understanding.

 

0 Kudos
Message 7 of 11
(199 Views)

Hi Selim,

 

this way you can check for updated values of NSVs:

Use the timestamp of the NSV!

Best regards,
GerdW


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

Hello everyone,

I am currently working on a Vision Builder AI project in which I have created a system variable named Result Inspection. This variable is visible in NI Distributed System Manager under the path:

localhost → Vision Builder 2023Result Inspection

I would like to read this shared variable directly in LabVIEW in order to process the inspection results.

  1. How to properly access or link this Vision Builder AI system variable in LabVIEW?

  2. Any additional components or steps I might be missing?

Thank you in advance for your help!

Best regards,
Salim

Salim28_0-1751890400035.png

 

0 Kudos
Message 9 of 11
(196 Views)

Hi Salim,

 


@Salim28 wrote:

I would like to read this shared variable directly in LabVIEW in order to process the inspection results.

  1. How to properly access or link this Vision Builder AI system variable in LabVIEW?

  2. Any additional components or steps I might be missing?


Please keep related discussion in one place!

Again you forgot to provide your LabVIEW code: how should we suggest "additional components/steps" when we don't know the current state?

 

You can also access NSVs programmatically:

Just provide the network path as shown in DSM…

Best regards,
GerdW


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