LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-CAN Self reception usage?

Solved!
Go to solution

Question, I have a CAN polling loop setup where I look for incoming frames by configuring the C-Attr VI for read entries pending? My quesiton is, I want to see the CAN frames I write out to the NI-CAN when the other CAN device responds back with a frame. I know this will work with using the Self Reception mode, but I'm not quite sure where to set it up using a property node. If I set it using the C-Attr node I can't use it for monitoring incoming frames anymore. Where would I configure the Self Reception setting before the write some where? I need the C-Atrr configured to monitor incoming frames so could someone please point me the right direction on the proper usage to have both the self reception and read entries pending setting configured in my polling loop so I can monitor outgoing frames as well?

 

Thanks....

0 Kudos
Message 1 of 8
(3,938 Views)

You will use it before you start your CAN device.


So between configure, open and start.

 

CAN setup.png

 

So in this picture I'm configuring the CAN with auto-start to false.

Then opening the port, setting the Self Reception and Timestamp format and then starting the CAN port.

0 Kudos
Message 2 of 8
(3,922 Views)

I'm not using the CAN start, I go from open right to the C-Attr with the Read Entries Pending? set and start polling from there like the NI examples. Do I need to use it before I start the CAN specifically. I did put if after the Open command prior to read entry check, but it didn't work. I guess I need to  post pone the start like your example, after the open and put in the Attr call with the self reception set, then start? Is this the right order? How come no one has documented this usage before, I would have never thought about doing that 😃

 

Thanks.

0 Kudos
Message 3 of 8
(3,920 Views)
Solution
Accepted by topic author QRP

If you read the help file you will see it described there:

 


Self Reception?

For CAN, this specifies whether to echo successfully transmitted CAN frames into the read queue of the CAN Network Interface and/or CAN Objects (Series 2 only). Each reception occurs just as if the frame were received from another CAN device.

 

For self reception to operate properly, another CAN device must receive and acknowledge each transmit. If a transmitted frame is not successfully acknowledged, it is not echoed into the read queue.

 

Communication must be stopped to set this attribute. Use Start On Open False with ncConfigCANNet.vi, set the attribute, then use ncAction.vi to start communication.

 

0 (FALSE) Disables Self Reception mode (default). Transmitted frames do not appear in read queues.

1 (TRUE) Enables Self Reception mode. Transmitted frames appear in read queues as if they were received from another CAN device.


I have underlinied the important text.

Message 4 of 8
(3,913 Views)

Thank you! How do I load the opcodes dropbox control for the CAction node? Normally I just copy from other examples, so I'm not sure how to load the setting dropdown for the Action node. Any ideas?

0 Kudos
Message 5 of 8
(3,910 Views)

Right-click on the terminal and select Create->Constant. That is the easiest way to do it. 

0 Kudos
Message 6 of 8
(3,907 Views)

That just creates a constant. I want something that has the Start,Stop,etc control. How do I get that?

0 Kudos
Message 7 of 8
(3,905 Views)

That is a constant, an Emun constant.
Or am I missing something, could you post a picture of what you think you what or something similar.

0 Kudos
Message 8 of 8
(3,897 Views)