LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

invalid tdms file reference

I have a program that logs data with a tdms file.

On my pc it works fine. When I build an exe and instal it on an other pc, I get the error:

"invalid tdms file reference"

 

Is this a problem with my vi or with the pc? 

0 Kudos
Message 1 of 14
(6,602 Views)

If you got an "invalid tdms file reference" error, that may be caused by WRONG tdms file path.

 

In your program, there may several risks.

1. You'd better to validate the path before passing it to Open TMDS.

2. When you use File Dialog, you'd better to check the error out. If you get an error "43", that means user CANCELed the dialog. This will also return an invalid file path.

Message 2 of 14
(6,595 Views)

LiaLiu, thanx for your response.

 

You say the wrong file path?

When I start my program I can chose a path... so how can it be wrong?

How do I validate the path before passing? 

0 Kudos
Message 3 of 14
(6,588 Views)
Hi Peira, Because you do not pass the error out of Open TDMS to Write TDMS, so Write TDMS continue to run when the file path is an invalid path. I got the error after I canceled the file dialog. You can use Not a Path and Empty Path? from comparison palette to validate your file path. In my opinion, you can add several error out to monitor where the error happened for your current program.
0 Kudos
Message 4 of 14
(6,582 Views)

There are several issues regarding the tdms file path in your vi.

When you start the vi with "Datalog OFF/ON" set to false you will pass an empty file path to the TDMS Open.vi, which could cause this error.

When "Show measurements" is set to false you again pass an empty file path to the TDMS Open.vi.

 

The error your are facing couuld be prevented by either checking if the path is valid as LiaLiu suggested, or in redesigning your file IO code.

 

 

Christian

Message 5 of 14
(6,578 Views)

Thx for the response. 

But when these issues are the problem, isn't it strange that it works on one pc and not on another?

How do I change the empty file paths into a correct sollution? 

0 Kudos
Message 6 of 14
(6,571 Views)

I'm wondering about that this works at your development machine.

You should think about attending a LabVIEW Style Guidline and LabVIEW Performance class.

 

But to fix you issues regarding the tdms file path you have to change a few things:

1. There is only a valid path when "Datalog OFF/ON" is set to true before you start the vi. You should change this by creating a new event case for the "Datalog OFF/ON" where the user then is able to start datalogging when the vi is allready running.

2. When "Show Measurements" is set to False you write an emtpy path constant into the shift register. Why? Either you wire the path from the left tunnel to the right or you think about if it is even necessary to wire the path through the case structure at all.

 

 

However, I would still recommend you to completely redesign your vi!

 

 

Christian

0 Kudos
Message 7 of 14
(6,562 Views)

Hi Peira,

 

I do not think that the built exe or changed PC could cause this error.

 

Could you please add several error out at different error output to check where the error happen?

0 Kudos
Message 8 of 14
(6,556 Views)

Yes I know,

 

I just started with labview.

 

Can you please explain me the second part.

Do I need to remove the case structure and put it into an event case?

Where do I connect the event time out?

 

Kind regards 

0 Kudos
Message 9 of 14
(6,552 Views)

Hi Peira,

 

The 2nd step means when you use shift register to pass TDMS file path, you must make sure you pass a correct path but not a empty path. Or you can use tunnel to replace shift register, this will make file path at beginning and cannot be changed during running in the while loop.

 

0 Kudos
Message 10 of 14
(6,546 Views)