Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

communication between a PCI CAN card and a PCMCIA CAN card

Hi johnshi!

NI CAN hardware cannot 'export' power to the CAN bus, so you need an external power supply for this (or get an internally powered PCMCIA CAN cable).

-B2k
0 Kudos
Message 11 of 15
(1,906 Views)
Hi johnshi,

Regarding connecting resistors to the circuit, it depends on the set up you are working with. The diagram for wiring resistors and an overview of when they are needed can be found in the CAN hardware and software manual (chapter 4 - connectors and cables) more specifically, the cable termination section.

Hope this helps,

Lilly
0 Kudos
Message 12 of 15
(1,900 Views)
Hi, B2k

Thanks very much. After I connect a power supplier to the bus as you adviced,
the problem is solved and the two cards communicate properly.
Thanks again

Johnshi
0 Kudos
Message 13 of 15
(2,258 Views)
Hi, B2k

I have no problem to send a waveform from PCMCIA CAN card and receive it at PCI CAN card, and vise versa.
However, when I start communication, I have to run the receiver first and then the sender. Also, I have to
stop the operation by stoping sender first and then receiver. Otherwise, I will get error code. Now, I would
like to sort this problem. For example, when one end intends to stop, it informs the other end to stop automatically. But I can't find any example for this kind of conversation ( send & receive mode). Can you give me any information or suggestion of this please?

Johnshi
0 Kudos
Message 14 of 15
(1,795 Views)
Hello Johnshi

It is the nature of CAN that you can only (successfully) transmit a frame, if there is someone listening. In fact, a CAN frame has a 2 bit wide acknowledge field (ACK), which the transmitter of the frame leaves recessive. Anyone that successfully (no bit faults) received the bit stream of that frame is supposed to overwrite the ACK field with dominant bits. As the transmitter of a frame also senses the bus, it will detect whether anyone else set the ACK or not. If not, the frame will be resend right away until someone sets the ACK.

The NI-CAN Channel API monitors this for a while and in case that no node acknowledges the frame, returns an error. However, this somewhat ‘forces’ a specific order for devices to activated. There is a way to turn the automatic retransmission off, but I wouldn't recommend it here:
Use the CAN Set Property (Single Shot Transmit) VI and set the value to ‘1’. However, this should only be used for debugging purposes (or niche applications) as it technically violates the CAN specification and might cause other undesired behavior in your CAN network (e.g. nodes that are asleep sometimes need the first transmission to wake up, but don't receive all bits and thus rely on the retransmission to receive the entire frame).

In your case, it might just be easier to define a special message that all nodes in your network interpret as an ‘end-of-session’- message. Any node that receives that message will seize all communication.

I modified one of the shippping examples for demonstration (see attached).

Regards,
-B2k
0 Kudos
Message 15 of 15
(1,763 Views)