NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Jane.Yu
Posts: 39
0 Kudos
Accepted Solution

change a stationglobal variable externally from a LV

Hi,

I'd like to change a stationglobal variable in teststand externall by a LabVIEW program. Does anyone have any relevant example code for this?

Thanks,

Jane

Active Participant
~jiggawax~
Posts: 1,038
0 Kudos

Re: change a stationglobal variable externally from a LV

Would this be during execution?  Do you just want to change the value or the datatype?

 

One thing you can do is just pass in the Sequence Context to the VI you are calling.  Then use the TestStand - Set Property.vi to change the value.  Your Lookup String would be StationGlobals.MyVariable.

 

Hope this helps,

jigg
CTA, CLD
~Will work for kudos and/or BBQ~
Active Participant
~jiggawax~
Posts: 1,038
0 Kudos

Re: change a stationglobal variable externally from a LV

jigg
CTA, CLD
~Will work for kudos and/or BBQ~
Member
Jane.Yu
Posts: 39
0 Kudos

Re: change a stationglobal variable externally from a LV

The VI I want to use is an independent program. I only want to change the value of the stationglobal variable. The sequence is not executing when I change the value. Is this possible?

Active Participant
~jiggawax~
Posts: 1,038
0 Kudos

Re: change a stationglobal variable externally from a LV

jigg
CTA, CLD
~Will work for kudos and/or BBQ~
Member
Jane.Yu
Posts: 39
0 Kudos

Re: change a stationglobal variable externally from a LV

There is an error when I run the code. Is there anything I should be aware of?

Thanks.

Member
Jane.Yu
Posts: 39
0 Kudos

Re: change a stationglobal variable externally from a LV

Sorry. It works now. I opened wrong API property.

Thanks a lot!

Member
Jane.Yu
Posts: 39
0 Kudos

Re: change a stationglobal variable externally from a LV

Hi,

There is one last question. After I changed the value, how can I programmatically update the value display in teststand? It did show me a window saying "the stationglobals.ini file has been changed, do you want to reload....". Can I do this using automatically?

Active Participant
~jiggawax~
Posts: 1,038
0 Kudos

Re: change a stationglobal variable externally from a LV

[ Edited ]

There is a ReloadGlobals method for the Engine object.  However, in my example you are creating a whole new engine.  That would not be related to the engine instance of your sequence editor or UI.  You would need to have that instance of the engine call the ReloadGlobals method.

 

Regards,

jigg
CTA, CLD
~Will work for kudos and/or BBQ~
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page