Discussion:
Wait For State error
(too old to reply)
Lauren L
2008-01-21 23:10:05 UTC
Permalink
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 <a href="http://www.odva.org/" target="_blank">DeviceNet/ODVA Official Website </a>to find out more information about DeviceNet communication.&nbsp; Let me know where you stand on this.
&nbsp;
Regards,
Lauren
cj795
2008-01-21 23:40:06 UTC
Permalink
Hi Lauren,
Yes I am trying to disconnect and reconnect while the vi is running.&nbsp; I have NI-DNET version 1.6.1.&nbsp; I have tried using the NI-DNET Analyzer but I get this error message:
&nbsp;
NI-CAN: (Hex: 0xBFF62108) The NI-CAN and NI-DNET functions cannot be used simultaneoulsy on the same CAN card (even 2-port cards).&nbsp; Solution: Use 2 or more CAN cards, with NI-CAN on one card, and NI-DNET on the other.
&nbsp;
I have tried the examples in DeviceNet-Basic.llb (EasyIOMultipleDevices.vi, MixedCommunication.vi, and SingleDevice.vi)&nbsp;that come with NI-DNET and they exhibit the same failure.&nbsp; 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.
&nbsp;
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.
&nbsp;
Thanks,
Chris
cj795
2008-01-22 23:40:06 UTC
Permalink
Hi Lauren,
I received a PCMCIA DNET card today so I installed it and gave it a try.&nbsp; I could not get it to fail.&nbsp; I took the same slave board, same cabling, and same power supply to the station with the PXI card and it kept failing.&nbsp; Should I exchange my PXI card for a new one?
Thanks,
Chris
cj795
2008-01-23 16:10:09 UTC
Permalink
Hi Lauren,
I have a PXI-8461 installed in a PXI-1042 chassis.
I attached the code I am using for testing.&nbsp; All it does is connect, write data, read data, disconnect, and repeat.&nbsp; With the PCMCIA DNET card, it will loop continuously without error.&nbsp; With the PXI DNET card, it fails at the wait for state function (Read Avail).&nbsp; Sometimes it will work correctly on the first loop iteration, but fail on the next loop iteration.&nbsp; The only place I've seen it fail is at the wait for state function.
Thanks,
Chris


dnet_test.vi:
http://forums.ni.com/attachments/ni/30/3150/1/dnet_test.vi
frankwu
2008-08-12 19:40:07 UTC
Permalink
Hi Chris, Please update the code in the following way and try it again.Only wrap the while loop around Write DeviceNet IO, Wait for State, Read DeviceNet IO. Move the others out of the while loop.You need only initialize the interface card once. Open/close repeatedly is not recommended. It slows the test.The DeviceNet example SingleDevice shows the typical usage.Regards,Frank
cj795
2008-01-23 19:10:07 UTC
Permalink
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).&nbsp; If it happens to work correctly on the first iteration, it will go ahead and read correctly and disconnect without error.&nbsp; Then on the next loop iteration it will fail on the wait for state function.&nbsp; 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
vcxo
2008-07-08 01:40:05 UTC
Permalink
Chris,I have very similar problem.&nbsp; How&nbsp; did you resolve it&nbsp; and what is the root cause ?poll mode from automatic to scanned&nbsp; with several different expected packet rates&nbsp; (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 16Wait for state is 1 (Read Available)Obj Handle is 105120420 (the Device handler#)<img src="file:///C:/Documents%20and%20Settings/vli/Desktop/Wait%20For%20State.JPG" alt=""> <img src="file:///C:/DOCUME%7E1/vli/LOCALS%7E1/Temp/moz-screenshot.jpg" alt=""> <img src="file:///C:/DOCUME%7E1/vli/LOCALS%7E1/Temp/moz-screenshot-1.jpg" alt="">
cj795
2008-07-08 13:40:08 UTC
Permalink
The problem I was having was never resolved.&nbsp; I sent my device to NI, and their application engineers basically said that the NI-DNET card is not compatible with my device.&nbsp; So I chose to use a different card.
Loading...