LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

incorrect TX CAN data

Solved!
Go to solution

Hi Sir/Madam,

 I am a rookie in Labview and hope that somebody can help to resolve my problems. I would like to create a labview program to send periodic CAN message with Arbitration ID 18FF6500 in every 100ms and I started my programming by modifying the sample codes from the help files. Enclosed is my VI and it does not send out the data as per the data input. 1) Can we use (ncConfigCanObj.vi) and (ncConfigCaNNet.vi) in the same VI? 2) From the NI sample code, Why the Arbitration ID need to AND with 1FFFFFFF before it enter the format to string? 3) What is wrong in my vi?

 Hope to hear from you.

 

 Regards,

Rookie.Alfred

0 Kudos
Message 1 of 3
(2,006 Views)
Solution
Accepted by topic author alfred.tan

The reason for the AND with 1FFFFFFF is that Arbitration IDs are either 11 (standard) or 29 (extended) bits.  In this case you're using a 29-bit identifier.  1FFFFFFF is a value with 1s in the low 29 bits, so the AND masks off any higher-order bits that would make the arbitration ID invalid.

 

Do you get any error messages that would help indicate why your VI isn't working?  If an error occurs, it should show up in a dialog box when you push the stop button.  Are you sure you have the name of your CAN device correct?  You can find, and set, the name in Measurement and Automation Explorer.  Which NI-CAN device are you using?

 

Your VI attempts to open an NI-CAN Object, but it uses the Network interface to write it.  You need to decide which you want to use.  If you do not need the Object interface, then you need to pass your CAN Interface name directly (no arbitration ID, etc) to ncOpen.  If you are going to use the Object interface, then you need to use ncWriteObj inside the while loop, instead of ncWriteNet.  Read the help for the differences between the Object and Net interfaces to NI-CAN.  Even better, if you're using a newer CAN device that supports XNET, consider using that instead.

0 Kudos
Message 2 of 3
(1,997 Views)

Hi,

 

I am using PXI-8484 CAN/XS series 2 which i guess it doesn't support XNET.

Btw, after I replace my nCwriteNET to Object it works fine now.

Thanks for the help.

 

Regards,

Alfred Tan

0 Kudos
Message 3 of 3
(1,991 Views)