LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ncOpen failed error -1074388985

When starting an application, I run ncConfigCANNet.vi, then ncOpen.vi.

While debugging, I occasionly have to stop the main.vi.

When I do this, when I restart, I then get error  -1074388985 apparently because I'm attempting to configure a Running port.

Apparently the port is still running even though the application has stopped?

 

I can trap this error and then stop the port, then configure, then restart the port.

But is there a way to test to see if the port is running, so I can address the problem before an error occurs?

 

Also, It seems a little odd that I can run ncOpen on a running port, but maybe this is the only way to get the object handle for an already open port.

 

 I'd like to find a better way to address this port already open/running scenario.

 

 

0 Kudos
Message 1 of 3
(3,100 Views)

First, I suspect that for debugging you are stopping the program using the Abort button. If this is what you are doing, it's not a good practice. As someone here on the forum says, you can stop your car by ramming it into a tree - but there can be consequences... So it is with the Abort button.

 

Beyond that, if the error trap works and there are no other bad side-effects it sounds like you already have a solution to your problem. Assuming that you stop the port appropriately during a normal shutdon this should only be a problem during development.

 

Mike...

 


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 3
(3,088 Views)

Yes I'm using the abort button to stop the simulation because I'm debugging the graceful/orderly shutdown of a multi loop program.  I'm controlling a motor using diagnostic mode GMLAN. When the user tries to exit the program, I first have to process an orderly shutdown of the motor before allowing the GUI application to exit.  I'm debugging it, and the abort button is causing the issue with the ncOpen upon restart.

 

So yes, this problem won't occur once I have my orderly shutdown working.  For now, I have a work around by trapping the error and addressing it.  I was just wondering if there is a better way to do it by detecting a started port and avoiding the error proactively, rather than causing the error to occur and then respond to it reactively.

 

Also, I wanted to know if ncOpen returns a handle to a port that is already open and running.  I would have thought that ncOpen on an already open and running port would have caused an error.

 

 

 

0 Kudos
Message 3 of 3
(3,074 Views)