LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS Advanced Open from Subroutine VI

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.

--
Ajay MV


0 Kudos
Message 1 of 9
(3,668 Views)

Ajayvignesh MV, could you provide a simple VI to reproduce this issue?

0 Kudos
Message 2 of 9
(3,667 Views)

Hi Bo Xie,

 

   Here is the sample VI attached.

 

Thanks,

Ajay

--
Ajay MV


0 Kudos
Message 3 of 9
(3,665 Views)

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 

 

 

 

 

Jamie Jones
Applications Engineer
National Instruments
0 Kudos
Message 4 of 9
(3,653 Views)

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.

--
Ajay MV


0 Kudos
Message 5 of 9
(3,650 Views)

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.

 

Jamie Jones
Applications Engineer
National Instruments
0 Kudos
Message 6 of 9
(3,644 Views)

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.

--
Ajay MV


0 Kudos
Message 7 of 9
(3,641 Views)

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

 

 

Jamie Jones
Applications Engineer
National Instruments
0 Kudos
Message 8 of 9
(3,627 Views)

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.

 

No Broken arrow for binary file write in SUBROUTINE mode.png

 

Thanks,

Ajay.

--
Ajay MV


0 Kudos
Message 9 of 9
(3,605 Views)