LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LIN USB-8476s Timeout Issue

Hello All,

 

I have recently designed a VI (or more accurately, modified an existing VI which I stumbled upon in the NI forums) which takes as an input a LIN signal from an NI USB-8476s, converts a specific set of bytes to its corresponding decimal format, and outputs a scaled value of this number to an NI USB-6009.  This program typically works fairly well, however I have noticed that if I let it run long enough (and sometimes not even that long... < 1 minute at worst) it will yield the following error message:

 

Error - 1074388991 occured at NI-CAN Wait for State (ncWait.vi)

 

(I have attached a screengrab of the full error message, as well as the VI that I have been using)

 

I have increased the value of the numeric constant blocks which are routed into the timeout inputs of the ncwaitforstate.vi blocks in the block diagram, however I do not think this has done anything as the initial value of these blocks was 100, and there is no noticeable difference since changing them to 10,000.

 

Any assistance or advice would be greatly appreciated!

 

Thank you for your time,

 

Colin

Download All
0 Kudos
Message 1 of 11
(3,720 Views)

Hi Colin,

 

Welcome to the forums! Increasing the timeout but seeing no noticeable difference in the behavior is usually indicative (but not always) of something on the hardware side of the system. Are the USB-8476s and your device(s) using the same baud rate? Is there termination on the system (LIN cables do not require termination but the nodes are usually terminated at the transceiver which is software-selectable)? Are you applying power to the bus through Vbat? Are the grounds connected properly? Do you know if your device is sending the information within the time specified? You should also be able to view the activity on the bus by using the Bus Monitor Tool.

 

In addition, I recommend taking a look at the NI-CAN Hardware and Software Manual if you haven't already.

 

Hope this information helps!

 

Best Regards,

Matthew B.
Offering Manager
NI
0 Kudos
Message 2 of 11
(3,677 Views)

Hello Matthew,

 

Thank you for the advice... the circuitry is properly grounded (and powered) so we can rule that out immediately.  Regarding the baud rate, how do I determine (and modify) what my USB-6009 baud rate is?  I can easily specify the USB-8476s baud rate, so this may be an easy fix if I can set both values.

 

Thank you for your time,

 

Colin

0 Kudos
Message 3 of 11
(3,669 Views)

Hi Colin,

 

The USB-6009 does not really have a baud rate. It is set up in the DAQ Assistant to output 1 sample on demand, so the timing is controlled by the software. The baud rate is more important for the USB-8476s and the device it is communicating with - this must match on both ends. What is the device specifically? Have you also tried temporarily removing the DAQ Assistant to make sure that the DAQ Assistant is not affecting the behavior of your code?

 

In addition, what kind of cable are you using, what version of LabVIEW, and what version of the NI-CAN driver are you using? I talked with some colleagues regarding what you are observing and we think that the issue lies more so on the hardware side rather than the software side. Since the program is working fine for a period of time, it seems like something is borderline almost right but is not quite there.

 

Regards,

Matthew B.
Offering Manager
NI
0 Kudos
Message 4 of 11
(3,645 Views)

Matthew,

 

Thank you for the speedy response.  The USB-8476s is paired with a Bosch EBS (Electronic Battery Sensor).  Now that you mention it, the VI was error-ing out without the DAQ Assistant, so that must not be the issue.

 

I am using Labview 2013 (32-bit) with an NI-CAN 2.7.5 driver.  Unfortunately I am not certain of the cable used to interface the EBS with the USB-8476s.  If I understand correctly, would the sensor manufacturer (Bosch) have specified a recommended baud rate?

 

Regards,

 

Colin

 

 

0 Kudos
Message 5 of 11
(3,637 Views)

Hi Colin,

 

After some more research, I'm pretty sure that LIN slaves will automatically adjust their baud rate based on the sync bit in the LIN frame so I'm less certain that's the issue. Let's focus on the termination - are you using an NI cable or was it one that you found?

 

Regards,

Matthew B.
Offering Manager
NI
0 Kudos
Message 6 of 11
(3,615 Views)

Hello Matthew,

 

The cable currently in use to route the signal to the USB-8476s is a spare 3-wire, shielded cable.  The EBS (sensor/slave) has a 2-pin plug for the sensor signal and ground (see attachment), and in addition the power for the USB-8476s is taken from the positive and negative terminals of an automotive battery.  In order to couple the EBS (female side) connector with the USB-8476s, I had to splice and crimp the female side connector wire with the 3-wire, shielded cable.  I wouldn't think this would be an issue for supplying power, however the signal wire is also spliced and crimped.  Would soldering the wire provide a quick solution?  I am not sure how I would go about finding one continous cable that is compatible with both the EBS 2-pin plug and the DB-9 inport on the USB-8476s without splicing wires.

 

Thank you for your time,

 

Colin

0 Kudos
Message 7 of 11
(3,601 Views)

Hi Colin,

 

Do you have both grounds connected on the USB-8476s? From the manual, it looks like pins 3 & 6 are the grounds, while pin 7 is the LIN signal line, and pin 9 is Vbat. Your cable sounds like it doesn't have termination (which is how LIN cables are configured) because the cables are terminated at the transceiver. I think the way you wired it should be fine if they are wired to the correct pins; I can't think of a better way to create a cable myself based on the odd configuration!

 

Regards,

Matthew B.
Offering Manager
NI
0 Kudos
Message 8 of 11
(3,588 Views)

Hello Matthew,

 

I am a little bit confused by what you are referring to when you speak of the cable's "termination".  So the ground line which is responsible for supplying power to the USB-8476s cannot run on the same line as the EBS ground, and therefore there are two ground ports (pins 3 and 6) ?  I have attached a wiring diagram of the current sensor configuration to this message, hopefully this will clear things up and help us get to the root cause of the issue at hand.  Thank you for your time!

 

Regards,

 

Colin

0 Kudos
Message 9 of 11
(3,574 Views)

Hi Colin,

 

CAN cables use termination in order to ensure the signal is propagated correctly as it travels down the cable. Some CAN cables have termination resistors built into the cable or otherwise we sometimes have to manually add these resistors. For LIN communication, the cables should not be terminated but there should be termination at the transceiver. The way that I like to think about this termination is that it pulls the line to a known state when there isn't anything driving the bus (like a pull-down or pull-up resistor). The USB-8476s offers this termination as a software-selectable feature which you should enable.

 

It looks like your wiring diagram is correct except that I would also route the ground to pin 3. It also looks like you are using a shielded cable; if so and you have a wire connected to the shield, pin 5 is the optional LIN shield. I am getting this information from pages 4-24 to 4-26 of the NI-CAN Hardware and Software Manual.

 

Best Regards,

Matthew B.
Offering Manager
NI
0 Kudos
Message 10 of 11
(3,555 Views)