LabVIEW

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.vi" error stating that the DeviceNet device timed out.
The dialog box only have two button : "Close" and ".Continue". If you hit "Close", it close the vi. If you hit "Continue", most of the time it can get the readings and keep going. Some time it keep asking I have to close labview or even reboot the PC.
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 (Where to find what it is ?)
Wait for state is 1 (Read Available)
Obj Handle is 105120420 (the Device handler# ?)


0 Kudos
Message 1 of 6
(3,233 Views)
Hi vxco,

Which NI card are you using, are you using the older PCI-CAN card, or the PCI-DNET card? Also, which device is it that it fails on? Are the 10 devices that you have the same, or are they all different devices?

Would it be possible to modify the VI so that it polls only that particular device, and see how often that fails? Let us know, thanks!
Rasheel
0 Kudos
Message 2 of 6
(3,199 Views)

Which NI card are you using, are you using the older PCI-CAN card, or the PCI-DNET card?  PCI-DNET card


Also, which device is it that it fails on? Are the 10 devices that you have the same, or are they all different devices?

There are 11 Devices. 0 and 2 are analog IO.  7,8,9  are Dnet IO  (mix of Analog/Digital) . Others are Digital IO.
It only fails on Device2 (Analog IO) which contain the (most) slowest Analog  Input read (temperature). I read the temperature every 500ms.


Would it be possible to modify the VI so that it polls only that particular device, and see how often that fails?
I modified the "wait for state.vi" and found it only failed on Device2 when it try to read the Analog input -temperature. It only happened about once a week(few days) so far.


Error code : -1074388927
Current State:16 (what is it?)
Desired State: 1 (Read Available)
ObjHandle : xxxxxxxxx (always Device#2 since the handle is assgined Dynamically)
Possible reason(s):
NI-CAN: 9Hex 0xBFF62041) The connection to the DeviceNet device timed out. The device is no longer resonding to message sent by NI-DNET.
Solutions: Increase the value of ExpPacketRate in Open Dnet IO; Use the NI-DNET Configurator to verify that device is operational.


Now I am trying followings hoping fix the problem:
change the PollMode from "automatic" back to "scanned" ExpPacketRate=30 for all 11 devices
change the Dnet_Read_Write rate from 20 ms to 50 ms. So do not try to read too fast(20ms) since "Automatic" PollMode may set the ExpPacketRate>20ms for slow device (analog temperature reading) while trying to read every 20ms.




0 Kudos
Message 3 of 6
(3,178 Views)
Hi vxco,

Could you tell us which VI it is that the error comes from? You can find this by using the highlight execution mode to see which NI-CAN VI gives the error.

I am currently looking into what might possibly be causing this. Please let me know how things went after making the changes.
Rasheel
0 Kudos
Message 4 of 6
(3,167 Views)
Hi Rasheel,

I have a Read_Write_Dnet.vi calling wait for state.vi. It is polling the 11 devices and  update the cache in MainProcess (timeout=20ms in the case structure of the state machine).
I already change the timeout from 20 to 50 ms and it never happened again so far (It only happened about once a week while the machine running 7/24).

And I am going to add some code in my ErrorHandler of the stateMachine: if that error happen again, log the info,erase the error and keep going without  dialog box.

Thanks a lot !



0 Kudos
Message 5 of 6
(3,156 Views)


vcxo wrote:

And I am going to add some code in my ErrorHandler of the stateMachine: if that error happen again, log the info,erase the error and keep going without  dialog box.



That is an excellent idea for any program you want to run continuously unattended.  Dialog boxes should never be used for unattended programs as they stop the program cold until a user interacts.
0 Kudos
Message 6 of 6
(3,144 Views)