LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rewite file without dialog invoked, using write character.vi

Hi Is there anyone who knows the answer to my problem?
The problem is that:-
I have a file that is generated by write lvm.vi but some of the headers are wrongly written, even though I have used graph's property to correct plotnames.
So I attempt to read lvm file and correct the headers and rewrite the old file. It works but the problem is that dialog is invoked when false bit is applied to write character.vi 's  append to file? (new file : F). Is there a way to rewite the file without having dialog invoked?

Your help would be appreciated.

Cheers
regards
Clement
0 Kudos
Message 1 of 9
(3,288 Views)
You can edit the function to not display an advisory dialog. Just wire a False constant to the input of the Open/Create/Replace File funciton. Be sure to save the modified VI in a new location and with a new name.
0 Kudos
Message 2 of 9
(3,270 Views)
Hi Dennis
Thanks
But there's one I do not understand about lvm files.

In the attached, there are three files namely daq1, modified_daq1 and res1 files and simple  read lvm file function.

In daq1.lvm, it is saved by default, it reads ok,  Enable the plot legend and see names. In it there are 16 channels and in "comment" cell, it holds AI=16 & RES=0.
I saved this value in comment where another subvi will read it later for correct naming of the plots in the graph. This comment has nothing to do with it. Total of channels is 16

then in res1, it does not read ok. X_Values and others are added to plot names. In it, AI=16 & RES=7. Total of channel is 23

To test it, I modified the daq1 file  and saved as modified_daq1.lvm. In it,  I changed AI=15 & RES=1. total of Channels remained same. Then i changed Dev0/ai15 to Dev0/res0.
Then It reads correctly.

the res1.lvm don't reveal any errors when i studied on it. There's not much any differences except total of channels.

regards,
Clement
Message 3 of 9
(3,254 Views)
hi Forgot to add subvi for previous vi
Here's the attached

 I am using LV 7.1

Clement
Message 4 of 9
(3,245 Views)
Hi Astroboy,
I would refer to the lvm specifications to see which part of your res1 file doesn't meet spec.  http://zone.ni.com/devzone/cda/tut/p/id/4139
"After the last data column, a comment field appears. It contains an arbitrary text string that describes the data in the columns. To avoid conflicts with the separator and new line characters used to parse the file, use escape characters for this field. Refer to the Conventions section of this document for more information about using escape characters for this field."

By just looking at your file, the difference between daq1 and res1 seems to be that there's a tab between each channel column and the X_Values column instead of spaces.  That could cause a problem.

Yi Y.
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 5 of 9
(3,231 Views)
Hi Yi Y.
I find that the tab used between each channel column and the X_Values column is correct. That's because I used simulator signal vi to generate only two signals and output to lvm file. I find that there are tabs used.

regards,
Clement
0 Kudos
Message 6 of 9
(3,192 Views)
Hi Astroboy,
I stripped down your file to the minimum, and it seems like the same bahavior still shows up.  I'm not sure exactly what's wrong here, so I'll have to investigate more and get back to you on it.  Meanwhile, I'll attach the file.  If you have a text editor that shows the actual formatting of the data, you might be able to find a hidden character somewhere in there that's messing things up.

Yi Y.
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 7 of 9
(3,173 Views)
Hi Astroboy,
I downloaded http://notepad-plus.sourceforge.net/uk/site.htm, and looked at the files with all extra characters showing, and I finally figured out what's causing your problem.
In the header portion of Res1.lvm, you had a lot of tabs at the end of each line before the return character, and that's causing problems.  The graph displays normally after I removed those tabs.
Staying late at work really pays off Smiley Very Happy

Yi Y.
Applications Engineer
National Instruments
http://www.ni.com/support

P.S. I like your icon+screenname, it's very nostalgic for me :).
0 Kudos
Message 8 of 9
(3,165 Views)
Hi Yi Y
I am very grateful for your help.
Thanks alot
 
Clement Smiley Very Happy
 
0 Kudos
Message 9 of 9
(3,145 Views)