04-13-2016 03:20 AM
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?
04-13-2016 08:31 AM
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.
04-13-2016 09:03 AM
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.
04-13-2016 09:15 AM
Maybe three methods can resolve this question,
But I don't know actual solution.
04-13-2016 10:10 AM - edited 04-13-2016 10:10 AM
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,
05-10-2016 07:08 AM
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