11-04-2009 09:27 AM
Hi Smercurio,
I followed many LV training courses, also expensive courses held by NI. Unfortunately, sometimes I remember that a function is implemented, but I forgot how to make it work.
So I search the NI forum for an already existing solution.
When I found it, I try to use it, and if I get an error I'm not supposed to, I ask for advice.
I apologize if I violated the forum methodology
11-04-2009 09:42 AM
You do not need to apologize. I meant no disrespect from my comment. It's often we get people with no LabVIEW experience asking very basic questions which can be answered by either going through the tutorials or simply opening the Help file. YIn other words, while A may imply B, B does not always imply A, and in this case I assumed it did. I'm sorry about that.
As for your issue: I do not get an error when the paths are the same. Even if the paths are not the same, then the write should work, and it does. I do notice, however, that the error messages you posted have a name of the VI that's different than the VI posted in this thread. Are you actually using the same VI, or a modified version of it?
11-04-2009 09:47 AM
again...
Could you please take a look at your path.
In my exmaple it's
"C:\Daten" or "C:\hallo"
Then open your Windows Explorer and look at "C:\" is there file / folder names "Daten" or "hallo"??
If so, please delete this file/folder!!!
Or your go into your blockdiagramm and change "open or create" -> "replace or create"
Does this help???
11-04-2009 10:13 AM - edited 11-04-2009 10:18 AM
According to one of my previous posts, I created a very simple VI with only two controls on the front panel, and named it "fake.vi". Of course, I selected it from the path dialog on the front panel.
I Tried both Dippi's solutions, but none is working.
Few more details: now the name of the file is "daten" both for read & write.
If I try to read, I get no errors, but nothing happens as well (no surprise, since writing doesn't work)
If I try to write, the errors are generated by the "close file" and "close reference" VIs (the ones executed at the end of the loop).
Anyway, thanks for your suggestions
11-04-2009 11:37 AM
Do you have write privileges to the C:\ folder?
I still think you are using a different VI. Your error dialogs clearly indicate a different VI name, and also reference a different file. In fact, error1.jpg is showing that it's accessing c:\hallo.ini. That filename isn't anywhere in the VI that was posted on this thread.
Please post the VI that you are actually using.
11-04-2009 11:54 AM - edited 11-04-2009 11:55 AM
Here they are.
I am administrator of my PC, with full R/W access.
One more detail: when I launch the VI in "lese" mode, some chars are written in the "daten.txt" file. In "setze" mode, the file is completely emptied. I added the .txt extension in order to quickly open it via notepad.
Thanks for your time, really appreciated
11-04-2009 12:36 PM
11-04-2009 12:39 PM
When you want to read from the file, you need to open it...not "replace or create" it. Try changing your file operation to "open" in your "read" case.
You can "replace or create" when you want to write to the file.
11-05-2009 02:15 AM
11-05-2009 09:00 AM
It should also be pointed out that the name of the VI is misleading. The file that's saved is not an .ini file - it's a binary file. Completely different. If you are intending to use .ini files then you need to use the configuration VI.
I would suggest you look at the OpenG VIs. There's a set of VIs that read/write config files, including one that reads/writes the front panel to a .ini file.