LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -2147221164 occurred at Class Not Registered in SpreadsheetExpress.lvlib...

Solved!
Go to solution

Hi,

Please help.

I am trying to run an old VI written in LabView 2015. This VI was written by somebody who is no longer with our company.

When I run it on a PC running LabView 2016 v16.0f5 (32-bit), I get the message shown on "ClassNotRegisteredMessage.jpg" inside attached zip file. The VI I am running is "EPS10_Modified_07212016_EC.vi" also inside zip file. 

An evaluation version of Spreadsheet Express was installed on the PC with VIPM 2018.0.0f2.

Please let me know if anything else is needed to better understand the problem. I would very much appreciate your suggestions on what I need to do to get rid of this error. I couldn't find any similar issue on the web to help me solve it.

Thanks,

Everardo

0 Kudos
Message 1 of 7
(5,553 Views)

The Bad News is your original code was written by someone who doesn't understand LabVIEW (it is loaded with Sequence structures, which are almost never needed and tend to cause "bloat" in the Block Diagram).  It is also unfortunate that the code uses an external routine to interface with Excel, and that the error almost certainly is linked to this library.  

 

Is your code part of a LabVIEW Project?  [I fear probably not, but maybe ...].  If so (or even if not), compress the folder containing the Project and all of its files and attach the resulting .zip file.  As painful as it is to look at the Top Level VI, what we really need to see/understand is the code that is trying to invoke the Spreadsheet, and what we see are many VI "ghost" with "?" in the middle.

 

How committed are you to Excel, meaning the full Microsoft product?  Would a LabVIEW Delimited Spreadsheet File (a text file that conforms to the .csv Standard, so can be read by Excel) work?  Does your LabVIEW installation include the Report Generation Toolkit, which gives you LabVIEW's routines that access Excel?

 

The Good News (save that for last!) is your situation isn't hopeless.  I would look for a good LabVIEW Developer to tidy up your bloated code, getting rid of all the Sequences, wiring the Error Line all the way through the While Loop, anchored to its edges with Tunnels or a Shift Register, and then shrinking it horizontally by a factor of 3 so it fits on a single screen.  More VIs would probably also be warranted.  Eeek, I just noticed that there are Stacked Sequences, which are now "hidden" to actively discourage beginners from using them!  [If you want a simple State Machine, just create it from a For Loop and a Case Statement, using Shift Registers where needed].  If you have the Report Generation Toolkit, use it (if you really need Excel).

 

Bob Schor

0 Kudos
Message 2 of 7
(5,536 Views)

Hi Bob,

Thank you very much for your valuable feedback. Understood. The provided code was the final project written by a 3rd year EE intern that worked with us in 2016. It was his first experience writing LabView code.

I found some folders that might be part of this project. Please review the folders on  the attached zip file.

The new PC with LabView 2016 has Report Generation Toolkit included.

For now, we could live with just .csv file output. Most of the gathered data is all numeric so csv should be fine.

 

0 Kudos
Message 3 of 7
(5,529 Views)

@ecovarru wrote:

Thank you very much for your valuable feedback. Understood. The provided code was the final project written by a 3rd year EE intern that worked with us in 2016. It was his first experience writing LabView code.  And it shows!  If you do nothing more than (a) replace stacked Sequences with some type of State Machine (even the elementary For Loop surrounding a Case Statement with numbered Cases (replacing Frame 0, 1, ... N)(be sure to include a Default case)),  (b) remove "flat" Sequences unless they contain a Delay that has to take place at a particular place in the code, (c) wire the Error line from the beginning to the end, including putting terminals on the Front Panel, and (d) use sub-VIs to encapsulate functionality and "hide the messy details", you'll vastly improve your ability to understand and modify/correct this code.

I found some folders that might be part of this project. Please review the folders on  the attached zip file.  I took a peek, but they are not in a particularly "Bob-friendly" form.

The new PC with LabView 2016 has Report Generation Toolkit included.

For now, we could live with just .csv file output. Most of the gathered data is all numeric so csv should be fine.  If .csv will work for you, then it is what I would recommend (at least to get started).  Read/Write Delimited Spreadsheet works quite well.  Be warned that the LabVIEW default delimiter is a Tab (so I suppose it should be a "tsv" file), but you can easily change it to a comma (read the Help).


I recommend trying to "improve the code" as listed above.  When you do the first steps, you should be able to drastically shrink the size (the goal is that the entire Block Diagram fits on a single Laptop screen -- I'd say that 95% of my code meets this requirement).  Sub-VIs are the way to go (and it really helps if you spend the extra 2 minutes and create an Icon for each, say a box with a 3-word Name).

 

I also suggest that you get (or write a short program to generate) some "typical" data and try writing/reading it using the LabVIEW Delimited Spreadsheet functions, just to see how they work and if they will work well for you.  Pay attention to all of their inputs!

 

Bob Schor

0 Kudos
Message 4 of 7
(5,522 Views)

Hi everyone,

 

I just wanted to chime in real quick to offer a better explanation for what the error means. This error code is tied to a Microsoft error that relates to either a faulty Microsoft Office install or the VI not interfacing with Office properly. The documentation that I've read almost always ties this to an issue with Microsoft Access though. Is it possible that the driver code is interfacing with Access in some way to log data? (This error also occurs when you do not have the correct Office tools installed, but I am assuming that you have checked that already.)

 

@ecovarru, if you only have 20 minutes and you need to bandaid this code just to get it working, it may be worth looking into the error and troubleshooting the driver code. If you are open to spending a few hours with this though, you should replace the spreadsheet output code with Report Generation toolkit functions that work well, are easy to use, and will be better supported by NI now and in the future. If you go this route, you shouldn't have to worry about this particular error at all. Frankly, having seen the code and considering this was written by an intern, I would recommend rearchitecting the code to use the report gen toolkit if you plan to use it for anything important and want it to work well consistently.

 

Best,

 

Duncan Waldrop

Technical Support Engineer

National Instruments

Message 5 of 7
(5,519 Views)

I agree with DuncanW that if you need Excel (i.e. you want a proprietary .xlsx output, rather than a formatted text file) and have the Report Generation Toolkit, the RGT is relatively easy to use (there's an excellent example in the Forum, search for "Revised" in the Forum's search menu and you'll find it) (and if it throws an error because it was written for an older version of Office, yell at the Author and he'll post a revised version here ...).

 

Bob Schor

Message 6 of 7
(5,515 Views)
Solution
Accepted by topic author ecovarru

Dear Bob, Duncan,

 

My sincere apologies for not getting back to you earlier!!

Providing test results using this LabView Automation was an important part of a power supply product approval deadline. Since I wasn't familiar with the specific details on what the vi was trying to do, I was asked to run the test procedure manually to capture the needed test results, providing the opportunity to get acquainted with the technical details on how to run it and what was being captured and at the same time evaluate the suggested measurement methodology plus getting familiar with all involved test equipment. That is what I did since last Friday and completed my task late yesterday. So now I am off the hook and can get back to the the vi problem or eventually redoing it from scratch and doing it cleanly.

The laptop where the vi was ran, has Microsoft Excel installed but doesn't have Microsoft Access on it. The VI calls VIs from a package called Spreadsheet Express from Aledyne Engineering, which had a temporary license that had expired. Today I installed a temporary license extension and now the Power supply automation vi runs without flagging the error. So that might have been the cause of the issue.

 

Thank you both for your very valuable suggestions. I will keep them in mind.

I will start playing with the Report Generation Toolkit to develop some experimental VIs to assess how well it works creating Excel reports. Then will do the needed changes so we have a VI that works with Report Generation Toolkit VIs instead of Spreadsheet Express. Once that is done then I'll work on rearchitecting the code to make it simpler and easier to maintain.

 

Thank you both very much for your very valuable input. 

 

Best regards,

Everardo

 

0 Kudos
Message 7 of 7
(5,488 Views)