LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

vxlapi CanFD inavlid canID error

Solved!
Go to solution

Hi,

 

Iam trying to make a CANFD communication, but I couldn't manage to transmit a CANFD message with the xl can transmit Ex function from the vxlapi.dll library. I attach an image of my full implementation, opening and closing the vector channel. I am using a VN1630A Ch3 (Can FD). 

 

Every time I run my program, I am getting xl_Invalid_CANId, I understand that there is a problem with my CanID, but I can't figure out why. I am following the structure suggested in the xl driver family document (xl_canTxEvent and xl_can_tx_msg) I attached the control with my structure. I am not sure why there is a problem with the CANID. I hope someone can help me to figure out my error.

 

Thanks in advance.

Regards,

Ana Navarro

0 Kudos
Message 1 of 6
(1,852 Views)

It would be easier to diagnose the problem if you include the values you are sending (like on the front panel, not a picture of the block diagram).

The vi and control you attached don't have the control values that you are using saved either.

 

From the type of error you describe, my guess is that either:

(A) The idRange is set to 'standard', but you are attempting to send an extended ID value.

or (B) You are attempting to send an extended ID but haven't ORed it with the XL_CAN_EXT_MSG_ID flag (0x80000000)

 

See XL Driver Library documentation 5.5.2 XL_CAN_TX_MSG

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 2 of 6
(1,819 Views)

Hi TroyK,

 

thanks so much for your help. I attach an image of my front panel with the values I am trying to transmit. I also attach an image with the CAN FD parameters that I am using. 

 

The Can ID I am using is 0x100, so I should not require an extended ID value. Do you see something out of place in my control structure? Maybe I am not passing the value of the CAN ID correctly to the function. 

 

Thanks again.

Regards,

Ana Navarro

Download All
0 Kudos
Message 3 of 6
(1,811 Views)
Solution
Accepted by AnaNavarro

I think maybe your method for passing data to the dll (xlCanTransmitEx function) is not passing data to the pXlCanTxEvt parameter in the correct order.  This makes the CAN-ID appear to be incorrect.

 

Maybe check out how it is being done in the example wrapper library here:

Vector XL Driver - LabVIEW wrappers

 

https://forums.ni.com/t5/Example-Code/Vector-XL-Driver-LabVIEW-wrappers/tac-p/4162922

 

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
Message 4 of 6
(1,802 Views)

Thanks for the link, I will check the contents in detail.

 

Regards,

Ana Navarro

0 Kudos
Message 5 of 6
(1,788 Views)

 

At the end the main issue was the version, I was using 3 instead of 4 (this one supports CAN FD) in my Open Port function. 

 

Thanks a lot for the help 

 

 

0 Kudos
Message 6 of 6
(1,682 Views)