annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

TDMS file reference invalid error 2501

I know this has been covered before, but none of other solution seem to fit my problem.

 

Here's an example of what I'm trying to do. Please ignore the missing error pathways, and note that the Read nodes data in my actual code goes out to a CSV which works.

 

 

I'm constantly getting an Invalid TDMS Reference error on the TDMS Write node. I've probed the path, and the number stays the same along the path, and I'm not closing it until the while loops are stopped. Can I not branch the TDMS Open path? Am I doing an illegal process here that is messing up the reference?

 

example.PNG

0 Compliments
Message 1 sur 9
4 644 Visites

You don't post the actual code and based on the picture, you have two errors (no stop condition).  So the code is obviously not executable.  How certain are you that both loops have stopped before you close the TDMS reference? 

aputman
0 Compliments
Message 2 sur 9
4 622 Visites

<delete please>

0 Compliments
Message 3 sur 9
4 566 Visites

aputman,

I would have posted the code, but 1) proprietary 2) the portion I've shown is the essential piece. Yes, I understand there is no stop condition, hence why it's an example and not working code. As to how sure am I the loops haven't stopped, I'm absolutely positive since the stop condition stops the entire VI and that doesn't happen without the user clicking a button. 

 

My question is more about the routing of the TDMS, what I can and cannot do with it, and if I'm doing the TDMS portion properly or if the error is caused upstream somewhere. As shown, I need to be able to write to it when the boolean is True, and then once the boolean goes from True to False (via the user input), the TDMS file needs to be read and the outputted to a CSV.

0 Compliments
Message 4 sur 9
4 559 Visites

I know you say to ignore the missing error lines and ignore the missing stop conditions but in the whole scheme of things, what you think is working code may in fact be the cause of your problem.  

 

What is in the other case structure frames?

Why do you need two loops if you are writing to the TDMS while the boolean is true and reading from TDMS while boolean is false?  Am I missing something here?  Can you not combine the case structures so there is no way to read and write from the TDMS as the same time?

If this is example code, can you post it rather than your proprietary code?

 

aputman
0 Compliments
Message 5 sur 9
4 548 Visites

why do you need two loops?  a single loop would handle your situation, or put your tdms access in a subVI / functional global that can be called in multiple places.

 

if you need branch your tdms reference, use the advanced vis instead, they have better handling of parallel tdms file access (read n write).

 

-Joe

0 Compliments
Message 6 sur 9
4 537 Visites

I agree that parallel access should be eliminated with a VIG or some other mechanism.  But that being said TDMS is quite robust, and I've seen tests where many parallel loops read and write to the same reference all the time and didn't see an issue.  I'd refactor it and see if the issue goes away but with (the little) I can see I wouldn't expect an issue.

0 Compliments
Message 7 sur 9
4 528 Visites

what about the size of the array that to be written?  TDMS write will generate error when the array is empty.

 

-Joe

0 Compliments
Message 8 sur 9
4 510 Visites

I know this is example code, but it also doesn't look like the shift register for Record Data in the top loop is being initialized, so there might be some unexpected behavior there. If that runs through to the false case in the top loop, you might be closing the reference early in your real code, but it's hard to tell without the stop conditions. 

 

I'll echo that screenshots of the other cases would definitely be helpful here, and that combining this process into one loop could help clarify what's happening.

Claire M.
Technical Support
National Instruments
Certified LabVIEW Developer
0 Compliments
Message 9 sur 9
4 491 Visites