NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy container of objects by value

Solved!
Go to solution

Hi,

I am working on a custom parallel model. I have a container including multiple objects (LV class instance) created in the main UUT of the paralle model. I need to pass from main UUT to test sockets and have these object modified to different value depent on the test socket. In the test socket I tried to create a local version of the container and assign the value to it. But when I change the value, it still change in other test sockets. So I guess it still pass by reference.

 

Regards,

Thang Nguyen

0 Kudos
Message 1 of 5
(3,455 Views)

If go to Edit>>Sequence File Properties what is set for Sequence File Globals?  If it is set to share then they will stomp on each other.  If it is set to Separate then you can change them in each socket.  Not sure if this is the behavior you are going for but it's something to consider.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 5
(3,443 Views)

Jigg, 

It has separated file global. I am not sure how is this used to store memory through. What type of variables is stored in this?

 

Regards,

0 Kudos
Message 3 of 5
(3,426 Views)

jigg,

I think I understand now. What I am doing is store that cluster of object in ModelPluginConfiguration/RuntimeVariables, and I have just recognized that is a share memory space between test socket. I guess I will have to choose different memory space like test socket to store the value.

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

The other option is to create an array and index it based on the socket number.  So like this:

 

Array Of Objects

   0- Obj for Socket 0

   1- Obj for Socket 1

   2- Obj for Socket 2

 

 

Then whenever you access it or write to it just use socket index into that array.

 

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 5
(3,418 Views)