LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting CAN network interface that wasn't closed before the application ended

Hello folks,

 

I have an application using CAN that could experience conditions that would cause the program to end without first closing the CAN network (i.e. port).  I found the information below on ni.com, but I haven't been able to determine what I'm supposed to wire to the "ObjHandle in" input of ncAction.vi (opcode = "Reset").

 

QUESTION: 

Does anyone know what should be wired to the "ObjHandle in" input of ncAction.vi (opcode = "Reset") to reset a CAN port that was not closed before an application terminated?  (I suspect a PC reboot or card reset in NIMAX will do it, but I need to do it programmatically).

 

All help and suggestions are appreciated. 

 

Best Regards,

Chris 

 

 

INFO from NI.com suggesting the use of ncAction with opcode = "Reset":

 

Problem:
My program has crashed or aborted and my NI-CAN or NI-DNET object was not closed properly, when I try to restart my code again I get error -1074388986. How can I clear my device?

Solution:
Use the ncAction.vi with "Reset" wired into the Opcode input.  The Reset action first issues the Stop action, clears all entries from the write queue, then resets the CAN or LIN hardware.  Resetting the CAN hardware sets the CAN error counters to zero, returning the CAN controller to error active state.

0 Kudos
Message 1 of 2
(2,796 Views)

Hi Chassan,

 

Looks like there might have been an issue with the picture on the Knowledge Base article you found, I'll post the picture for you here.

 

ncAction.JPG

 

Programmatically Clearing a CAN, DNET or LIN Device.

 

Looks like the object handle has to come from a Can Open VI.

 

I hope that helps.

 

Thanks

Scott M.

 

Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,762 Views)