07-14-2010 12:02 AM
I have built an executable that reads a com port and displays the readings in a chart.
The vi also has a "start logging" button that uses the "open file", "write to file", and "close file" vi's, and it works on the machine with labview installed on it.
When saving it as an executable and executing it on a clean PC, I can select the com port, I can see the graph working, and when I start logging, I can select a new filename.
However after closing the file, and opening it in a text editor, there is nothing in the file. So I think there is a problem with the "write to file" vi.
I tried this both in LV 8.5 as well as 7.1 with the same results. Any ideas? I have Visa and Run-time running on the clean PC. Are there any other drivers that I need to run on the host PC?
07-14-2010 12:15 AM
Without seeing your VI, we can only guess at what may be wrong. Are you using relative file paths? If so, look at Why Does My Executable Not Work When Using the Current VI's Path Constant?
07-14-2010 12:48 AM
Attached is the VI. It does not link to anything as far as I can see.
When running it, there are no errors, it just doesn't write anything to the file.
07-14-2010 02:00 AM - edited 07-14-2010 02:00 AM
Hi!
Please note that Labview no longer supports Open_Create_Replace File.
Try using Open File instead.
Moreover: do you get any error from file operations? (Indicator Error out 2)
Why do you set prepend array or string size? to false?
Marco
07-14-2010 08:07 PM
Ah... I didnt know that "open_create_replace_file" was no longer supported.
When I save the file in 7.1 and open it in 8.5 it changes a few things without telling me, and I didnt notice the changes.... it changed the write_to_file function into a write_to_binary function. So the information is there, but I am opening it as a text file in notepad, so I can't see anything. Also, no errors pop up, so that led me to believe it was a runtime or visa fault. Or some sort of file handling fault.
I'll change the functions around in 8.5 and see if it works!
07-14-2010 08:39 PM
What are you actually trying to log? The only file functions I see write the string control out to a log file. By default it is empty. And the string control on the front panel is off the bottom. So it looks like you are just writing a carriagereturn/linefeed character every second, which wouldn't really show up in notepad all that well.
07-14-2010 08:49 PM
There is a data_to_be_logged local variable that is getting logged. It's a string that is generated by the left hand while-loop.
In practice the string is four temperature sensor measurents and date time stamp.
Cheers for the help.
07-14-2010 09:14 PM
Where? In the VI you posted in reply #3?
I don't see any local variables anywhere in your VI and I don't see anything by the name "data_to_be_logged".
Are you sure you posted the correct VI?
07-14-2010 10:05 PM
Oh, sorry. Updated it now. Must have been working on that when I saved and uploaded.
07-14-2010 10:36 PM
You have a lot of problems with your VI:
That's it for now....