LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

canopen port closed

I have an application that uses the CANopen port to communicate with a motion control system.  When debugging the application, if I exit runtime without exiting LabVIEW, I will sometimes get an error upon restart saying that the CANopen port is closed.  I will then have to exit LabVIEW completely in order to restore the communication.  Once I build the executable, it is no longer a problem because the RTE is shutdown each time the application is exited.  However, eliminating this problem would save me some valuable debug time.  It would also prevent my boss from saying "What the heck is that!!!???"  EVERY SINGLE TIME the error message pops up on the screen.
 
When my application shuts down, I am correctly destroying the objects, so this cannot be the problem. 

Anyone have any suggestions?
 
Thanks,
Ryan
0 Kudos
Message 1 of 7
(3,185 Views)
Get your boss to drink decaf?

Seriously though folks... I'm not clear what you mean "...if I exit runtime without exiting LabVIEW...". If you mean that you stop your VI and then restart it, it sounds like you are not closing everything out that needs to be closed. Try turning on execution highlighting when shutting down your application and make sure all the deinitialization code really is getting called. It's real easy to have a logical error that keeps code that you know is executing from being run (I've only done it about a billion times...). Also be on the look-out for unreported and therefore unhandled errors.

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 7
(3,173 Views)
Yes, that is what I mean, simply stopping and restarting my app in development mode.

I've made sure in the past, that all objects are being properly closed/destroyed.  This error seems to occur at random. 
Is it possible that I am leaving the CANnetwork in a state that makes it unable to be reopened?

Fortunately, it's not a dealbreaker.  More of a nuisance than anything else
0 Kudos
Message 3 of 7
(3,170 Views)
Hmmm.... Well unless you can come up with some way to repeatably generate the error there is not a whole lot you can do. One place that I have found many random problems in my own work is in association with unhandled errors: A problems in one place (that doesn't get reported) causes a problem somewhere else (that does).

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 4 of 7
(3,165 Views)

Hi,

Is there an error code associated with that occasional error pop-up?  Perhaps I can dig up some more information on the problem that way.  That is unusual behavior, but as you said, it definitely sounds like the port is being left in a bad state (or not being closed properly, although it sounds like you have looked over this aspect fairly carefully already).  Let us know if you recognize more of a trend to the behavior.  Thanks!


Regards,
Anna M.
National Instruments
0 Kudos
Message 5 of 7
(3,140 Views)
The Error message is as follows:

Error -2147467259 occurred at Exception occured in CMLCOM.AmpObj.1: The CANopen port is closedHelp Path is No_Help_File_Available.hlp and context 70 in CopleyAxis Create.vi->CopleyRobot Create.vi->IBM Create.vi->Main.vi
 
Thanks!
0 Kudos
Message 6 of 7
(3,139 Views)

Hi,

Unfortunately, there does not appear to be any direct help file associated with this error, making it difficult to pin down.  Searching past service requests on this error, it looks like it has typically occured with database connectivity applications and VI Logger applications.  Also, since the error occurs @ CMLCOM.AmpObj.1, it sounds like an error occurred on the AmpObj side, and it was passed up to LabVIEW - does this sound like something that may have happened?  I'm sorry that I don't have more information for you, but definitely let us know if you are able to pin down when this error occurs more precisely.


Regards,
Anna M.
National Instruments
0 Kudos
Message 7 of 7
(3,079 Views)