LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Tx data expecting no response, Error?

I am sending data over CAN to a unit using ncWrite

and I am sending a block of 250 byes, [to send about 1.3 meg total, in 250 byte block increments.]

2 bytes header and 6 bytes of data (41 times) = 246 bytes

then one more with 2 byte header and 4 bytes of data

the last one is the only message that has a response.

 

In one set up, that works in my code ALL the time.

the same exact version, both set ups using the NI PCI CAN device, with the save drivers versions, the same version of the Runtime engine,

but the second set up fails once in a while (last set of runs is was 13% of the time).

 

The only time I can determine if a failure has occures, is with the response to the last message (with the last 4 bytes).

The error is BFF62001 - basically no reponse.

So, my guess is that the module I am sending data to missed one or more messages, and is expecting more data, so it is not responding, because it has not received the full 250 bytes.

 

Is there any way I can determine anything to identify an error or missed message from the ncWrite.

 

I don't know if this would help, but here is the write command:

 

error = ncWrite(handle, sizeof(*CanFrame), CanFrame);

 

And, I read as much as I could find in the forums, and help, and added a wait:

 

error = ncWaitForState(handle, NC_ST_WRITE_SUCCESS, 250, &state);

 

but this does not seem to help.

I thought it would insure a wait after the write to insure the write was accepted or in some sort of positive state that would be better than not having the wait.

With and without the wait work on the fisrt set up. 

Both work about the same on the second set up, right now about 13% failure.

Oh, and when I run it a second time, the failed unit almost always passes.

 

Any ideas?

 

0 Kudos
Message 1 of 5
(3,518 Views)

Hi,

 

All the documentation for ncWrite is included in the NI-CAN Hardware and Software Manual starting on page 11-104.  

 

What card are you using?  Is the second setup on a second machine?  If so, have you tried switching the cards between computers?  Is the behavior the same?

 

Could you tell us what version of NI-CAN you're running?

Dave C.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,491 Views)

I am using 3 different set ups (actually) the two that exhibit the issue are located at a different location, and have as close a set up as I am using. They all have the PCI CAN card, and all have NI CAN drivers 2.7.4.

I have not tried switching CAN cards between computers.

 

0 Kudos
Message 3 of 5
(3,485 Views)

If it's reasonable, I'd recommend switching the cards.  That will tell us if it's a hardware or software issue.  

 

Additionally, we could run a MAX technical report for each machine. A comparison of the reports will tell us if there are any configuration differences between the 3 computers.  Click on the linked text for Information on generating a MAX technical report.

Dave C.

Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,475 Views)

I can't switch cards, because the 2 computers with this issue are located in Michigan and the 1 that does not is in Illinois. I can't switch the cards.

 

I will look at the MAX report thing, but I'm off on something else for a week. I will look at that next week sometime.

0 Kudos
Message 5 of 5
(3,473 Views)