06-30-2011 02:24 AM
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?
06-30-2011 02:52 AM
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.
06-30-2011 03:42 AM
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?
06-30-2011 04:15 AM
06-30-2011 04:33 AM
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
06-30-2011 06:47 AM - edited 06-30-2011 06:48 AM
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?
06-30-2011 07:30 AM
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
06-30-2011 08:12 AM
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?
06-30-2011 08:18 AM
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
06-30-2011 08:42 AM
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.