Showing results for 
Search instead for 
Did you mean: 

Open file in LVOO

Go to solution

Hi all,



I'm moving the first steps into LVOO. and I try to do a "wrap" of FILE I/O VI in LVOO.

To do that :

- I've done a LVOO class

- Into the class I've created 2 methods : open and write. The first one include open\create  the second only the write VI
- in the private class data cluster I put the file reference of the opened file.
- to obtain the right ref , I've drag&drop the indicator from the output of "open VI" fuction to the cluster
- the ref nume is the reference for the write methods
- when I perform the test...error :
     " Possible reason(s): LabVIEW: (Hex 0x1) An input parameter is invalid. For example if the input is a path, the path might contain a

         character not allowed by the OS such as ? or @."

Any suggestion?



In attachment the projetc (LV2018) with the LV class and to perform the test, in any case I'am able to write into the file.


0 Kudos
Message 1 of 14

Save the example in LV 2016 or attach snippets.
Not all of us have LV18.

0 Kudos
Message 2 of 14


I don't have LV2016 in attachment the pics


LVOO open , LVOO write, The cluster and the test

Thanks again


0 Kudos
Message 3 of 14





Did you see file dialog during test? Is filepath coorect?

0 Kudos
Message 4 of 14



the path is correct and I'm able to write something into the file but I've also something strange into the file reference, this something is cause of error but I don't understand the cause.



0 Kudos
Message 5 of 14

I don't have errors with correct filepath.
I think you have mistake in path or your file locked by another program.

Try your test without classes



0 Kudos
Message 6 of 14

You don't have any filepath connected to the Open VI, or is it supposed to be a constant? If so, it should be a constant on the diagram.


G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
0 Kudos
Message 7 of 14

In VI Open method (class version) I've forced the path inside the method and used the option (make as default value and initialize with) so to "embedded" the same file. The open works, the error is during the write operation,



0 Kudos
Message 8 of 14

When I open the Zip file, the Open routine has a file of yours specified (which, of course, I don't have).  I tried changing the file to one of mine, but every time I ran it, it somehow "remembered" your file and gave me an Error 7, File not Found.


I noticed you had Open coded as a Shared Reentrant Clone.  I changed it to non-reeentrant, and it ran without error, leaving me a file with xxxxxx written to it.  You probably should include code to close the file ...


It is not clear why your Open and Write routines are clones ...


Bob Schor

Message 9 of 14



thanks for the support.

The reason to use shared clone if permit the use of the functionality in different point.

Let me explain,better.

I want use the logfile utility in different part of my project on different file for different Subsystem, so the Subsystem 1 produce logfile1, etc. etc.

0 Kudos
Message 10 of 14