LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

TSOP help and print help

Hello,
        I have two questions,
                                    1) I am using latest TSOP came with LW81 with active X control functions.  I want to get UIMessages as execution goes on to display Low, high limit,  measured value, execution percentage completed etc with available functions. Could you please tell how to achieve this?
                                     2)Could anyone help on how to print HTML report using CVI code? I am using my customized TSOP report generation. I referred ie example given with samples. But it doesn't  help....
Detailed explanation is highly appreciated?
Thanks in advance
Vijay


Message Edited by 12345qwertt on 12-02-2007 05:51 PM
0 Kudos
Message 1 of 11
(4,386 Views)

Hey Vijay,

   To your first questions about using the UImessage API, I found an example program for CVI that illustrates how to use the UImessage callback.  You can find “How to Work with UIMessages in TestStand 3.0” at http://zone.ni.com/devzone/cda/epd/p/id/3879.   Please download the example for CVI and refer to line 168 in TestExec.c.  Remember that UImessage event codes from 1 to 9999 are reserved for TestStand, but 10000 and beyond are user definable (UIMsg_UserMessageBase = 10000).  Please see “Using Default and Custom UIMessages” at http://zone.ni.com/devzone/cda/tut/p/id/4532 to view a refresher on how to make a TestStand Step to send that will send a user UImessage event.

   As for your second issue about printing the HTML report, I have a follow-up question.  Are you trying to print the report generated by TestStand to a local printer from CVI after the report has been generated, or are you trying to display the report in a window after execution has finished?  Just let me know which print operation you are trying to perform.   I look forward to your response.

Best Regards,
Software Engineer
Jett R
0 Kudos
Message 2 of 11
(4,376 Views)

Hello JettR,

                 Thank you very much for so detailed answerSmiley Happy.I would be generating report based on UI message using CVI code and it is not related with TestStand report file generation. After each single tests, I would display result in corresponding text box instead of displaying the whole result only at the end of execution in TestStand. The print would be done when I give "PRINT" button press and it would print corresponding HTML file.

I am eagerly waiting for your answer.

Best Regards,

                   Anurag

0 Kudos
Message 3 of 11
(4,369 Views)

Hey Anurag,

   The communication between CVI and TestStand that you desire for this report can be accomplished with the UIMessage API that we previously discussed.  You can pass a number, a string, and/or a TestStand object reference from TestStand to CVI through this call back.  Once the data is in CVI, you can process it for your own HTML file.  To make an HTML file from CVI, all you need to do is create a normal ASCII text file using normal File I/O operations and write in the appropriate HTML tags such as <HTML> </HTML>.  Once you write all of your data in the ASCII file (and save it as *.html), you should be able to view your file in any internet browser.   I hope this helps.

Best Regards,
Software Engineer
Jett R
0 Kudos
Message 4 of 11
(4,361 Views)

Hello JettR,

                I tried with the example that you give for UI Message posting...But it seems after each step executed, we need to post UI Message programmatically. But in older version of TestStand, it was done automatically after each step is executed.  I implemented the code that I received from NI link that you gave. I need the info step type, step name, limits, result etc instead of posting message from TestStand. But my CVI program is only receiving the UI Message that I am programatically posting. Could you help me on that?

            My concern on HTML printing is not related with HTML file creation, but how can I print HTML file from CVI code without using system commands?

Thanks in advance...

Vijay

0 Kudos
Message 5 of 11
(4,334 Views)

Hello JettR,

                I tried with the example that you give for UI Message posting...But it seems after each step executed, we need to post UI Message programmatically. But in older version of TestStand, it was done automatically after each step is executed.  I implemented the code that I received from NI link that you gave. I need the info step type, step name, limits, result etc instead of posting message from TestStand. But my CVI program is only receiving the UI Message that I am programatically posting. Could you help me on that?

            My concern on HTML printing is not related with HTML file creation, but how can I print HTML file from CVI code without using system commands?

Thanks in advance...

Vijay

0 Kudos
Message 6 of 11
(4,334 Views)

Hey Vijay,

This situation has a couple of potential solutions: you can create a custom step type that will automatically send the UI Messages for you or you can place a statement step that sends UI Messages after each test step.

The first option of creating a custom step type would require you to create a custom step type that would be used in place of your normal pass/fail tests etc. Creating this custom step is not that difficult; it just involves copying the NI Step that you are already using (i.e. pass/fail step) and giving them a post expressions.  Chapter 13 of the TestStand reference manual (Start » Programs » National Instruments » TestStand » Online Help » Manuals » TestStand Reference Manual) goes over what a custom step type is. See screen shot (Option1.jpg) to see how we would replace all of your test steps with your custom steps (once they have been created).

The second option of placing a Statement Step after each step would require you to add more code in the sequence file. You would need to add a statement step after every test step and pass data from RunState.PreviousStep. Please see the attached screen shot (Option2.jpg) for an example of how and where to place these statement steps.

In a sense, option 2 is just breaking out the post-express statement into an external statement step, which is included in the custom step type for option 1.   I hope this answers your questions.

Best Regards,
Software Engineer
Jett R
Download All
0 Kudos
Message 7 of 11
(4,304 Views)

Hi JettR,

             Thanks for your help.....I could reach my targetSmiley Happy.But still I am facing problem with printing HTML file from CVI code. I am not prefering system commands. Could you please suggest an alternative?

Thanks in adavance,

Best Wishes,

Vijay

0 Kudos
Message 8 of 11
(4,282 Views)

Hey Vijay,

To print an .html you will need a program that can understand html.  CVI is not one of these programs, but it can call into Internet Explorer to print an html file via ActiveX call.  The “Microsoft Internet Toolkit” is the ActiveX server which has a class called "IWebBrowser2" You can find the API reference for this class on MSDN at http://msdn2.microsoft.com/en-us/library/aa752127.aspx.  The two methods you want to call are “Navigate” and “ExecWB” (with the IDM_PRINT command).  I hope this helps.



Message Edited by JettR on 12-06-2007 02:37 PM
Best Regards,
Software Engineer
Jett R
0 Kudos
Message 9 of 11
(4,271 Views)

Hi JettR,

              I didn't try this.....But I hope definitely this would help me....Thanks a lotSmiley Happy

Best Regards,

 Vijay

0 Kudos
Message 10 of 11
(4,245 Views)