NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get the Excel reference number in Teststand from the Office Toolkit?

Solved!
Go to solution
We are in the process of upgrading from LabVIEW 8 and TestStand 3.5 to LabVIEW 2009 and TestStand 4.2.  We use the Microsoft Office Toolkit quite a bit in our work to manipulate Excel, and are having problems with it.  For example, if I try to use the New Report.vi to open a new Excel file, it will open the file successfully, but the "report out" that we'd normally get the reference number for the workbook from is greyed out with a type of Unknown.  Sample vi and screen shot are attached.  Any ideas what we have set up wrong?

Thanks....
Download All
0 Kudos
Message 1 of 6
(3,527 Views)
Solution
Accepted by parkerfly

parkerfly,

 

Between LabVIEW 8.0 and LabVIEW 2009 (I believe the change was with the release of LabVIEW 8.5), the report generation toolkit was updated to use LabVIEW Classes.  This means that the report out output parameter outputs a LabVIEW class, which can be used by other report generation VIs to update the report.  Unfortunately, LabVIEW classes are not currently supported in TestStand.  The only workaround is to create wrapper VIs that take the output and flatten it to a string so it can be stored in TestStand.  Then, for any VI that would use this, you would need a wrapper VI to take the string input and convert it to a LabVIEW class (nireport.lvclass) so it can be used in the other report generation VIs.  More information about this can be found at this forum post: http://forums.ni.com/ni/board/message?board.id=330&message.id=14786&requireLogin=False .  The forum post is from a few years ago, but the information is still valid.

Eric B.
National Instruments
Message 2 of 6
(3,498 Views)

Eric, thanks - that did it!  I'll have to re-write all of our custom steps to use wrapper vi's, but I can get it to work thanks to your help!

 

Do you know if NI has any plans to correct this in a future release of TestStand?

Thanks!!!

-Bill

0 Kudos
Message 3 of 6
(3,484 Views)

Bill,

 

Glad to hear you could get that to work!

 

Also, this is a known issue and our developers are looking to fix it in a future version of TestStand.  I'm not sure how far off it is, but we're definitely aware of it.

Eric B.
National Instruments
0 Kudos
Message 4 of 6
(3,476 Views)

Eric, I've got another question on this - I can get the class converted to a string, but it's 93 characters long.  All of our test code is expecitng to use an integer for the reference number, but I'm not sure how to get that into an integer format - it seems like that is too big.  Any suggestions?  When I flatten it to a binary string, I can read that into TestStand and use it to control Excel, but we have way too much existing code to have to go in and put new Excel custom steps into teststand.  We need some way to get that into an integer format that our existing custom steps can use.....


Thanks,

-Bill

0 Kudos
Message 5 of 6
(3,447 Views)

Bill,

 

 Since that 93 character long string can't be converted to an integer (an integer has a max size of 2147483647, so 012345678901234567890, for example, would just be converted to 2147483647), there's not much else you can do.  Since the Report Generation Toolkit changed its references from numbers to LabVIEW classes, you'd have to change your step types to accept strings instead of numbers.  Even if TestStand could accept LabVIEW classes, you'd still have to change your code to accept LabVIEW classes rather than numbers, so unfortunately it is going to take some modification of your TestSystem if you want to stay with using LabVIEW 2009.

 

If you update your code module and update your step type, whenever you open a new sequence file and you have the updated types INI file loaded on that computer, TestStand will load that new type instead of the older type (it may prompt you first), so then you would need to change your local variables to be strings instead of numbers to complete the proess.

 

I'm sorry for the trouble this has caused.  Changing the references to LabVIEW classes allowed for some added features in the toolkit, but it did remove backwards compatibility in this case where you are using it with TestStand, so I'm sorry for the added difficulty in upgrading your system.

Eric B.
National Instruments
0 Kudos
Message 6 of 6
(3,407 Views)