09-20-2012 08:23 AM
Hi guys,
is there any possibility to save file when the value from parameters on the mainsequence have been modified?
I know the method to save StatioGlobals thanks to CommitGlobalsToDisk, but in the case of Parameters of the Mainsequence of the sequence File I didn't find solution to save data modified from the execution to the current sequence file...
any idea ?
thanks
Pierre
09-24-2012 02:02 AM
Hi pfhrenry21,
You could use the propertyObjectFile method as "PropertyObjectFile.IsModified", "PropertyObjectFile.IsModifiedByUser" and "PropertyObjectFile.SaveFileIfModified".
How are performed the changes to the parameters?
Best regards,
Romain DUVAL || RF & Semiconductor Staff System Engineer || CLA || CTA
National Instruments France
09-24-2012 09:50 AM
RunState.SequenceFile.AsPropertyObjectFile().IncChangeCount(),
RunState.SequenceFile.Save("")
09-26-2012 02:17 AM
During the execution, Values from Parameters of the mainsequence are modified by sub sequence.
At the end of the execution I just want to save the new values from parameters of the main sequence but seems there's a difference between the sequence file and the current execution.
I tried already propertyObjectFile without success, I will try again.
09-26-2012 02:28 AM
it doesn't work snowpunter,
I put a breakpoint just before the execution of this code,
In my execution the variables from parameters are changed and after the execution the sequence file still contain old values.
09-26-2012 09:36 AM
When TestStand executes a sequence, it makes a copy of the entire sequence and uses the copied sequence, including the copied locals, for the execution. Making a copy of the sequence means that if you run the sequence in parallel, there will not be any conflicts between accessing the same local variable in the same memory location. Therefore, when you edit a local variable you are only editing a copy of the original local variable from the original sequence.
To reflect your changes in the original sequence, you need to access the original local variable rather than the copy made for the current sequence execution. You can do this by using the "SetVal..." methods, including SetValBoolean, SetValIDispatch, SetValInterface, SetValNumber, SetValString, and SetValVariant depending on your local variable's data type. When you specify the lookup string, instead of using Locals.myVariable
which would change the copied version of the local, use the following lookup string:
RunState.SequenceFile.Data.Seq["MainSequence"].Locals.myVariable
.
regards
Romain DUVAL || RF & Semiconductor Staff System Engineer || CLA || CTA
National Instruments France
10-03-2012 08:45 AM
thanks a lot, I succeeded to save the data from the execution to the file with your help !