NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

what reqrd to use TS_UIMsg_ProgressPercent within Simple UI?

Trying to modify 'Simple UI' example to make use of %complete based on sequence steps. Have implemented the following: oleErrChk (TS_ThreadPostUIMessage (thread, &errorInfo, TS_UIMsg_ProgressPercent, percentComplete, "", VTRUE));
Code compiles/executes but 'hangs' on the above line.
Using TestStand 2.0 and LabWindows/CVI 5.5.
0 Kudos
Message 1 of 4
(4,069 Views)
Hello,

If you want to use the UIMessage Progress Percent, then you should be posting this message from within your sequence file. You then would add a case to the UIMessage handler within the Operator Interface that would handle this message when it is received. For example, take the case in which you have a MainSequence, and are using the simple CVI Operator Interface. Inside of the MainSequence, you could add an Action step that uses the ActiveX Automation Adapter. You would configure the step as follows:

ActiveX Reference: RunState.Thread
Automation Server: TestStand API 2.0 (ver 1.0)
Object Class: Thread
Create Object: UNCHECKED
Call Method or Access Property: Call Method
Method: PostUIMessageEx

You would then add the numeric data that c
ontained the information you require in the operator interface, and assing a custom event code (i.e. 10000 and above) to the UIMessage.

Now that you have posted the UIMessage, you must handle it from within the CVI Operator Interface.
Inside of the simple.c there is a function called HandleTEUIMessage. In here you would a case to the case statement that would handle the event code that you assigned to the UIMessage above.

Hope this helps.
0 Kudos
Message 2 of 4
(4,069 Views)
Hello,

I need to make a few more suggestions. First of all, when you post the UIMessage, the event code would be UIMsg_ProgressPercent and NOT a custom event code. Next, if you want this fucntionality for every sequence file that you create then you should add the PostUIMessageEx call within a process model callback, specifically ProcessModelPostStep. To do this:

1. Open your process model seqeunce file from the menu bar and select Edit>>Sequence File Callbacks...
2. Click on Add and then click on Edit. This will automatically add the callback to the model file and take you into the ProcessModelPostStep view.
3. Add your PostUIMessageEx call here.

If you wish to have the behaviour defined for only your client file, then you will need to
use the SequenceFilePostStep callback. The method for adding this callback to your file is the same as above, except that you will have your client file open instead of the model when you choose the Edit menu item.
Message 3 of 4
(4,069 Views)
Bob,

Thanks!! Having this functionality available to all sequences is my final goal. Your response has been most helpful.
0 Kudos
Message 4 of 4
(4,069 Views)