01-16-2012 08:26 AM
Hi All
I need to get access to locals in my sequence file from C# in order to udate it.
How can i do it. Is there any example?
Regards.
Solved! Go to Solution.
01-16-2012 08:36 AM
checkout the Computer Motherboard example in the TestStand examples folder under \Demo\.NET.
01-16-2012 08:59 AM
Thanks Ray , nice example but i fail to see some locals access.
01-16-2012 09:54 AM
The code modules for this example returns a boolean which is feed into the Step.Result.PassFail. Also the Error values are passed into the individual elements of Step.Result.Error.
But these code modules could have passed the data into a local variable rather than a Step property.
Similarly, data could be passed into the code module this way if the parameter of the code module was defined as an input rather than an output.
Hope this helps. I'll see if there is a better example.
01-17-2012 03:35 AM
After reading Test Stand help i understand that i can get access to locals with SequenceContext object.
How can i initialize it? Should i pass my *.seq file as a parameter? In general i understand but in details it's quite obscure.
01-17-2012 04:54 AM
John,
there is an example from juergen in
that may help.
01-17-2012 05:40 AM
Thank you Ray i'll try.
01-19-2012 05:36 AM
After some studying i came with code:
s
string str; string seq_file_path = Path.GetDirectoryName(Application.ExecutablePath) + "\\Demo.seq"; private void buttonExecute_Click(object sender, EventArgs e) { Engine my_egine = new Engine(); SequenceFile seq_file = my_egine.GetSequenceFileEx(seq_file_path, 0, TypeConflictHandlerTypes.ConflictHandler_UseGlobalType); SequenceContext seq_cont = seq_file.NewEditContext(); PropertyObject prop_obj = seq_cont.AsPropertyObject(); str = prop_obj.GetValString("Locals.strTextBox", 0); MessageBox.Show(str); }
I get an exeption:
Unknown variable or property name 'Locals'.
Error accessing item 'Locals.strTextBox'.
What do i wrong?
01-19-2012 06:23 AM
Hi John,
You need to get a reference to a Sequence within the SequenceFile to see the Locals.
At SequenceFile level you can see any FileGlobals.
Hope this helps
01-19-2012 06:34 AM
Hi Ray,
How i get a reference to a Sequence within the SequenceFile ?
Could you explain it by example?