From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading the Front Panel of a VI executing in TestStand in a LV SubPanel

Hi,

 

I am trying to load the Front Panel of a VI in a SubPanel when this particular VI is running in TestStand (using LV2017 and TS2016 SP1). 

 

I am using the method shown here : https://forums.ni.com/t5/Example-Programs/Dynamic-LabVIEW-Subpanel-in-a-TestStand-User-Interface/ta-..., except I am using a UserMessage instead of the Trace UIMessage.

 

My TestStand sequence consists of 2 steps : 

- Statement Step sending the UserMessage. The path to the VI is retrieved and sent to LabVIEW UI by the UserMessage Callback.

- Action step executing the VI I want to show in the SubPanel. 

 

I then use an Open Reference and the Insert VI method of the SubPanel in the LabVIEW UI.

 

The problem is that the Front Panel is loaded in the SubPanel properly, but it is not updating during the execution of the VI (not displaying values in a waveform chart and not updating a boolean indicator). 

 

I also get a similar problem with the example in the link above. The Front Panel of the VI opens in a window and shows in the SubPanel. However, only the Front Panel in the window is being updated.

  

Thank you

0 Kudos
Message 1 of 10
(3,774 Views)

Hi sleb

 

Does any of the caveats apply to you application? (see your link: https://forums.ni.com/t5/Example-Programs/Dynamic-LabVIEW-Subpanel-in-a-TestStand-User-Interface/ta-...)

 

Do you use "reentrant execution" for your SubPanel-VI?

Could you share your SubPanel-VI and the sequence?

Best regards,

Chris

0 Kudos
Message 2 of 10
(3,719 Views)

Hi Chris,

 

I'm working with 'sleb' on this issue.

As mentionned in his first post, the issue is visible even in the code found at the link you specified (this link is mentionned in his first post).

VIs are not reentrant.

We found several issues here :

  1. Our front panel was at first displaying a chart. We replaced the chart by a simple counter and it worked better... So I guess there is an issue somewhere in the chart control.
  2. With this counter we found out that, in fact, the problem comes from the UI Thread. With the simple counter, value in the indicator changes while the panel is visible. But values pushed to indicators while the VI was not yet visible are not displayed correctly when the panel is inserted into the SubPanel : they display the default value (ex. boolean indicator set to True is shown on the interface to inactive, but its value is well set to true (verified calling a local variable later in the code execution)).

So we have to find a way to force the entire front panel to refresh. We can do that into the LV step by adding a property node within our while loop, but that's extra code we don't want our customer to add. We need to find an 'external' way to fix this...

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 3 of 10
(3,714 Views)

Hi CyGa

 

As you say... Looks like the problem comes from the UI Thread or the chart control.

In the past, we used also chart controls on the front panel of SubPanel-VIs. We had no problems with it so far.

 

Could you share a demo (Sequence and VI) witch demonstrate this effect?
This will help me (us) to analyse your problem.

 

Kind regards,

Chris

 

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

Hi,

The code is part of a bigger framework and somehow hard to isolate.

But the behavior can also be seen with the code furnished as exemple in the forum thread you pointed out.

The fact is that we must find a way to force the front panel to redraw... from the outside of the VI.

If you have an idea...

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 5 of 10
(3,705 Views)

Hi

 

I can not see any problem with the example.

What do you mean with "... from the outside of the VI". Which VI?

 

An idea...

In your LabVIEW UI, first you open the VI reference to insert in the SubPanel.
Play around with the FP.State property (eg. minimize first and then set to standard).

 

Kind regards,

Chris

0 Kudos
Message 6 of 10
(3,680 Views)

Very interesting !

So you see the plot moving into the graph embedded in the UI SubPanel ??

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 7 of 10
(3,673 Views)

I have downloaded the example "oisubpanel.zip", which you can find here:

https://forums.ni.com/t5/NI-TestStand/Extra-Window-when-using-SubPanel/td-p/2705251

Yes, I can see how the curve moves.

0 Kudos
Message 8 of 10
(3,668 Views)

OK, with LV2017 it doesn't move at all.

We've tried to modify most of the settings of the adapter or ways to catch the event cllbck and load the VI ref into the subpane.

Lookig at the code modified by users in the forum thread, I guess there is still a caveat : the graph is refreshed continuously so you get the updates when the FP is loaded.

But if you modify the example, and you add a LED on the 'VI to insert' 's front panel (dafult value = False), and set it right away to True it will appear turned off on the FP.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 9 of 10
(3,663 Views)

The modified example from the forum thread works fine on my PC (LV2017).

Also with the modification you have described (LED with default value = false and set it right way to true).

0 Kudos
Message 10 of 10
(3,651 Views)