NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I modify a FileGlobal from a new control on the VB testexec ExeDisplay form?

From a new control on the "ExeDisplay" form (ExeDisplay.frm) in the "testexec" project (teexec.vbp), how can I write to a sequence file global variable (i.e., FileGlobals.IntegerFromExeDisplay)?
My intent is to have a way to modify the behavior of the test in (close to) real-time, while allowing the test sequence to continue to run.
My sequence file uses the Sequential Model, TS 2.0, and VB 6.0.
0 Kudos
Message 1 of 5
(3,509 Views)
Hello Neil -

Provided you can isolate when to enable this button/user interaction so that you are editing the globals of a valid file, actually changing the value should not be too difficult. For example a quick and dirty approach might be something like:


Dim inc
inc = mCurrentSeqFile.FileGlobalsDefaultValues.GetValNumber("myVal", 0)


'display current val via some textbox
incDisplay.Text = inc
'set new val mCurrentSeqFile.FileGlobalsDefaultValues.SetValNumber "myVal", 0, (inc + 1)



Where FileGlobals.myVal is the variable I am incrementing once per button click event.

The one thing to remember is that the changes you make to this variable won't be saved once execution is finished, so I'm assuming that for every run of the exe
cution you want to be able to start from some known default. Let me know if this answers your question.

--Regards,

Elaine R.
National Instruments
http://www.ni.com/support
0 Kudos
Message 2 of 5
(3,509 Views)
That's exactly what I needed... Now I have access to the main sequence control global variables. I assume the GetVal works for locals as well?

Much thanks,
Neil
0 Kudos
Message 3 of 5
(3,509 Views)
Neil,

> That's exactly what I needed... Now I have access to the main
> sequence control global variables. I assume the GetVal works
> for locals as well?
>

Did this work for you? I had tried something similar, but couldn't seem to
change run-time instances of the FileGlobals. It appeared as though I was
modifying the non-running version of the sequence file. Maybe I was doing
something wrong. Did this work for you?

---
Joe
0 Kudos
Message 4 of 5
(3,509 Views)
> Did this work for you? I had tried something similar, but couldn't seem
to
> change run-time instances of the FileGlobals. It appeared as though I was
> modifying the non-running version of the sequence file. Maybe I was doing
> something wrong. Did this work for you?

Try Execution.GetFileGlobals. This allows you to modify run-time versions
of file globals in a sequence file.

---
Joe
0 Kudos
Message 5 of 5
(3,509 Views)