LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems reading Comment from LVM

Hi,

I'd like to write some signals to a file, where I mark each phase in the execution with a tag (the user can select what tag to apply during the execution) . I am trying to use the feature of LabView's Write To Measurement File express VI that adds a comment to the current chunk of data (most of the code in the below snapshot is not really important, but I highlighted the part where I add the comment):

 

 

Capture2.PNG

 

Later I would like to read from the file and to retrieve the comment, so I am using again an express VI - this time Read from Measurement File:

 

Capture3.PNG

 

 

(when the phase as exctracted from the "Comment" column changes, I want to do something).

 

The problem is that the extracted comment is almost always an empty string, since this is the way Write To Measurement File does it - it writes it only once per chunk of data, as can be seen with the "happy" comment in the below example:

 

Untitled.png

 

 

 

 

So, unless I magically happen to read my data in exactly the same chunks as it was written, I most of the time get an empty Comment, which makes this feature pretty useless to me.

 

Anybody has any idea how to achive something like that?

 

Thanks in advance!

0 Kudos
Message 1 of 7
(2,913 Views)

Right off hand I am thinking that the problem is with one of the express VIs. When creating them, there are certain assumptions made to simplify things. Perhaps this is one of those simplfications that is causing you trouble.

 

By right clicking on the express VI and selecting the option to open its front panel you can convert it to a normal VI which you can then troubleshoot.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 7
(2,900 Views)

@mikeporter wrote:
...

By right clicking on the express VI and selecting the option to open its front panel you can convert it to a normal VI which you can then troubleshoot.

 

Mike...


Thanks a lot, Mike! I will try to follow your suggestion. But...

Wow, openning those expres VIs as diagrams is enough to blow my mind. Here is just a small sample:

 

Capture.PNG

 

I hope I am able to understand what's going on in this mess, and it is definitely no time to start complaining about LabView...

Wish me luck 🙂

 

 

0 Kudos
Message 3 of 7
(2,897 Views)

@SenSLabs wrote:

@mikeporter wrote:
...

By right clicking on the express VI and selecting the option to open its front panel you can convert it to a normal VI which you can then troubleshoot.

 

Mike...



OK, a couple of hrs later, after modifying several subVIs  was finally able to write the comment on each line - BUT! Now it writes the signals with some strange frequency like this:

 

Capture.PNG

 

So, two samples at 1KHz (1ms apart), then almost half a second later another two samples 1ms apart etc - so, obviously, converting to a regular subVI now screws my writing frequency - which before was automatically determined from the signals.  I don't see an immediate fix...

This is absurdly hard and annoying, not to mention those subVIs behind the express VIs are not really documented, in addition to being a hellish incomprehensible jumble of wires...

 

Sorry to vent my frustration...

 

 

 

0 Kudos
Message 4 of 7
(2,887 Views)

Is there a reason you were wanting to use the LVM? There are alternatives like tdms, or csv or even a simple database.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 7
(2,883 Views)

@mikeporter wrote:

Is there a reason you were wanting to use the LVM? There are alternatives like tdms, or csv or even a simple database.

 

Mike...


I guess I was seduced by the ease of using the express VIs to write and read the data, where my signals have all their names already written for me and then just as easily extracted.

In retrospect, I guess it would have been indeed easier to scrap the current code and move to regular write to/read from CSV.  I just hoped that I'd be able to modify the existing code as you suggested without drawing too much blood. It looked this way for a second until I saw that my writing frequency was screwed up 🙂

0 Kudos
Message 6 of 7
(2,878 Views)

You should really look into the TDMS VIs. You can save you data with channel names or any other metadata you choose to include. Plus because its binary the files are smaller and you maintain full numeric resolution and there is an add in that let's you read TDMS files from Excel.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 7
(2,875 Views)