LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write To Measurement File, Comment

I have tried to use the Comment input on a Write To Measurement File vi and the results are not what I expected.  What I want to do is place one line of text appended after a block of data to form an easily seen break between the data sets.  The data is triggered in a stream prior to being sent to the Write To Measurement File.  I thought that the description on the Comment would do this but I get the comment not only between the blocks but also interspersed within the data stream in a seemingly random manner.  What am I missing in the behavior of the Comment input?
0 Kudos
Message 1 of 8
(6,417 Views)

Dear ITElearner,

 

thank you so much for your post on our webforum. You are able to add a comment each time you write to the lvm file; this comment will be added to the first row you are writing. I created an example; 10 samples are generated, comment is added, this is written to file, another 10 samples are generated new comment is added and written to file.

Is this what you are trying to achieve? Else I would recommend to create a small example of your problem.

 

Best regards,

Martijn S
Applications Engineer
NI Netherlands
Download All
0 Kudos
Message 2 of 8
(6,407 Views)

What you have described is what I would like to happen but what is happening is many more comments that just when the data starts. Attached is a simplified version of what I am doing.

 

Thanks

Download All
0 Kudos
Message 3 of 8
(6,396 Views)

Dear ITLearner,

 

I think the problem lays with the analyze VI's you are using. I do not have your modified compression.VI, and also not the correct signals to measure. But I suppose that the write to measurement file should be called when the trigger and gate express VI has data available; you can put the write to measurement file in a case structure for that and use the data available from trigger and gate express VI to enable write to measurement file. Every time you write the measurement you can increase a counter to point at the next comment element in your comment array. Just use a shift register and increment function to achieve this; not if case is false the counter will not be incremented. Hopefully this is the answer to your problem, since I wasn't able to test it.

 

Best regards,

Martijn S
Applications Engineer
NI Netherlands
0 Kudos
Message 4 of 8
(6,379 Views)

The "Express VI's"are fine if you just need some quick and dirty data, but I have found them too inflexable for any serious use.

 

It's a bit more work but you should look into using the "Write to spreadsheet file" VI or even the lower level "write text to file" VI instead.

 

With these you have much greater control of the format of the output file.

 

You just have to get used to working with arrays...

========================
=== Engineer Ambiguously ===
========================
Message 5 of 8
(6,376 Views)

I have the same problem and I solved so:

 

0 Kudos
Message 6 of 8
(4,621 Views)

Hi spalinowy,

 

what's the purpose of this (Rube-Goldberg) FOR loop around your Comment control?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 8
(4,617 Views)

Sorry, my mystake, but I could swear that when I first tested would work .

 

0 Kudos
Message 8 of 8
(4,600 Views)