Automotive and Embedded Networks

Showing results for 
Search instead for 
Did you mean: error behavior unpredictable



I want write multiframe data to the sensor and then read the sensor response. I am able to do the coding and the problem is code works sometimes and gives timeout error suddenly. I am not able troubleshoot this behavior of my code. The same code works fine sometimes and next time it gives timeout error in after the


please see the attached snapshot of my code (it's not possible for me to attach the vi)


Any help would be appreciated.





0 Kudos
Message 1 of 18

Hi Swap,


what kind of VI´s are these blue VI´s?


I found a Knowledge Base regarding this issue. Maybe it helps.


ncWaitForState Timeout Waiting for Write Success During Periodic Transfer




0 Kudos
Message 2 of 18

Hi Nina,


The blue VI's are NI-CAN VI's used to communicate with PCI CAN/2 Card.






0 Kudos
Message 3 of 18

If your hardware was made in the last 5 year I highly recommend using the XNet drivers over the series 2 CAN drivers known as NI-CAN.  There is tons more flexibility in controlling the ways data is read and wrote.  Also posting a VI or snippet is better than a picture.  I can't open a picture in LabVIEW.

0 Kudos
Message 4 of 18



The card is very old. Its PCI CAN series 2 card. I can't use XNET drivers with this card.

Not possible to upload vi because its part of a very big software and I am not allowed to that. 😞




0 Kudos
Message 5 of 18

if your error appears at / Write Success after the there could be the only possibility that your timeout of 50ms is not sufficient. On a high busloaded network (which baudrate do you use?) you may not be able to get the frame onto the network in time. Have you tried out to increase the timeout value? (what average busload do you see on the network? run the BusMonitor from MAX; which shows the detected busload in %)

from your first subvi I see that you may do kind of diagnostic protocol like UDS? If so, you may consider to use the Automotive Diagnostic Command Set


which implents UDS and KWP2000 for NI-CAN and NI-XNET. NI-CAN should be ok to run any protocol like UDS/ISO TP.

0 Kudos
Message 6 of 18



I tried with higher Timeout values but I have the same problem. I am using 250 Kbaud. The average bus load is around 22%.


Yes, I am using UDS over CAN for the diagnostics purposes. I have the Automotive Diagnostics Command Set but the problem is it supports

only LV version 10 and above. And the LV software is developed in LV 7.1, so I can't use it.

0 Kudos
Message 7 of 18

CAN cable is terminated sufficiently?

0 Kudos
Message 8 of 18



Yes, it is terminated properly. 😞

0 Kudos
Message 9 of 18

so you increased the write timeout to something = 1000ms? and the frame would never be transmitted?


how big is your transmit queue of the transmit object? is the queue empty before you call the write frame?


The state "Write Success" is set when the last frame in the write queue is transmitted successfully,

0 Kudos
Message 10 of 18