NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Add and store step properties

I want to add a step property to store my database ID for this step. This step property must be saved in the sequence file and the next time the sequence file is used the value written in this property must be available.

I used the following calls:

// to write the data
oleErrChk(TS_PropertySetValNumber (step, &errorInfo, "Step.MdBvar", TS_PropOption_InsertIfMissing, 1223));

// to read the data
oleErrChk(TS_PropertyGetValNumber (step, &errorInfo, "Step.MdBvar", 0, &dbID));

When I directly read the data after the write , the data is available!

However when I store the sequence file with the call:

oleErrChk(TS_SeqFileSave(gCurrentSequenceFile, &errorInfo,NULL));

And you look in this sequence file the data is actually there
, in the sequence file. However when I load the sequence file again and try to read this property with exactly the same call as used before the data is gone. Another strange thing is that when I load the file is TestStand and save the file the data is gone. It looks like the data is ignored by TestStand. How can I solve this problem. I don't want to use globals because this dbID is a property of that specific step.

I hope someone can help me.

Thanks in advance, greetings Maarten de Bree
0 Kudos
Message 1 of 3
(3,232 Views)
Maarten,

All steps have a step type, and TestStand expects every step to have the same properties as the step type. You probably noticed that the Sequence Editor does not allow you to add properties to steps. TestStand does not prevent you from adding properties programmatically through the API, but it does not check for these unexpected properties when you save the file, so those properties are then lost.

If you are using custom step types then you can just open the step type for that step in the Sequence Editor and add the property. Otherwise, I would suggest storing the database ID (or an array of them if there are many such steps) in the Sequence Locals.

I hope this helps.
0 Kudos
Message 2 of 3
(3,232 Views)
Hi,

Yes this helped. I don't want to use custom step types because I don't need any changed behaviour of the step, I just want to add an extra property. So the option with Sequence Locals is the one for me I think. After some days of trying I managed to add an array structs to the sequence locals. It looked like nobody did this before according to the examples and questions. The only problem I now still have is how do I identify the step. At this moment I use the following key (assuming that locals are only available within the sequence) 'Stepgroup,StepIndex'. My question is, is this sufficient to uniquely identify the step?

Maarten
0 Kudos
Message 3 of 3
(3,232 Views)