NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change 2 variables synchronously in Sequence Editor?

Hello everybody,

 

My sequence file have 2 FileGlobals variales in the Sequence Editor. When I modified one variable, I wish the another variable can be changed with the first variable automatically. Is there a convenient method to do that?

 

 

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

I'm pretty sure this isn't available.  I've never seen anything like this in any language, let alone TestStand.

 

What is your goal with this?  Maybe there is a better way to accomplish what you desire.

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

Thanks for your reply!

 

It is useful in the following example,

struct {

   a:2,

   b:3,

   c:4,

   d:7,

} BBBB;

struct BBBB ss;   // express with Container variale in TestStand

short  dd;             // express with Number  variable in TestStand

 

In TestStand Editor, I define 2 FileGlobal Variable, one is dd with number type,  the other is ss with container type. Variable ss and Variable dd have the same size, child item (a,b,c,d) of ss has the intuitive meaning, but when it is about  to read or write data (stored in dd), they must be a whole. 

Sometimes a specifed child of ss is midified, the value of dd must be modified  synchronously.

 

 

 

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

Maybe three methods can resolve this question,

  1. Through Event from UI Message.
  2. Through some module callback.
  3. Launch a thread in SequenceLoad(?) callback to monitor  the changing of all variable.

But I don't know actual solution.

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

Do you need it to happen when they update the variable?  Or does it just need to occur before they execute?  If that is the case you can do it in the ProcessSetup callback.

 

SequenceFileLoad is not a good choice because then you would need to call SequenceFile.Save().  This requires the development license so if you ever move to a deployment license you would be hosed.

 

I don't know how a UI Message would help you here. 

 

Regards,

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

Hi Steven,

 

I'm assuming you want to perform a C type union between a shortint and a structure of integers?

 

I'd try using a seperate thread to monitor and update the FileGlobals, see the attached example.

 

Regards,

 

Charlie

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

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