Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in Vehicle Network Toolbox and NI PCMCIA-CAN Series 2 card

Hi,

I'm having trouble when use Vehicle Network Toolbox with NI PCMCIA-CAN Series 2 card.

I used comand info = canHWInfo to check the CAN card, but it returned an error:

 

Error using can.ni.NICAN.checkStatus (line 118)
National Instruments NI-CAN encountered an error. The function
"ncGetHardwareInfo" returned the error code "-1074388687" indicating:

NI-CAN:  (Hex 0xBFF62131) The hardware-related attribute (such as transceiver
type) cannot be determined due to hardware limitations. Solution: Remove this
attribute from your list of Get calls.

 

I'm using:

Windows XP server pack 3 (32 bit)

Matlab 2012a

NI CAN driver 2.7.4 (lastest version)

What can I do to solve this problem?

Thank!

0 Kudos
Message 1 of 10
(5,276 Views)

Hi,

Are you sure Matlab's "Vehicle Network Toolbox" is compatible with NI's PCMCIA-CAN Series Card?

If it indeed supported, there should be a working version of NI-CAN driver documented in VNT's manual.

 

Also, the example code should be provided by Mathworks.

Without the example code, it would be a big hassle to make this scenario work.

 

Ting

0 Kudos
Message 2 of 10
(5,265 Views)

Hi Ting,

 

Thanks for your reply. I checked on the Mathwork's site, VNT supported for my card and they recommended that I should use the latest NI CAN driver.

When I searched this error code "-1074388687", I found a document of NI about CAN error, so I think this is the hardware problem. This document is in the attached file.

I hope you can spend some time for this problem.

 

Best regard,

 

Trung - Dung

0 Kudos
Message 3 of 10
(5,255 Views)

Hi,

According to the NI-CAN Software and Hardware Manual, you specified an attribute to return using "ncGetHardwareInfo".

AttrID.png

 

When you try to return an attribute that is not supported by your hardware, this error pops up to indicate you to change the returning attribute.

Please try to change the AttrId to a more "common" one such as the "NC_ATTR_NUM_PORTS (Number of Ports)".

You may avoid the error through this modification.

 

BR

 

Ting

0 Kudos
Message 4 of 10
(5,240 Views)

Hi Ting,

 

Sorry for reply you late, I was busy at my exam.

Thanks for your help, you are correct about the attribute. I tried to remove the AttrId in example code of MATLAB (NICAN.m) and avoided this error, but the MATLAB showed : "No CAN Devices Detected".

My hardware still working with LabVIEW 2012 and NI CAN driver 2.7.4.

 

Best regard,

 

Trung - Dung

0 Kudos
Message 5 of 10
(5,212 Views)
Hi,
It seems that the CAN device havn't been enumerated successfully. Could you post the code up here?

Ting
0 Kudos
Message 6 of 10
(5,196 Views)

Hi,

 

I've attached the MATLAB example code for NICAN.

The error pops up due to the function at line 57.

 

BR,

Trung - Dung

0 Kudos
Message 7 of 10
(5,181 Views)

Hi,

I don't have Matlab in my computer.

Please indicate the function or code that induces the error more specifically instead of "line 57".

Also, please attach the error message as an image here so that I can see the error as you.

 

BR

 

Ting

0 Kudos
Message 8 of 10
(5,178 Views)

Sorry Ting,

 

I will express my problem by images:

Figure 1: I install NI CAN driver and test the card with Measurement & Automation Explorer, the card works perfectly

Figure 2: I use MATLAB command to get the hardware info (without hardware plugs in my computer), MATLAB shows virtual CAN device

Figure 3: : I use MATLAB command to get the hardware info (with hardware plugs in my computer), the error pops up

Figure 4: After remove attrId example MATLAB code, MATLAB not show both hardware and virtual driver

Figure 5: example MATLAB code, the error pops up due to line 57

 

BR,

 

Trung - Dung

 

Figure 1.jpg

 

Figure 1

 

Figure 2.jpg

Figure 2

 

Figure 3.jpg

Figure 3

 

Figure 4.jpg

Figure 4

 

Figure 5.jpg

 

Figure 5

 

0 Kudos
Message 9 of 10
(5,166 Views)

Hi Dung,

 

I think you misunderstood what I meant in the previous post.

I don't think you can just "remove" or "comment" the AttrID input.

Check the LabVIEW function below and you'll realize what I said.

 

AttriID Required.png  

 

You have to specify the input, but what you specified should be "hardware supported".

There are so many kind of attribute ID that you can specify that already documented in the manual.

 

AttriID Required.png

 

If the AttrID you specified is not supported by your hardware, then an error will occur.

 

 

Ting

0 Kudos
Message 10 of 10
(5,150 Views)