08-16-2012 02:40 AM
How to open a TDMS file from a Subroutin VI? The VI becomes broken when I use "TDMS Advanced Open" or "TDMS Open". Even after connecting "False" constant to the "enable asynchronous? (T)" in the TDMS Advanced Open, the VI is broken. The error thrown from the bronken VI is as follows.
This VI has subroutine priority selected in VI Properties»Execution. It may not use an asynchronous node on its block diagram. Asynchronous nodes allow other VIs to execute in parallel, which a subroutine should not do.
Thanks,
Ajay.
08-16-2012 02:43 AM
Ajayvignesh MV, could you provide a simple VI to reproduce this issue?
08-16-2012 02:50 AM
08-16-2012
04:49 AM
- last edited on
05-19-2025
10:09 AM
by
Content Cleaner
Hi Ajay,
From a quick search of the LabVIEW Help files I've found some more info on the Subroutine Execution Priority and the Error you're experiencing. Excuse me if you've already been through these steps.
The first link (at the bottom) just clarifies the differences between the other priority levels and Subroutine Priority:
https://www.ni.com/docs/en-US/bundle/labview/page/prioritizing-parallel-tasks.html
To summarise, Subroutine Priority VIs are designed to run as streamlined as possible and therefore cannot call functions that interact with the execution queue, such as the TDMS Functions.
Is this Priority Level essential for the VI in your application?
The second link gives you a little more explanation on your specific Error and how to change VI Priority Levels:
https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/errors/subroutine-asynchronous-node.html
08-16-2012 04:59 AM
Hi Jamie Jones,
Yes this Subroutine priority is important for my application. I have gone through those help links you mentioned and thanks for the same.
I have a doubt here, if Subroutine is used to streamline the application as much as possible, then why do we have ADVANCED TDMS options. We have
TDMS Advanced Synchronous Write
TDMS Adavnced Asynchronous Write etc...,
Even I tried with this Synchronous Write in a VI which is configured as Subroutine. But the error is still persisting. Could you explain this?
Thanks,
Ajay.
08-16-2012 05:33 AM
Hi Ajay,
Can you briefly explain why you need the Subroutine Priority Level in your application in case we can find a different solution?
The Subroutine level is used when you need to reduce the overhead of a Sub-VI that performs only simple computational tasks.
File IO in terms of execution is inherently asynchronous as your program will wait for the Operating System to access a file.
The Synchronous Read/Write options are referring to the method of reading/writing once the file has been accessed.
E.g.. Synchronous will write several elements to file each time it is accessed and asynchronous will only write once for each opening and closing of the file.
08-16-2012 06:18 AM
Jamie Jones,
Thanks for the info.
My application in brief:
I have a timed while loop which runs at 100ms. Inside this loop, I acquire DAQ data, process it and then log it in a TDMS file. Previously this implementation was done with binary file read/write as Subroutine.
One More Doubt:
I have another doubt here.. If File IO is inherently asynchronous, then how come this binary file manipulation is possible in a Subroutine VI?
Thanks,
Ajay.
08-16-2012 10:44 AM
No problem Ajay,
I have had a quick look on my machine and receive the same error when I use binary file functions as well (attatched below).
Out of interest which version of LabVIEW are you currently using and which version was the original VI. developed in? i.e the one using binary file I/O.
Forgive me as I'm not completely sure of your application, however you are be able to accomplish logging to a TDMS file in a Normal priority Sub-VI? Is there another reason you need Subroutine Priority?
Kind Regards
08-16-2012 11:39 PM
Jamie Jones,
I use LabVIEW 2011 and it doesn't show the error(broken arrow) when I use the Write Binary File. You can see that in the picture I attached.
I can now understand that, any file processing from LabVIEW is Asynchronous. Also, we have changed the architecture of the application to avoid using file processing VIs as Subroutine. Thanks for your information.
Thanks,
Ajay.