PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

PXI crashes when failing to change scan engine to active mode

I have discovered that my rtexe program running on my PXI crashes when my EtherCAT hardware becomes disconnected for an extended period of time. The crash is always an access violation (exception code 0xC0000005) and always blames the NILXTCOR DNS Lookup Thread. I've attached an error log if you want to have a look at it. It can take anywhere from 60 seconds to 12 hours for the crash to occur.

 

At the beginning of the portion of my program responsible for EtherCAT communication, I use the Set Scan Engine Mode VI to attempt to set the scan engine to Active mode. If it fails, it waits 500ms and tries again. If my EtherCAT devices are disconnected from the PXI, the attempt to set the scan engine to Active mode always fails, and the Set Scan Engine Mode VI outputs error -2147138532. If I remove this small bit of code so that it does not attempt to change the scan engine mode, the rest of my application--which is running in parallel with the EtherCAT code--can run flawlessly for days. When this bit of code is running, the RT program crashes in the manner I described above.

 

Is there a way that I can detect if all my EtherCAT devices are connected before attempting to switch the scan engine to Active mode? While I have been attempting to identify the source of the crash and have been in contact with NI support on the matter, I really need to find a workaround. This behavior presented itself when I upgraded from LabView 2009 to 2013.

Message 1 of 2
(5,191 Views)

Take a look at this KnowledgeBase article and see if it applies to your system:

 

How Can I Programmatically Discover and Access EtherCAT I/O Items?

Jeff L
National Instruments
0 Kudos
Message 2 of 2
(5,172 Views)