Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait For State error

I'm having problems with NI-DNET's polled I/O.  Sometimes it will connect and other times I get a Wait For State error stating that the DeviceNet device timed out.  Error code is -1074388927.  It will normally connect and work fine the first time, but if I disconnect and then try to reconnect, it will fail as soon as I try to read anything.  I've tried changing the poll mode from automatic to individual with several different expected packet rates and it still fails.  I've also tried increasing the timeout value in the WaitForState function to 20 seconds (which is more than enough time).  I can tell that the system fails before 20 seconds.  The explicit messaging works fine, I can connect, disconnect, and reconnect as many times as I want without any problems.  I know my slave board and cabling are ok because they both work fine with my SST card.  Any ideas?  Thanks.
0 Kudos
Message 1 of 12
(9,469 Views)
Hi,
 
It sounds like the device is not initializing and thus not being detected by the system after you reconnect it.  Are you trying to disconnect and reconnect the device while the program is running?  What version of the NI-DNET driver are you running?  Have you tried running the NI-DNET Analyzer?  It can help with troubleshooting the bus.  Also, you could try implementing the Get Device List example VI after reconnecting the device.
 
I also recommend taking a look at the DeviceNet/ODVA Official Website to find out more information about DeviceNet communication.  Let me know where you stand on this.
 
Regards,
Lauren
Applications Engineering
National Instruments
0 Kudos
Message 2 of 12
(9,455 Views)
Hi Lauren,
Yes I am trying to disconnect and reconnect while the vi is running.  I have NI-DNET version 1.6.1.  I have tried using the NI-DNET Analyzer but I get this error message:
 
NI-CAN: (Hex: 0xBFF62108) The NI-CAN and NI-DNET functions cannot be used simultaneoulsy on the same CAN card (even 2-port cards).  Solution: Use 2 or more CAN cards, with NI-CAN on one card, and NI-DNET on the other.
 
I have tried the examples in DeviceNet-Basic.llb (EasyIOMultipleDevices.vi, MixedCommunication.vi, and SingleDevice.vi) that come with NI-DNET and they exhibit the same failure.  Sometimes I can connect, other times I can't, sometimes I can reconnect after stopping and starting the vi, other times I have to close out LabView and restart it in order to connect again.
 
I'm not sure what kind of connection the NI-DNET Configurator uses but I can connect, disconnect, and reconnect as many times as I want without any problems using it.
 
Thanks,
Chris
0 Kudos
Message 3 of 12
(9,450 Views)

Hi Lauren,

I received a PCMCIA DNET card today so I installed it and gave it a try.  I could not get it to fail.  I took the same slave board, same cabling, and same power supply to the station with the PXI card and it kept failing.  Should I exchange my PXI card for a new one?

Thanks,

Chris

0 Kudos
Message 4 of 12
(9,439 Views)

Hi Chris,

My guess is that the error lies in the fact that the PCMCIA-DNET card operates solely as a DNET device.  The PXI module you are using has both CAN and DNET functionality, and needs to be set for each specific protocol.  For some reason, when you are disconnecting and reconnecting the system, it tries to set it up as a CAN device, causing the error you are seeing.

What PXI module are you using?  Where are you disconnecting it from while the program is running?  Are you running into any functionality errors when running without disconnecting it?

Regards,

Lauren

Applications Engineering
National Instruments
0 Kudos
Message 5 of 12
(9,434 Views)

Hi Lauren,

I have a PXI-8461 installed in a PXI-1042 chassis.

I attached the code I am using for testing.  All it does is connect, write data, read data, disconnect, and repeat.  With the PCMCIA DNET card, it will loop continuously without error.  With the PXI DNET card, it fails at the wait for state function (Read Avail).  Sometimes it will work correctly on the first loop iteration, but fail on the next loop iteration.  The only place I've seen it fail is at the wait for state function.

Thanks,

Chris

0 Kudos
Message 6 of 12
(9,431 Views)

Chris,

When you are receiving the error on the PXI card, does it occur on its own or require you to disconnect the device?  I know you previously mentioned that errors occurred when you reconnect a device.  Is this a different issue?

I know that you have also been interacting with Ted through e-mail.  We are both looking into this issue and will keep you in the loop regarding any progress.

Regards,

Lauren

Applications Engineering
National Instruments
0 Kudos
Message 7 of 12
(9,426 Views)

Hi Lauren,

Sometimes the error will occur on the very first loop iteration in the code I attached previously (if an error does occur, it always happens at the wait for state function).  If it happens to work correctly on the first iteration, it will go ahead and read correctly and disconnect without error.  Then on the next loop iteration it will fail on the wait for state function.  So sometimes it will fail on the first connection, other times it will work correctly on the first connection and then fail on the second connection.

Thank you both very much for your help.

Chris

0 Kudos
Message 8 of 12
(9,424 Views)
Chris,

I have very similar problem.  How  did you resolve it  and what is the root cause ?
poll mode from automatic to scanned  with several different expected packet rates  (30ms)
I have 10 Devices (cards) and it almost failed only on exact same one every few days. I am not connect/disconnect while running. I change the code of "wait for state.vi" to track more info.

Error code is -1074388927

Current state is 16
Wait for state is 1 (Read Available)
Obj Handle is 105120420 (the Device handler#)


0 Kudos
Message 9 of 12
(9,005 Views)
The problem I was having was never resolved.  I sent my device to NI, and their application engineers basically said that the NI-DNET card is not compatible with my device.  So I chose to use a different card.
0 Kudos
Message 10 of 12
(8,992 Views)