LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Message "Resetting VI" hangs LabVIEW

I encounter a strange problem when asynchronously running multiple clones of reentrant VI.

LabVIEW shows modal dialog Resetting VI

Msg_Resetting_VI.gif

The dialog hangs forever. I can only kill whole LabVIEW development environment from Windows side.

 

  • The problem does not appear often but probably once per several hundred runs.
  • The clones are started using VI Server, i.e. Invoke Node Run VI. Max number of clones of the same VI is 12.
  • The VI does not communicate with any equipment. It sends and receives eventual messages via queues and works with HD using VI-s of Configuration File VIs pallete.

What could cause such a behavior?

Thank you.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 1 of 17
(1,168 Views)

Do you maintain separate references for your clone VIs, and use them to communicate with your Clones?  About 8 years ago, we wrote a Behavior Monitoring system that working with 4-24 "Stations" consisting of a "Sensor", "Camera", and "Video" sub-Clones to record the behavior triggered by the sensor, allow us to view the subjects using the Camera, and captured Videos of the Camera feed when triggered by the Sensor.  Testing sessions were around 2 hours, and we rarely had problems (other than the occasional Network problem with the TCP/IP cameras).  The Main routine started the Station Clone using "Start Asynchronous Call".  In the initial development, all communication was via Queues, but after 2016, we replaced most of the Queues by Messenger Channel Wires (we had to occasionally "cheat").

 

The Sensor, Camera, and Video routines within each Station Clones were simply coded as parallel QMHs, configured as a Clone (or after 2016, as Channel Message Handlers), so they didn't need to be "called" -- they simply ran in parallel with their "owning" Station Clone, and ended when the Station stopped them by sending them their "Exit" Messages.

 

It seems to me that I've had more success with using Start Asynchronous Call than with VI Server, starting from before embarking on this Clone-a-thon.

 

Bob Schor

0 Kudos
Message 2 of 17
(1,141 Views)

According to this link, it could be caused by some kind of abort happening.  "If the dialog box remains on the screen for longer than a few seconds, one of the threads is most likely busy finishing a task (such as I/O) or is performing a blocking operation."

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 17
(1,138 Views)

@Bob_Schor wrote:

Do you maintain separate references for your clone VIs, and use them to communicate with your Clones? 


Thank you Bob

 

No, references are terminated immediately. These clones (methods of corresponding classes) communicate with other processes via queues, update attribute of the class then disappear. As a rule, everything works well. The problem is very rare.

 


@Bob_Schor wrote:

It seems to me that I've had more success with using Start Asynchronous Call than with VI Server, starting from before embarking on this Clone-a-thon.


I have opposite experience. Start Asynchronous Call created so many problems for me that I added it to my personal list of depreciated functions. But this experience could be out of date, at least one problem (difficulty to debug) was solved  by NI some time ago.

 

 


@billko wrote:

According to this link, it could be caused by some kind of abort happening.  "If the dialog box remains on the screen for longer than a few seconds, one of the threads is most likely busy finishing a task (such as I/O) or is performing a blocking operation."


Thank you Bill

 

These VI-s do not communicate with HW but they could write in Config file. I shall attend it. They do not call Abort node but some state machines in the program keep it as a "last chance". I.e. Abort could be called if regular methods to stop the process failed.

 

Cold you write meaning of words "blocking operation"? Is it locking by In Place Element Structure or something else?

 

 

 

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 4 of 17
(1,080 Views)

In general code that is keeping other code from running (or makes something run very slowly) is called "blocking".  In LabVIEW, it is often a driver that crashes, leaving LabVIEW hung.

 

I've mostly seen this happen when I am impatient with the code exiting normally and I just abort it.  Then the resulting ungraceful exit causes the message and the hang.  I think this is a symptom rather than a cause.  I think that by the time I click the abort button, it has already hung, and that message is the last-ditch effort to unstick the program.

 

This link also says, "- It can also appear when LabVIEW has to wait for all processes to terminate before it shuts down. One work around is to wait  longer before closing out of LabVIEW." So maybe your error handling causes the application to try to shut down gracefully, but something is still running in the background when the application terminates.  In your case, maybe something crashed your app, it tries to exit gracefully, but whatever crashed your app makes it impossible to exit.  Are you using dlls? Maybe a dll occasionally has an error happen inside of it and it doesn't exit gracefully, causing LabVIEW not to be able to exit gracefully.  Of course, this is all a wild speculation.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 17
(1,075 Views)

You claim that you do not access hardware, but the name of that class, TrinamicMotor.lvclass really would suggest otherwise.

 

If you call functions that access DLLs this can happen if the DLL function keeps hanging. LabVIEW has no way of aborting a DLL call. It can just hope that the function eventually returns but if that DLL is not written 100% perfect it can keep hanging in some function, including the close or cleanup function as it waits on something else that supposedly is still busy using the resource.

 

For instance the DLL may be locking the resource with a mutex, and every function has to acquire the mutex to be able to access the hardware. For Motion applications this is very common as you do not want a function to get interrupted while it is handling an axis by another call trying to change the same axis under its nose. Each function is supposed to release that mutex after it finishes and before returning to the caller but sometimes it happens that such a function runs into an error and returns to the caller to report that error and forgets to release that mutex. Any other call after that trying to acquire the mutex will hang indefinitely in that attempt to get the mutex reserved and the original function that acquired it will never go and release it. LabVIEW can't abort the DLL function, and the DLL function will never return before it could get the mutex which it will never be able to get in this case. Classical Mutual Exclusion lock happened!

 

So why is that class called TrinamicMotor when it does not communicate with any hardware anywhere?

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 17
(1,070 Views)

@billko wrote:

I've mostly seen this happen when I am impatient with the code exiting normally and I just abort it.  Then the resulting ungraceful exit causes the message and the hang.  I think this is a symptom rather than a cause.  I think that by the time I click the abort button, it has already hung, and that message is the last-ditch effort to unstick the program.

 

This link also says, "- It can also appear when LabVIEW has to wait for all processes to terminate before it shuts down. One work around is to wait  longer before closing out of LabVIEW." So maybe your error handling causes the application to try to shut down gracefully, but something is still running in the background when the application terminates.  In your case, maybe something crashed your app, it tries to exit gracefully, but whatever crashed your app makes it impossible to exit.  Are you using dlls? Maybe a dll occasionally has an error happen inside of it and it doesn't exit gracefully, causing LabVIEW not to be able to exit gracefully.  Of course, this is all a wild speculation.


I do not think this is the case. Current operation does not close the running program. It only prepares HW for further shutdown of the SW. These steps cannot overlap. LabVIEW development environment is not closed at all.

 


@rolfk wrote:

You claim that you do not access hardware, but the name of that class, TrinamicMotor.lvclass really would suggest otherwise.

My claim is correct😉 Motors are connected to CAN-communicating controller. There is an asynchronous CAN-process communicating with CAN-dongle. TrinamicMotor.lvclass exchanges messages with CAN-process via queues.

 


@rolfk wrote:

If you call functions that access DLLs this can happen if the DLL function keeps hanging.

The project calls several DLLs but this VI does not. Sub-VIs don't call DLLs too.

 

Could it be that blocking happens in one process but LV message shows other VI?

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 7 of 17
(1,030 Views)

When this error appeared to me it was a case of an asynchroniously called VI (a VISA communication VI) did not shut down correctly, while i tried to close the Main VI.

For me the main VI front panel actually closed, but this VI was kept running in the background and hang. Had to kill it with task manager in order to run the application again.

 

(Killing this VI also then caused the machine to throw an error and shut down, indicating that communication was actually still going on in the background)

0 Kudos
Message 8 of 17
(1,019 Views)

@_Y_ wrote:

The project calls several DLLs but this VI does not. Sub-VIs don't call DLLs too.

 

Could it be that blocking happens in one process but LV message shows other VI?


Only so called synchronous VIs (and the Call Library Node) can cause this dialog. Now many VIs in LabVIEW are synchronous, but they can not block for a long time so that means at worst case they will delay the closing a little.

 

For the Call Library Node there is no way around that, if the function doesn't return LabVIEW can't force it.

 

For VISA functions, which call the VISA32.DLL under the hood mainly the VISA Read can be problematic, but the VISA functions can be changed to asynchronous through a right click menu option. In that case the node will setup an asynchronous call and then regularly poll the VISA driver if the current operation has completed. This way control stays in LabVIEW and LabVIEW can abort that loop at will. Drawback is that that polling costs some extra resources and can in extreme cases make the communication end up being slower than with synchronous operation.

 

All the network functions that can take longer such as TCP/UDP Read/Write are fully asynchronous and LabVIEW can abort them if needed even if they are waiting in an indefinite timeout. Same about Queue, Semaphores, Notifiers and Rendevous (a  Queue under the hood).

 

So unless you found a bug with Queues somehow, which is pretty unlikely after abot 15 years of queue implementation in the current way, you must have some synchronous function in that VI or in one of its subVIs that blocks when LabVIEW tries to abort it.

Rolf Kalbermatter
My Blog
Message 9 of 17
(1,007 Views)

@_Y_ wrote:

@Bob_Schor wrote:

Do you maintain separate references for your clone VIs, and use them to communicate with your Clones? 


Thank you Bob

 

No, references are terminated immediately. These clones (methods of corresponding classes) communicate with other processes via queues, update attribute of the class then disappear. As a rule, everything works well. The problem is very rare.


Sounds like you would be able to use parallel execution of a for loop in stead.

 

wiebeCARYA_0-1681727887066.png

Message 10 of 17
(994 Views)