08-29-2013 06:07 PM
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):
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:
(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:
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!
08-29-2013 07:02 PM
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...
08-29-2013 07:18 PM
@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:
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 🙂
08-29-2013 08:40 PM
@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:
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...
08-29-2013 08:57 PM
Is there a reason you were wanting to use the LVM? There are alternatives like tdms, or csv or even a simple database.
Mike...
08-29-2013 09:04 PM
@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 🙂
08-29-2013 09:13 PM
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...