NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read and write FileGlobals with TestStand ActiveX control in C#

Solved!
Go to solution

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

 

0 Kudos
Message 1 of 5
(4,567 Views)

@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

0 Kudos
Message 2 of 5
(4,540 Views)

Hello Doug,

 

Thanks for the reply.

It works for reading boolean value. Then how to read boolean array?

 

Regards,

 

 

 

 

0 Kudos
Message 3 of 5
(4,530 Views)
Solution
Accepted by topic author 0049

@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

0 Kudos
Message 4 of 5
(4,511 Views)

Thanks Doug!

0 Kudos
Message 5 of 5
(4,504 Views)