NI 9853 and 9852 with CompactRIO FAQPrimary Software: Driver Software>>NI-CANPrimary Software Version: 1.3 Primary Software Fixed Version: N/A Secondary Software: N/A Hardware: Industrial Communications>>CAN>>cRIO-9852, Industrial Communications>>CAN>>NI 9853
Problem: FAQ: NI 9853 and 9852 with CompactRIO Solution: Do the 985x modules work with CompactRIO? Yes. What format is the data read and written to/from the NI 985x module? The NI 985x FPGA I/O node returns data as either six U32s corresponding to the 192 bits of a CAN Frame, or as a cluster of elements representing the different parts of a CAN Frame such as identifier and timestamp. This can be chosen by right clicking the I/O node and selecting Properties. The same format is used when writting to the I/O node. The cluster format is shown in Figure 1, and the U32 format in Figure 2. Figure 1 Figure 2 A library also installs along with the NI-CAN driver that includes VI's that will automatically convert a CAN frame from an array of U32 values to a cluster or vice versa:
Can I use the 985x modules with the CAN Channel API? The 985x modules do not support the Channel API. It only supports the API shown above. Therefore, on the FPGA level, the Channel API is not available. However, on the Real Time controller level, you can convert received frames into channels and channels to transmission frames with the Frame Channel Conversion Library. More information can be found on this topic here, or in the related links section below. Frames and channels can also be converted with the NI-CAN driver installed on the CompactRIO, but this can be more cumbersome and NI-CAN does not support all cRIO targets (see below). NI-CAN uses CAN virtual ports to convert channels and frames. More information about NI-CAN Virtual Ports can be found here, or in the related links section below. Do I need a special driver to use the NI 985x with CompactRIO? No. The NI-RIO driver installs support for the NI 985x FPGA I/O nodes. However, you can also download the 985x driver separately here. Can I use the NI-CAN driver and VIs with NI 985x and CompactRIO? Yes, depending on your CompactRIO controller model number. The first CompactRIO controllers released (cRIO 9002, 9004) use the Pharlap operating system, which NI-CAN Supports. Once NI-CAN is installed on the development machine, it must also be installed onto the CompactRIO from Measurement and Automation Explorer (MAX). NI-CAN VIs will then be available on the palette when developing your CompactRIO Real Time VI. Subsequent cRIO controllers use the VxWorks operating system that NI-CAN does not support. However, if you are looking to convert frames to/from channels, this can be done without NI-CAN on a VxWorks controller with the Frame Channel Conversion Library. More information can be found on this topic here, or in the related links section below. Do I have to convert my data to and from Frames and Channels? No. In fact, all manipulation and processing of the data coming to/from a 985x module on the FPGA level must be done with the Frame API. This is lower level and allows bit by bit manipulation. If your application goal is to do all CAN processing on the FPGA, there is no need or way to use the Channel API. If there are not many different signals on the CAN network you are monitoring or controlling with the NI 985x, the overhead of creating a CAN Channel database and VI may not give the same return on investment as a CAN network with hundreds of signals. My NI 9853 CAN1 port is not working, what is going on? The CAN1 port on 9853 is designed to be used with a powered CAN bus. This is because the cRIO backplane does not supply enough power to the module for it to be internally powered like the CAN0 port is. You can use CAN1 by either using a powered CAN bus, or attaching an external power supply to the connector. More information can be found on this topic here, or in the related links section below. Note: The 9852 requires both ports be powered. How do the NI 985x timeouts work on the FPGA level? Can I set the timeouts? There are two timeouts involved. One is the input/output timeout, configured by the user in the 'Advanced' dialog box when right clicking the module and selecting Properties inside the LabVIEW project. Another is a fixed 4 second timeout in LV-FPGA waiting for a response from the CAN module. Can I test the NI 985x without connecting it to a CAN device? No. By design, CAN is not similar to serial where you can write or read from a connector with nothing attached. The NI 985x modules follow the CAN protocol, which means if you attempt to write or read from CAN0 or CAN1 without connecting them to another CAN device, you will experience a timeout. This timeout will occur on writes when you have filled the FPGA side frame buffer of 17 elements. So when you write the 18th frame to the disconnected CAN port, the FPGA side buffer is full and the IO node will time out. This buffer will fill because the module keeps trying to send the first frame out but fails. In CAN, a frame must be acknowledged for it to be successfully transmitted. If it is not successfully transmitted, the CAN controller will try and retransmit or throw an error. This is a feature of the CAN protocol and it used to make it more reliable. Is there a good way to test my NI 985x without having an available CAN network? Yes. Included in the NI Example finder is a loopback test. Inside LabVIEW select Help » Find Examples. Navigate to Hardware Input and Output » CAN » CompactRIO » Baisc » CAN Basic.lvproj. This project contains a simple FPGA VI that writes out CAN0 and reads in CAN1. Connect CAN0 to CAN1 to run the Loopback test. Bear in mind that CAN1 requires external power (see above). Additionally, included in the Frame Channel Conversion Library is a more complex loopback test that demonstrates the libraries use. You can find it in Library's examples directory under the appropriate operating system (Windows, Pharlap, VxWorks). Be sure to install the Frame Channel Conversion Library driver to the cRIO target as detailed in the manual, and to copy the .ncd file to the cRIO as detailed in the VI instructions. Can I make my own CAN cable? Yes. The NI 9853 manual, here, describes the requirements for a CAN cable on pages 12 and 13. Page 11 describes the required wire connections between CAN devices on a network. Be especially aware of the 95 to 140 Ohm required impedance of a CAN cable and the required 100-130 Ohm termination resistors. Some additional resources about proper CAN cable termination are available here, or in the related links section below. Why am I getting a deployment error when I try to run my Real-Time VI on my CompactRIO? You are likely using VIs on your Real-Time VI that have not been installed on the CompactRIO. This can be because you are using the NI-CAN VIs on a CompactRIO that does not have NI-CAN installed (see above). This can also be from using the Frame Channel Conversion Library VIs on a CompactRIO that does not have the Library's driver installed. You can install the driver on the CompactRIO by following the instructions in the corresponding manual. How can I change the baud rate of a port on my NI 985x CompactRIO CAN module from the default of 500 Kbps? A. To set the baud rate for a NI 985x module from the project complete the following steps:
Use a Bit timing FPGA I/O Property Node for the specified CAN port . To use this property, CAN communication must be stopped for the port, otherwise the property node will return an error. An example implementation is shown in Figure 3. Figure 3 Related Links: Frame Channel Conversion Library 1.0.3 KnowledgeBase 464FIDJL: How to use the NI-CAN Channel API with cRIO 985x C-Series Hardware? Drivers and Updates: NI 985x cRIO CAN Driver KnowledgeBase 48PEQBPS: NI-CAN Virtual Ports KnowledgeBase 47DMDPB8: How to Use 985x CAN C-Series Modules with a cRIO VxWorks Controller KnowledgeBase 3PBC3AUX: Why Doesn't the CAN1 Port Work on my NI-9853 cRIO CAN Module? Product Manuals: NI 9853 KnowledgeBase 3IABNOHS: Proper Termination for NI-CAN Hardware KnowledgeBase 0ZEF3MHR: How Can I Set Nonstandard Baud Rates in NI-CAN? Attachments:
Report Date: 01/08/2009 Last Updated: 08/24/2009 Document ID: 4T7CHPBP |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
