From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error code 1, identifying the invalid parameter, output to a text file

Solved!
Go to solution

I am using labview to record information from a load cell.  I have building a file path set up, data coming in and outputting in the wave chart and as a string, when trying to write it out as a text file nothing is being written.

 

Error out is giving me code 1.  The source is “Open/Create/Replace File in…”

There is an invalid input but as far as I can tell it is everything looks fine. 

How do I identify the invalid input parameter?

What is causing this error?

0 Kudos
Message 1 of 7
(5,628 Views)

 Nice tag Ben.

 

As he will no doubt point out soon the "Create" constant should be "Open or Create"

 

Also, check that constant into Number to Fractional string-  You probably want more than 1 digit of precision.


"Should be" isn't "Is" -Jay
Message 2 of 7
(5,597 Views)

@JÞB wrote:

As he will no doubt point out soon the "Create" constant should be "Open or Create"


Could also be "Create or Replace".  Regardless, if you try to overwrite a file that already exists, you get error code 10.  Trying to create a file to a folder you do not have access to gives you error code 8.  Trying to create a file in a folder that does not exists gives you error code 7.  Typically error code 1 is due to an expired reference.  I am running out of ideas.

 

Could you post your actual VI so that we can attempt to debug it?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 7
(5,584 Views)

Thank you for the input. 

I've tried the "Open or Create" and "Open or Replace".  But it still yields the same result.

 

Open/create/replace file in

sub vi's program name.vi -> main vi's name.vi <APPEND>

C:\filename.txt

 

It does not seem to see the filename input from the main vi as a vaild input and I can't figur out why.

0 Kudos
Message 4 of 7
(5,563 Views)

Thank you.

If you would like to see the VIs they are attached.

 

Open/create/replace file in

sub vi's program name.vi -> main vi's name.vi <APPEND>

C:\filename.txt

 

It does not seem to see the filename input from the main vi as a vaild input and I can't figur out why.

0 Kudos
Message 5 of 7
(5,560 Views)

Browse Options on your user controls.  These need to be set to browse for folders rather than files.  Set them with the property editor.

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 7
(5,535 Views)
Solution
Accepted by topic author JonThorn

It was something else.  At the end of the filepath in the file path building vi I had a carriage return line feed at the end of the path.  Ben Noticed it.  I got rid of that and am now writing .txt files with no problem.

Message 7 of 7
(5,529 Views)