Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

netObject start fails using ncAction

Hi,

using labview, I configure the networks (CAN0 and CAN1) as startOnOpen=false, comparators=xCFFFFFFF, masks=0, writeque=1, readque=0, baud=500000.
I then configure a number of objects (16 for CAN1, 32 for CAN0) for periodic Tx (up to 4 at 12ms, the rest at 100ms), data length=8, writeque=1, TxByResponse=false. After each object config, I open the object and cWrite the default data.
Next, I open a netObject for CAN0 and CAN1. I pass these handles as an array into a do-loop (at 250ms) w/ncAction sitting in a for-loop. Based on a switch, I set ncAction to Start or Stop the network interface.

This works the first time thru. When I trigger the start, the objects come blasting out (as seen on wraps into a second CAN card and
using the ni-can monitor). Shutting off the network works as well. When I try to restart the network, I get sparodic results. Sometimes, I can get a few messages out on one interface, most times I get nothing. If I stop the application (which closes all objects) and restart, it works as stated above.

I'm using ni-can 1.6 and labview 6.0.2 If interested, I can supply source.

Thanks.
0 Kudos
Message 1 of 2
(3,715 Views)
Hi,

To start the communication you need to re-write the data to the CAN objects. ncAction with STOP flushes the buffers of the CAN objects, so when you re-start them, the write buffers are empty. When you re-write the data the communication should start.

This is not explicitly mentioned in the user manual, so the situation you are describing certainly seems valid. The user manual should be made more clear on future releases of the NI-CAN driver.

DiegoF.
National Instruments.
0 Kudos
Message 2 of 2
(3,715 Views)