NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

UI Message help

I read the white paper, and thought I had this, but it isn't working,
I think it is in the UI end, most likely the nomenclature, but the TS Help is woefully lacking.
I am running three sockets in parallel mode, using the LabVIEW simple UI (LabVIEW 8.2.1, TestStand 4)
Each test runs close to two hours, and I need to display in the Status Message indicators something more meaningful than "Running ..."
In my main sequence I added an ActiveX action step with the following configuration:
Automation Server: NI TestStand API 4.0 (Ver 1.0)
Object Reference: RunState.Thread
Object Class: Thread
Call Method PostUIMessageEX
Parameters:
eventCode in 10001
numericDataParam____in__0
stringDataParam______in__"cooling down"
activeXDataParam____in__Nothing
synchronous_________in__True

I am not sure if the parameters are all correct, but I think so. When this step executes it should post the message to the TS engine. Then the UI must use it -

In the "Simple OI - Configure Event Callbacks,vi" I extended the 'Reg Event Callback' node and selected UserMessage. From here on everything was guesswork. User Parameter is a cluster of four references, I tried both Execution View Manager, and SequenceFile View Manager, I am not sure which would write to the Status Message indicator of the GUI, and neither seemed to work (but I probably have something else wrong as well). I right-clicked on the VI Reference input to the 'Reg Event Callback' node and selected Create callback vi. I unbundled Event data, used a property node to access the event code to drive an event structure. renamed case 1 to 10001 (same as the event code used in my ActiveX step),
within the case I use a property node to access the string data of the message ("cooling down ...") and turn it into a variant. I then use the Execution View Manager input reference wired to an IExecutionViewMgr property node and wire the variant to the property UserData
That is all I do - I was hoping this text would now be written to the Status message indicator of the appropriate socket, but it isn't working
either something up to this point is wrong, or I need to add something else

Thanx for reading all of this, any suggestions will be appreciated

lmd2
Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 1 of 20
(5,705 Views)
Hi,
 
There are a few examples here that may help.
 
 
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 20
(5,701 Views)
Thanks, but not much help I'm afraid.
The 2nd example comes closest but the data flow is in the wrong direction, and from the wrong level of interface.
The example shows reading data from a control on the top level VI into a custom message.
what I need to do is have an ActiveX step generate a UI message, and have it displayed in the existing string indicator (or text box) of the parallel sockets dialog.
I guess the biggest missing piece of the puzzle is how do I get a reference to the status message string indicator of the parallel sockets dialog for the active socket?

lmd2
Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 3 of 20
(5,682 Views)
Here's a great example showing how to use UIMessages in several different environments, including LabVIEW: http://zone.ni.com/devzone/cda/epd/p/id/3879.  This example shows bidirectional communication between the currently executing sequence and the OI.

As far as your particular setup, it sounds like you have everything configured right except for one part.  When you talk about the User Parameter, you mention that are passing a cluster in containing several managers.  What this User Parameter should really be used for in this case is to pass a reference to the control that you are wanting to modify (pass the VI reference to the control that you want to update).  Of course, the best way to pass it in would be to put that one reference inside of a cluster (so that in case you need to pass more references in later, you have a cluster set up- allowing flexibility for adding elements).  Note that with the callback VI already created, you will need to do one thing in order to make this modification work: you will need to either modify the cluster of the current callback VI or simply recreate the VI (right-click>>Create Callback VI), whichever is easiest for you. 

Inside of your callback VI, use this reference (with a property node) to set the value of the String Indicator (or whatever control you have). 

Finally, note that the best way to find out what is happening is to put a simple message box (Dialog & User>>One Button Dialog) inside of the callback VI to make sure that it's being executed.  If the callback is in fact being executed, it's just a matter of correctly updating the UI in your top-level VI.

Hope this helps!
Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 4 of 20
(5,656 Views)
thanks Andy
yes I am close, but I still don't know how to reference the Status Message indicator of the parallel sockets dialog. this would be the reference that I would need to add to the cluster. Looking at the Parrallel mode sequence, I can't even find the runtime dialog, let alone a reference to a particular indicator associated with a particular socket. it is buried deep, not anywhere obvious
I am running three sockets, each socket has a status indicator that either reads "enter the serial number of the next UUT" (if not running) or "Running ..."
But how can I reference the string indicator of the active socket, if I can't even find the code for the dialog itself? I can write an entire test executive in LabVIEW quicker than I can find a single reference to an indicator in TestStand, it shouldn't be this way
Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 5 of 20
(5,646 Views)

Lawrence,

Is this dialog the one you are trying to modify?

If so it is in a .dll called "modelsupport2.dll".  It can be found in <TestStand 3.0\Components\NI\Models\TestStandModels>.  The source code is there too.  You will need to use the parallel UUT functions as this .dll handles the sequential dialogues too.  The are prefixed with PUUT.  Check the parallel model sequence itself to see how it calls the functions.

I hope this helps.

Also, this dialog does not use UImessages... It is run separate...  You may want to abandon it all together and create your own parallel Operator Interface as it look like you have started already.  It is easy to disable this dialog but you will need to replace it with something otherwise you will get stuck in a loop.  There is an example that is shipped that disables this dialoge and pops up individual serial number dialoges.  I can't rememer the name, but is deals with serial numbers in the parallel process examples.

Message Edited by paulmw on 07-09-2007 09:44 AM

Message Edited by paulmw on 07-09-2007 09:49 AM

0 Kudos
Message 6 of 20
(5,608 Views)
yes, this is the dialog
I don't need to modify the dialog at all,
I just need to be able to display custom UI messages in the Status Message indicators as appropriate.
what I really need is how to reference the string indicator for the active socket.
knowing where the code is is a start
if I can figure out how the program presently updates the message to "Running ..." when a socket is started, I should be able to use the same mechanism to update the massage as needed.
Thanks, but I fear I am not there yet
Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 7 of 20
(5,601 Views)

Lawerence,

The source code for the parallel model is "paralleluutdlg.c" in the same directory as the .dll (my previous post).  In breifly analyizing it the controls and indicators seem to be updated by a state machine in the function "RefreshTestSocketCtrls".  There seems to be a limited number of states and I don't see an easy way of adding more without modifing the code and rebuilding the .dll (I think this would require CVI).  You can, however, modify the text of the existing status states by modifing the resource strings in the file MdelStrings.ini located in the \Components\NI\Language\English\ directory of teststand.  (note: I actually think it is prefered to copy to a user\Languages\Englis\ directory and edit that version.  Teststand will use the user versions if it exists.  It is requested to do that because in upgrading, the NI subfolders get overwritted but the user subfolders do not.)

Paul

 

 

0 Kudos
Message 8 of 20
(5,590 Views)
Lawerence,
Check this link out.
 
If you don't have CVI, someone on these forums may be able to perform this (see link) for you (I don't have CVI) and give you the built .dll.
Actually it looks like it is attached to the article.  Give it a try...
 
Paul

Message Edited by paulmw on 07-09-2007 10:51 AM

Message Edited by paulmw on 07-09-2007 10:53 AM

0 Kudos
Message 9 of 20
(5,591 Views)
hi Paul
didn't notice your update right away
ok, so no UI messages with this dialog
I just looked at the example (in TS 4), it is called "OverrideSerialNumForParallelModels.seq"
it provides an alternate method for inputting an UUTs serial#, but doesn't help with a mechanism for providing live status to the user during a long running test.
a message popup wouldn't work, it can't be something that would interfere with the flow, just that instead of always showing running ... I need to display either "energized", or "unenergized" for safety reasons - this status should be realtime, and persistant.
and if I do write my own dialog, I still am not sure of a mechanism for communicating between the TS engine, and my dialog
I do appreciate your input, if you have any other suggestions, I am all ears.

thanx,
lmd2
Lawrence M. David Jr.
Certified LabVIEW Architect
cell: 516.819.9711
http://www.aleconsultants.com
larry@aleconsultants.com
0 Kudos
Message 10 of 20
(5,586 Views)