NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create container within Locals ?

Hi,

I was created TS_Sequence_Insert_Step (newSequence, &errorInfo, StepHandle, 0, TS_Step_Group_Main) but now I need to create Locals with the same names as in subsequence. Furtermore, need to create container within locals. I don't find any command related to Container creation. I was tried with TS_SequenceGetLocals, but seems to be it does not work. Do you have any idea how to handle this ? I've tried to do "manually"  and in locals possible to Insert->container. How to code this ?

I use CVI 2010.

 

Best regards,

branar

0 Kudos
Message 1 of 6
(3,621 Views)

Hi,

 

Check out this old Example

It creates a StationGlobals container.

For locals you have replace "StationGlobals" with "Locals"

 

hope this helps

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 2 of 6
(3,620 Views)

If you are creating just a runtime copy of the locals, then changing the StationGlobals to Locals will be fine.

 

 

Regards
Ray Farmer
0 Kudos
Message 3 of 6
(3,606 Views)

Hi,

 

I was tried to "translate" testStand code from example into CVI, bus some error appear with:

tsErrChkMsgPopup( TS_PropertySetPropertyObject (EngineHandle, &errorInfo, "Locals.Mystuff", TS_PropOption_InsertIfMissing, locals));

 Before I was set new object:

error = TS_EngineNewPropertyObject (EngineHandle, &errorInfo, TS_PropValType_Container, FALSE, "NAprop", 0, &locals);
	error = TS_PropertySetValNumber (locals, &errorInfo, szStartFreqMHz, TS_PropOption_InsertIfMissing, 0.0);
	error = TS_PropertySetValNumber (locals, &errorInfo, szStopFreqMHz, TS_PropOption_InsertIfMissing, 0.0);
    error = TS_PropertySetValNumber (locals, &errorInfo, szResBWHz, TS_PropOption_InsertIfMissing, 0.0);
	error = TS_PropertySetValNumber (locals, &errorInfo, szSrcPowerdBm, TS_PropOption_InsertIfMissing, 0.0);
	error = TS_PropertySetValNumber (locals, &errorInfo, szSaveinReg, TS_PropOption_InsertIfMissing, 0.0);
	error = TS_PropertySetValString (locals, &errorInfo, szSsuRoute,TS_PropOption_InsertIfMissing , "   ");
    error = TS_PropertySetValString (locals, &errorInfo, szConnect_text,TS_PropOption_InsertIfMissing , "   ");	

 SetPropertyObject is not working (ActiveX error).

 

Best regards,

branar

Also, in previous example container was in Main.sequence.Locals dispite his path was Station.Globals.

 

Can you help me with this ?

0 Kudos
Message 4 of 6
(3,593 Views)

Hi,

 

When you make your copy of the variable in Locals, you need to be using the SequenceContext not the Engine because there is not Locals at the Engine level.

 

tsErrChkMsgPopup( TS_PropertySetPropertyObject (SequenceContext, &errorInfo, "Locals.Mystuff", TS_PropOption_InsertIfMissing, locals));

 

 

Regards
Ray Farmer
0 Kudos
Message 5 of 6
(3,591 Views)

Hi Ray,

 

Thank you, now work fine.

Best regards,

branar

0 Kudos
Message 6 of 6
(3,586 Views)