NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

change a stationglobal variable externally from a LV

Solved!
Go to solution

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

0 Kudos
Message 1 of 17
(5,281 Views)

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, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 17
(5,278 Views)

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 17
(5,277 Views)

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?

0 Kudos
Message 4 of 17
(5,263 Views)
Solution
Accepted by Jane.Yu

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 17
(5,261 Views)

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

Thanks.

0 Kudos
Message 6 of 17
(5,259 Views)

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

Thanks a lot!

0 Kudos
Message 7 of 17
(5,257 Views)

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?

0 Kudos
Message 8 of 17
(5,257 Views)

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, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 9 of 17
(5,245 Views)

I need to write to a StationGlobal using the TS Engine Reference. I have tried SetValIDispatch method and it runs with no errors, but does not set the StationGlobal (known because when I use the method GetValIDispatch immediately after it returns 'Nothing'). What method do I use to write to a Station Global that is of type Object Reference?

 

 

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