Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-XNET Compatibility Layer for NI-CAN not working

I am using an XNET card with older NI-CAN software written in CVI. I cannot seem to get the ncConfig() to work. I keep getting an error message. I have installed the compatibality for XNET to NI-CAN so that shouldn't be an issue. Perhaps I have a setting wrong?

 

Capture1.JPG

 

Capture2.JPG

 

Capture3.JPG

 

And here is my code to init the CAN. Again, this is original code from using a standard NI-CAN PCI. 

 

/* NI-CAN Status */
NCTYPE_STATUS Status = 0;
NCTYPE_ATTRID AttrIdList[9];
NCTYPE_UINT32 AttrValueList[9];

sprintf (error_message, "");

AttrIdList[0] = NC_ATTR_BAUD_RATE;
AttrValueList[0] = Baudrate;
AttrIdList[1] = NC_ATTR_START_ON_OPEN;
AttrValueList[1] = NC_FALSE; //was TRUE
AttrIdList[2] = NC_ATTR_READ_Q_LEN;
AttrValueList[2] = 50;
AttrIdList[3] = NC_ATTR_WRITE_Q_LEN;
AttrValueList[3] = 0;
AttrIdList[4] = NC_ATTR_CAN_COMP_STD;
AttrValueList[4] = 0;
AttrIdList[5] = NC_ATTR_CAN_MASK_STD;
AttrValueList[5] = NC_CAN_MASK_STD_DONTCARE;
AttrIdList[6] = NC_ATTR_CAN_COMP_XTD;
AttrValueList[6] = 0;
AttrIdList[7] = NC_ATTR_CAN_MASK_XTD;
AttrValueList[7] = NC_CAN_MASK_XTD_DONTCARE;
AttrIdList[8] = NC_ATTR_NOTIFY_MULT_LEN;
AttrValueList[8] = NOTIFY_LEN;

Status = ncConfig(Interface, 9, AttrIdList, AttrValueList);

 

Status = -1074384895

 

Any thoughts?

 

Thanks in advance. 

 

 

 

 

 

 

0 Kudos
Message 1 of 2
(4,377 Views)

Hi,

 

Some features of NI-CAN are not compatible with XNET even with the compatibility library installed. Appendix F of the NI-CAN Hardware and Software Manual, specifically page F-10, details the unsupported features. It says that NC_ATTR_MASK_STD is not compatible with non-zero values so you should try changing that in your code.

 

 

0 Kudos
Message 2 of 2
(4,360 Views)