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: 

SetValBoolean and GetValBoolean define correct option

Solved!
Go to solution

The options from PropertyOptions are not clear to me. I would like to create a temporary boolean global at beginning of the sequence and then later in the sequence check, if this boolean is set true.

 

There is an example which I used as template:

 

Using Temporary Globals - TS2012.seq

 

In this example, they use PropOption_InsertIfMissing for set and get (Number, not boolean).

 

PropOption_InsertIfMissing–(Value: 0x1) If the property the lookupString parameter specifies does not exist, use this option with the SetVal and GetVal methods of the PropertyObject class to create a new property. The PropertyObject.SetValVariant and PropertyObject.GetValVariant methods do not support the InsertIfMissing option.

 

In the definition is not explained, what if string is already existing? Will it just change the value?

 

And which PropertyOption I choose for GetValBoolean, if I just want to read the value, but not insert new if not existing?

 

 

0 Kudos
Message 1 of 3
(977 Views)
Solution
Accepted by topic author PTH-POS

Hello,

 

The SetVal method actually sets a PropertyObject value. And optionnally, it can create the property object if missing. So yes, if the property already exists, it just sets the value.

 

If you do not want to use any option, you may use PropOption_NoOptions (Value: 0x0).

 

Regards,

0 Kudos
Message 2 of 3
(942 Views)

Thanks for the support. I wrongly interpreted how to use TemporaryGlobals.SetValBoolean abd GetValBoolean. Once its created, it can be used like a normal variable. I was "creating" it every time new, when I tried to set the variable true.

 

Therefore for read, I dont have to take care about PropertyObject.

 

I can read it like this:

RunState.Engine.TemporaryGlobals.Stop_on_fail_flag

0 Kudos
Message 3 of 3
(926 Views)