Hello, I have an external device that connects to my PC via COM port and in turns it communicates with my labview program using NI-VISA. The external device has a small known glitch that causes to lose communication with the PC but after less then a second it automatically reconnects. I have seen Device Manager recognizing the device when it reconnects but NI-MAX will not recognize it until I close it and open it up again. I looks to me as if NI-VISA would have to be reset it. Is there a way to include a routine to have my labview code reset NI-VISA drivers, probably? I have tried closing the port and open it up again but still doesn't work for me apparently because the COM port is no longer available, so it cannot close a session that does not exists.
any ideas what I could try next?
I understand the issue as you've described it. Unfortunately, my experience is that you have to close LabVIEW or MAX, whichever you are using, and re-open them to get them to recognize a serial port that has been recognized by the system after LabVIEW or MAX was started. E.g. I got nothin. Sorry. I hope someone can post a fix, but I've always assumed there was none.
Found a few good threads right on this forum.
that is correct Dave_Thomson. Up until now, I have not found anything other than closing LabVIEW or MAX and open it again. thanks for answering though.
I have to comment here that this is not really a LabVIEW issue. Any application that is using a COM port and did not exit gracefully will exhibit the same issue. At least with LabVIEW, we can shut down the runtime engine and MAX and be able to recover.
Thank you Pallen. I check the links but, if I understood them correctly, they all three talk about scanning, automatic detect and VISA configure having a base line the fact that MAX recognizes the ports. My problem is MAX loses communication and does not recognizes the device until closing and opening MAX. What is weird is that Windows loses communication at the same time MAX does, but when my external device becomes available, Windows recognizes it (based on Device Manager) but MAX doesn't. From then on, scanning, automatic detect and port configuration are no longer a solution.
Correct Billko, that is exactly my problem, I agree with you. So my question is if there is something that can programmatically restart the runtime engine and/or MAX. I guess I forgot to mention this communication issues are happening while running the labview program in a production environment. It is not practical for me to be shutting down the runtime engine and/or MAX. That is why I'm trying for a programmatical solution, if there is any.
thank you Gregoryj, I guess I forgot to mention this communication issues are happening while running the labview program in a production environment. It is not practical for me to be shutting down the runtime engine and/or MAX. That is why I'm trying for a programmatical solution, if there is any.
Is the loss of communication by the device more of a heating/warm-up issue or a length of connection issue. If it is the latter, then setup your LabVIEW program as connect to device, command/query, close connection each loop through your program.