NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Save a report file to the varchar(max) column in database table

Hi Daniel,

 

I read through the article you recommended. Before I try out the procedure, I have these questions:

 

1. What happened to those images or screen-shots in "Logging a New UUT Property to a Database in TestStand"? They show up as image icons, not the actual image themselves in all the browsers that I have (IE, Chrome, Firefox).

 

2. What is the step "as soon as the report is generated" as mentioned in your reply? I may be able to find out by google or NI Discussion Forum search, but that will take quite a while and may not be the right answer.

 

3. What happens to Locals.Report after TestStand 2010? I am using TestStand 4.2. Is Locals.Report renamed or deleted in TestStand 2012 or 2013? Can we still get Report string in process model? This really bothers me, knowing that what I am doing now may not work in the future anymore, or need more hard work. Things are not becoming better, but worse in TestStand?

 

4. How to configure the column type to save Report to database in Configure --> Database Options? I plan to use varchar(max) as column data type in SQL Server. What should I use in TestStand schema? String (BSTR) or String (VarChar)? If String (VarChar), there is no option for Max, the biggest number is 8388608.

 

Thanks,

Leo

 

 

0 Kudos
Message 11 of 15
(1,479 Views)

Hey Leo,

 

1. I'm not sure why you wouldn't be able to see the images. If you try this link, do the images appear? http://digital.ni.com/public.nsf/websearch/F5ADBC61222343B586256CE00055E6D6?OpenDocument

 

2. The step I was referring to is the "Write UUT Report" step. You'll see two steps with that name right before the Log to Database Callback. I put my statement step "Locals.ReportTemp = Locals.Report" right after the second Write UUT Report. The reason I store the report in a temp variable is because one of the other steps clears out the Locals.Report variable and I wanted to make sure that data was saved.

 

3. In the TestStand 2012 process model, we moved to a plugin architecture for result processing. This is very beneficial in making the code more modular and allowing changes to the process model that don't affect the report and database methods. In the legacy models, reporting and database logging are tightly integrated into the process model, which means that any change in the model could affect these functions. The plugin architecture allows us to easily separate these functions, and also lets us do things like generate two separate reports or create a custom report type and integrate it easily.

 

The specific use case here of storing the report to the database is rather uncommon, and unfortunately is one thing that is a bit easier to do in the legacy models. I'd like to point out that you can continue to use the legacy models, and backwards compatibility is a high-priority feature of TestStand (you can load TestStand 1.0 process models into TestStand 2013). However, if you did want to migrate to the newer model architecture at some point, you would need to do some additional work to accomplish this task.

 

4. You can set the Size to 0 to tell TestStand that there is no size limitation on the field. This is mentioned on the Help page for the Database Options screen here: http://zone.ni.com/reference/en-XX/help/370052M-01/tsref/infotopics/db_database_opt_col_param_tab/

 

Hope that helps!

Message 12 of 15
(1,462 Views)

Hi Daniel,

 

1. The images in the new link ( http://digital.ni.com/public.nsf/websearch/F5ADBC61222343B586256CE00055E6D6?OpenDocument ) still don't show up. But there is no problem in another NI link ( http://www.ni.com/white-paper/6484/en ). This is not a big issue for me, but a feedback for improving that web page.

 

2. Now I see where you get the populated Locals.Report variable. Thanks.

 

3. I agree it's a better design concept to be more modular. And the backwards compatibility could solve the problem when upgrading the system. Just want to clarify one thing: Does "Locals.Report" no longer exist in TestStand 2012 and up?

 

4. Good tip about size 0. I didn't realize it can be used for String (VarChar) besides for Integer.

 

Your reply helps!

Thanks,

Leo

 

 

 

0 Kudos
Message 13 of 15
(1,458 Views)

Glad that was helpful!

 

To clarify your last question, Locals.Report does not exist in the new process models. The report information is completely contained in the Report model plugin file, and does not appear as a variable in the main process model.

Message 14 of 15
(1,454 Views)

Thanks Daniel,

All are clear. I will try it out the latest the approach.

Leo

0 Kudos
Message 15 of 15
(1,452 Views)