LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Logging data as VIs: "The VI is the Data"

I am a longtime user of LabVIEW, and honestly have never been satisfied with the available methods for logging data.  Logging the front panel is one of the earliest methods implemented by NI.  It's nice because it's convenient.  you just check something in the menu and your data gets saved as a log file.  The disadvantages?  Oh, there are many.  First, the data is easily corrupted.  Second, if you change the front panel and didn't save a copy of your VI, say goodbye to your data.  The structure of the data is very difficult to ressurect.

I have nothing against all of the other methods for storing data that have been implemented by NI.  Ok maybe I do.  Mainly, they require many steps to implement--you can't just start logging data with a click of a button.  Most of the implementations don't allow you to use clusters, graphs, and other complex data representations.  They are old-style databases that have been grafted onto LabVIEW.

Here is what I would like to implement: a method where you can automatically log the front panel of any VI after it has run (like a log file) except that you save a copy of the VI (minus the diagram) and make the logged data the default value.  WIth this method, you are always guaranteed that you will be able to retrieve your data, just by opening labview.  And you can programmatically call up any such VI and extract the data or whatever part you like.  It has a built-in viewer--the VI itself.  And the structure is preserved for the future.

I have tried to implement such a scheme, with limited success.  Rather than bore people with my methods, I am wondering if anyone has some fresh suggestions about how to implement such a scheme.  To be maximally effective it should be simple, requiring the least amount of coding.  Ideally, no coding would be required except perhaps a VI that runs in the background perhaps.

Please respond if you have any ideas or suggestions.
0 Kudos
Message 1 of 11
(3,668 Views)
Hi jeremy_levy,
can you explain please, what for you this function need? What do you want to do? What about the function "make current values default"? It sounds like this could be enough for you.
Mike
0 Kudos
Message 2 of 11
(3,662 Views)
I want to be able to autolog data, not in a "log file" which is built-in to LabVIEW, but rather to have the result of a VI run to be saved as an instance of the VI itself (without the diagram).  I would like to do this automatically in the same way that you can do it now for any VI in labview.
0 Kudos
Message 3 of 11
(3,660 Views)
Hi jeremy_levy,
only for my understanding! You want a copy of your front panel with every changed control/indicator value? Or do you want it periodically after a fixed time? Which advantage do you have from this function? What do you want to do with the copy of the front panel?
Mike
0 Kudos
Message 4 of 11
(3,657 Views)
OpenG Variant configuration files fits these option
Or MGI Read/Write Anything that page has the following table comparing different methods:


Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 5 of 11
(3,645 Views)
I can't say I'm a fan of this concept, and in the kinds of system I produce it would make zero sense.  I understand its appeal if you don't want to start writing code, however, and implementing it should be rather simple:
 
 
This example doesn't do any of the important stuff (error handling, selecting from the list of open VIs, etc.), but it shows the basic concept. If you want, you can also add code which will let you call this from the File menu or from the Tools menu for a specific VI. You can see an example for how to do this if you download the Code Capture Tool.


Message Edited by tst on 07-29-2008 11:40 AM

___________________
Try to take over the world!
Download All
Message 6 of 11
(3,630 Views)

Hi Dr. Levy!

I agree about the VI Logger being subject to corruption if the FP changes.

I think Yair's illustrated code may help. I am not sure if graphs and charts will allow saving the display as the default. I believe this did not work in earlier version of LV so check it before going to far. I am locked-up inside a secure facility most of this week so I will not be able to follow-up very soon but, I'll check back on this thread to see if I can help if Yair's method is not what you need.

BTW: Congratulations on reeiving the Chancelor's distinguished Teacher Award!

Your former student,

Ben

PS: It was Dr. Levy that first FORCED me to use LabVIEW. If you have any ideas please help him out as a favor to me.

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 11
(3,612 Views)

Please look at this thread also by ben for more discussions that are yet to happen.

Thanks,

Mathan



Message Edited by mathan on 07-29-2008 06:27 AM
0 Kudos
Message 8 of 11
(3,597 Views)
Sorry, no such ideas. however it has always irritated me when de-bugging that I did not have a sub-vi open and therefore cannot run that part of the code in isolation.  This suggestions seems like  a way forward to implementing such a feature.

All the best
Craig
LabVIEW 2012
0 Kudos
Message 9 of 11
(3,526 Views)
I appreciate all of the responses.  I tried implementing something along the lines that tst suggested (see attachment).  However, there are several issues.  One is that there is an unavoidable delay in when the file is written.  You cannot run the VI in question in an endless loop.  Second, it does not seem to work when the VI to be logged is a sub-VI.  It only works for top-level VIs.  Well, it works, but only saves the last call.

Does anyone know if something like this scenario is possible:

When called, the VI grabs the cluster of data on the front panel (including all of the panel graphs, etc), creates a new VI from scratch, and saves it to the desired location?  If that were possible then you could avoid all of the problems above.  just a pointer to the relevant

One last thing: it was interesting to read some of the responses to my question.  Why would anyone ever want such a capability?  When I was a graduate student using LabVIEW 1.0, it really was for the lab.  I used it to automate my experiments.  Every day I was writing a new VI to perform a different kind of experiment.  Now there is sort of a dichotomy between the programmers who write code to automate processes in an industrial setting (for example) and the people who use those programs.  When you are constantly in a state of development, it definitely slows you down to have to insert a bunch of extra code just to save your data.  And platforms like TDMS lack the full versatility allowed within LabVIEW for saving clusters and other complex data structures.

Again, I appreciate all the help I can get with this coding challenge.  (And thanks Ben for encouraging your fellow enthusiasts and veterans to help me)


0 Kudos
Message 10 of 11
(3,496 Views)