LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication between Labview 2024 and Inclinometer with CAN Open messages

Hi i've the followwing issue:

 

I need to send/recive Can Open messages from Labview 2024 to Inclinometer board using Peak CAN usb adapter.

I tried downloading and using the Can Open NI libraries, but it seems that they are unable to communicate with the Peak (it gives me the error in the attachment when I try to open connection to the Peak,i think it's because Peak isn't configured in the NI MAX but I don't know how to configure it), instead through the CAN Basic libraries I can communicate with the Peak but it only sends simple CAN commands, not CAN Open.

How can i do?

0 Kudos
Message 1 of 6
(251 Views)

Hi Dok,

 


@Dok_99 wrote:

I tried downloading and using the Can Open NI libraries, but it seems that they are unable to communicate with the Peak (it gives me the error in the attachment when I try to open connection to the Peak,i think it's because Peak isn't configured in the NI MAX but I don't know how to configure it)


Yes, those old CANopen library wants to use NI CAN hardware (only)…

You cannot configure non-NI hardware with MAX, as MAX is dedicated to configure NI hardware.

There's no attachment with your message…

 


@Dok_99 wrote:

instead through the CAN Basic libraries I can communicate with the Peak but it only sends simple CAN commands, not CAN Open.

How can i do?


Which "CAN Basic" libraries are you talking about?

Peak offers its own API, that you can/should use with their hardware.

And CANopen also uses "simple" CAN messages, it "just" relies on using certain ArbIDs with a well-defined message content. So you could create your own CANopen driver by sending/receiving "simple" CAN messages…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(247 Views)

Which "CAN Basic" libraries are you talking about?

 

I have manually downloaded and inserted into Labview some libraries from the PEAK website (attached image)

Dok_99_1-1740652306325.png

 

that allow me to communicate with the CAN device, so are you telling me that I can also use these libraries to send CAN Open messages and not just CAN?

0 Kudos
Message 3 of 6
(245 Views)

Hi Dok,

 


@Dok_99 wrote:

Which "CAN Basic" libraries are you talking about?


So you are using the PCAN Basic API. (Please be as precise as possible…)

 


@Dok_99 wrote:

so are you telling me that I can also use these libraries to send CAN Open messages and not just CAN?


Well, in the end yes.

 

Examples:

  • to manage the CANopen network you use the NMT message, with an ArbID 0x000 and 2 bytes payload
  • SDO messages start at ArbID 0x600 (+ NodeID added)…

I don't say this will be easy (or even recommended), but it would be possible. I did that sometime ago in cRIO FPGA for a NI9853 CAN interface…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(236 Views)

Ok thanks for the answer, so if i have this template for sending the CAN Messages how can i compile those parameters in order to send CAN Open Messages?

Dok_99_0-1740655806566.png

 

0 Kudos
Message 5 of 6
(222 Views)

Hi Dok,

 


@Dok_99 wrote:

so if i have this template for sending the CAN Messages how can i compile those parameters in order to send CAN Open Messages?


You don't "compile parameters", you provide them.

I don't have PCAN hardware or software, so you need to look for this cluster definition on your own. (We cannot edit/debug/run images in LabVIEW!)

 

Again: that cluster (most probably) defines the CAN message, containing items for ArbID and Payload…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(218 Views)