LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

reset DNET

Hi,
I'm having problems with my DNET. Everytime my program fails the objhandles opened don't get closed and the communications keeping running. I tried outputing the objhandles' addresses to a file and then read them back in the next time I run the program to make sure the objhandles were closed but I get an objhandle invalid message. In order to make my program function again I have to restart my computer to reset the DNET board, which is a pain in the butt. Is there anyway I can get around restarting my computer in my software? Like maybe a board reset function or some way to stop all communications without the objhandles. I'm programming in  C.
Thanks   
0 Kudos
Message 1 of 9
(5,376 Views)
Hello Mbrewers272:

Try this, at the beginning of your code open and close a dummy handle. This should force DNET to close all handles and then open the handle that you want to program with. Let me know how that goes.
Regards,

Roland A.
Applications Engineer
National Instruments

Check out VI Roadshow
0 Kudos
Message 2 of 9
(5,312 Views)
Hi Roland,
 
Sorry it has taken me this long to respond. I do appreciate the help.
 
I can't open any object handle when the program errors out or I stop it, even a dummy one. It allows me to open another one only if I have the same mac id but even if I do run the program one more time with the same mac id it doesn't close the orginal errored object hanldes and only allows the same mac id again. I have been getting much better at implementing stop buttons to avoid using the stop execution button so stopping it isn't the problem but sometimes it errors out and the handles are not closed. Do the Close Object VI's, that came with the devicenet software, close the objects even when an error occurs? I know they have an error case state structure but both have dlls so I can't determine if both cases do. I would think they would both close the object handles even if an error occurs which is why I'm confused they have a error case structure. Any other ideas would be greatly appreciated.
 
Thanks,
Randy  
0 Kudos
Message 3 of 9
(5,241 Views)

Roland,

My previous reply wasn't correct. When an error occurs it does close the object handle. So that isn't a problem but this is the error message I get after I use the abort execution button and then try and use a different mac id:

"Error -1074388986 occurred at Open DeviceNet Interface.vi

Possible reason(s):

NI-CAN:  (Hex 0xBFF62006) The object is already open in another application.  Solutions: Ensure that only one application at a time uses an object , and that you close all objects prior to exiting your application (don't use LabVIEW toolbar's Abort button)."

Since right it the error message it says don't use the toolbars abort button I will avoid it as much as I can. But if I should have to use it because of inadiqute programing, i.e. infinite loop, or if someone using the program does, is there any other way to reset the board?

 

Thanks,

Randy D.

Miller Electric Intern

 

 

0 Kudos
Message 4 of 9
(5,236 Views)
Randy,

Unfortunately, there's no way to reset your CAN/DNET hardware in MAX like you can do with DAQ cards.  If you can't avoid using the Abort button, you might be able to reset the device by exiting LabVIEW and MAX, but if that doesn't do it, you'll have to reboot the computer.  However, like you mentioned, this problem can be minimized by just making sure you put Stop buttons in all of your loops and handle any errors correctly.  Good luck!
Chad B. » National Instruments » ni.com
0 Kudos
Message 5 of 9
(5,194 Views)
Chad,
 
I will try that. Thanks for the help.
 
Randy
0 Kudos
Message 6 of 9
(5,191 Views)

I am having a similar problem.  I can reset the card with Measurement and Instrumentation Explorer.  Is there any way to reset it from Labview?

 

Thanks,

 

Joe

0 Kudos
Message 7 of 9
(4,648 Views)

Hey Joe,

 

If there isn't a way to reset your device through the driver for that device, you won't be able to programmatically reset it. For example, there is a DAQmx Reset Device VI that performs this function, which is included in the DAQmx driver. I don't believe the NI-DNET driver includes a function that does this.

Justin E
National Instruments R&D
0 Kudos
Message 8 of 9
(4,625 Views)

Thanks, but it is bad news.  This means I have to open another application to reset the card if I make an OOPs in data entry, like type in the wrong mac-id or try and run the program before the devices reboot.  What a bummer.

0 Kudos
Message 9 of 9
(4,620 Views)