05-11-2014 10:29 AM
Hello everybody,
I am trying to read and write FileGlobals with TestStand ActiveX control in C#.
I have tried with:
SequenceContext contextOfTraceMsg = e.thrd.GetSequenceContext(0, out frameId);
var filepara = contextOfTraceMsg.FileGlobals.GetSubProperties("ProjectParameter.NestIsTested", 0).GetValue(1); (NestIsTested is a boolean array)
but with no success.
Can anyone tell me how to do it right?
Thank you in advance!
Regards
Solved! Go to Solution.
05-12-2014 10:12 AM - edited 05-12-2014 10:13 AM
@0049 wrote:
Hello everybody,
I am trying to read and write FileGlobals with TestStand ActiveX control in C#.
I have tried with:
SequenceContext contextOfTraceMsg = e.thrd.GetSequenceContext(0, out frameId);
var filepara = contextOfTraceMsg.FileGlobals.GetSubProperties("ProjectParameter.NestIsTested", 0).GetValue(1); (NestIsTested is a boolean array)
but with no success.
Can anyone tell me how to do it right?
Thank you in advance!
Regards
Try this:
bool nestIsTested = contextOfTraceMsg.FileGlobals.GetValBoolean("ProjectParameter.NestIsTested", 0);
Hope this helps,
-Doug
05-12-2014 03:07 PM
Hello Doug,
Thanks for the reply.
It works for reading boolean value. Then how to read boolean array?
Regards,
05-13-2014 09:20 AM
@0049 wrote:
Hello Doug,
Thanks for the reply.
It works for reading boolean value. Then how to read boolean array?
Regards,
For an array you can either do this:
1) bool[] myarray = contextOfTraceMsg.FileGlobals.GetValVariant("myarray", 0);
Or
2) Use GetNumElements() and GetValBooleanByOffset().
-Doug
05-14-2014 12:32 AM
Thanks Doug!