NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating 'Persistent' Variables inside a running sequence

I am trying add local and file global variables into the a sequence that is running.  I can add the variables fine using PropertyObject.SetValNumber, with the InsertIfMissing flag set, (for example) but this only creates a temporary variable that is lost when the sequence completes.  Is there a way to save this new variable into the sequence file, or is there another way I should be going about this?
 
Regards
 
Steve 
There are 10 types of people in the world that understand binary, those that do and those that don't.
0 Kudos
Message 1 of 7
(4,280 Views)

Hi Steve,

You will need to change the PropertyObjectFile and perform the IncChangeCount to indicate to the engine that the file has changed. Then you can perform the SaveFileIfModified.

Hope this helps

Regards

Ray Farmer

Regards
Ray Farmer
Message 2 of 7
(4,278 Views)

Thanks for your reply Ray, think I am still missing something though.

My sequence is attached, temporary variables are cretaed but not saved to the sequence file on completion.

Regards

Steve

 

There are 10 types of people in the world that understand binary, those that do and those that don't.
0 Kudos
Message 3 of 7
(4,272 Views)

Hi Steve,

You will need to set the File objects as well as the runtime objects (I am assuming that you need the values at runtime).

Using the PropertyObjectFile reference get a PropertyObject reference using the AsPropertyObject then  use the Get/Set method to update your values in the file.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 4 of 7
(4,268 Views)
Sorry Ray still missing a vital bit of information, my variables are still not being saved into the seq.  Think it is the Sequence File reference I am using to get the Sequence File Property Object.  My call looks like Local.SequenceFileObj = PropertyObjectFile(RunState.SequenceFile).AsPropertyObject.
 
Attached is my sequence
 
Regards
 
Steve
There are 10 types of people in the world that understand binary, those that do and those that don't.
0 Kudos
Message 5 of 7
(4,263 Views)

Hi Steve,

try this response, particularly James' initial response to the question.

http://forums.ni.com/ni/board/message?board.id=330&message.id=10706

If you have labVIEW then maybe you will beable to look at the supplied example.

I will try to provide an example later on today.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 7
(4,258 Views)

No need for further examples Ray.  Decoded James's.

Thanks for all your help

Steve

There are 10 types of people in the world that understand binary, those that do and those that don't.
0 Kudos
Message 7 of 7
(4,255 Views)