Home
Controller Area Network - Rensselaer Polytechnic Institute
Contents
1. 4 Scales 54 Software gg IVI Drivers e Remote Systems And you can test the functionality of the DAQ card Test Panels NI DAQCard 6067E Dev1 Analog Input Analog Output Digital 1 0 Counter 1 0 Amplitude vs Samples Chart Auto scale chart Ire 10 5 10 value 10 EI Stop m Data Neignbornood V IET SSIU I LAtzSLEIILIUI I 4 M Devices and Interfaces E5 8 0f2 NI DAQmx Device Driver 44 Scales E 6 Software IVI Compliance Package 3 3 x 13 LabVIEW 8 5 1 LabVIEW Run Time 7 1 13 LabVIEW Run Time 8 0 1 T3 LabVIEW Run Time 8 2 1 13 LabVIEW Run Time 8 5 1 T3 LabVIEW Run Time 8 6 Q LabWindows CVI Run Time 8 1 1 e Measurement amp Automation Explorer 4 5 A Measurement Studio For v52005 AM Measurement Studio For 52008 32 NI LabVIEW SignalExpress 3 0 h NI spy 2 6 F NI CAN 2 6 1 EV NI DAQmx 8 8 NI PAL 2 3 YW ur ust 1 0 2 FAT NI VISA 4 4 P P enri You can also go to Software to check if the driver is correctly installed and you will see the following Once it is verified you can make the DAQ talking to the DAQ assist The following steps are followed 1 Open LabVIEW 2 Press Ctrl N to create a New VI 3 Then press CTRL E Window gt Show Block Diagram to bring the Block Diagram 4 Right click anywhere on the blank space and pick the first icon on the list and you will see the DAQ assist icon o o dx Functions Search D Expres
2. IVI Drivers ae Remote Systems Figure 7 Explorer Welcome Window Open CAN Demo Box ncd from its location which should be in the directory you copied the content of the CD in Select Add All Messages and Channels Click Load and then click Done Add Channels from a File to Current Configuration SET_BAR_GRAPH_MODE SET_BAUD_RATE SET_CDB_TRANSMIT SET FUNC GEN FREG Figure 8 Loading Channel Configuration e tshould load 13 message files into the explorer E SET BAR GRAPH MODE 0x761 CAN Demo Box ncd SET BALID RATE 0x765 CAN Demo Box ncd SET CDB TRANSMIT 0x760 CAN Demo Box ncd SET_FUNC_GEN_FREQ 0x767 CAN Demo Box ncd SET FUMC GEM OLITPLIT 0x766 CAN Demo Box ncd SET LCD CONTRAST 0x768 CAN Demo Box ncd SET_LCD_DISPLAY 0x769 CAN Demo Box ncd SET PERIODIC RATE 0x763 CAN Demo Box ncd STRIMG REQUEST TO 0x730 CAN Demo Box ncd STRING RESPONSE FR 0x740 CAN Demo Box ncd WAVEFORMO_SAWO_S 0x710 CAN Demo Box ncd WAVEFORM SAW F 0x720 CAN Demo Box ncd WAVEFORM DIGITAL 0x750 CAN Demo Box ncd Figure 9 Message Files Loaded Setting up Hardware e Connect the NI USB 8473 to you computer via the USB port In the demo box you are provided with a termination cable This cable will be used to connect the male DB9 terminal of the NI USB hardware to the male DB9 terminal of the demo box labeled CAN Connect a jumper wire between the Function Generator Gen terminal and the Analog In To CAN ChO terminal Na
3. 0x7 x W USB 8473s 44 Scales 6 Software xg IVI Drivers j a Remote Systems The device has passed the self test 20 Once we know that the DAQ card is working correctly We now can launch LabVIEW 8 5 at this stage if testing LabVIEW 8 6 DOES NOT work Click on Find Examples gt Search gt Enter keyword and write CAN then click on CAN Frame API Input DAQmx Input VI Browse Search Submit Double click an example to open it Information ERE dis 62 examples match your search criteria A Description nter Keywords This example demonstrate how to 3 CAN F API Input DA Input CAN EF e pada aoe CAN ee Keywords v CAN Frame API Input and DAQ Traditional Input vi gt AI on a DAQ board Both boards are CAN Frame API Input and DAQ Traditional Output vi A S SE 7S ed eer c any of the words v CAN Frame API Output DAQmx Input vi E oe This example requires an NI E Series CAN Frame API Output DAQmx Output vi 3 xs x M Series Multifunction I O MIO anes evice Double cick keywords CAN Frame API Output and DAQ Traditional Input vi S84 E Al CAN Frame API Output and DAQ Traditional Output vi E 528 If you are using PXI cards no i additional synchronization cabling is canonical CAN Object Read Queue receives time stamp on i ku l required ion SLEEP ade E W CAN you must connect a RTSI cable CAN Object Transmits Periodic on RTSI vi E a
4. Activex add I Include ni com examples e ni com query timeout Hardware No hardware chosen J Limit results to hardware 50 examples match your search criteria CAN Frame API Input DAOmx Input vi BSPRS gt CAN Frame API Input D Omx Output vi CAN Frame API Output DAQmx Input vi CAN Frame API Output DAOQmx Output vi CAN Object Read Queue receives time stamp on RTSI vi CAN Object Transmits Periodic on RTSI vi CAN Object Transmits Waveform on RTSI vi CAN Object controls RTSI on Periodic Transmit vi CAN Object controls RTSI on Unsolicited Receive vi CAN Object controls RTSI on Waveform Transmit vi CAN Object controls RTSI on ncAction vi CAN Receive Error Frames vi CAN Receive vi CAN Transmit periodic vi CAN Transmit multiple vi CAN Waveform Input and DAQmx Waveform Input vi CAN Waveform Input and DAQmx Waveform Output vi CAN Waveform Output and DAQmx Waveform Input vi CAN Waveform Output and DAQmx Waveform Output vi Channel Monitor vi SUUS SSH etats LZ 13 12l lIlfl gl 12131 329121212 121232 V iM uu uuu Figure 20 NI Example Finder 4 Description This example demonstrate how to synchronize input CAN messages from one Port and an Analog Input AI on a DAQ board Both boards are using the DAQ Start Trigger and share the DAQ Timebase This example requires an MI E Series or M Series Multifunction I O MIO device If you are using PXI cards no additiona
5. Devi ao ANA DAQ channels 2 Dev1 ai0 3 5 3 CAN interface Sample Rate 25 r v fcano 100 00 D 2 E TE RTSI terminal number of values to read E 7 ARTs A 100 miza Baudrate 0 125000 0 5 1 i j 1 53 25 865 PM 1 53 25 964 PM STOP TimeStamp ID Frame Type Bytes Data If you can t see the picture above the following are the possible causes that we have encountered 21 1 The LabVIEW version should be the latest available 2 The correct wiring between CAN USB and Demo box 3 The DAQ card should be inserted and working properly When we go back to our LabVIEW we only need to click RUN or CLT R we can see that LabVIEW is reading data from the devices We also noted the different times frames that the data was acquired File Edit View Project Operate Tools Window Help gt uj See VI Info lt Ctrl I gt for more information on how to use this example DAQ Waveform Input Devijail MESE l DAQ channels k Devi ai aa CAN interface Sample Rate wo zl fs 000 00 m BI n Hg RTSI terminal number of values to read A A J JRTsI0 J jl 100 Baudrate 125000 I 10 20 30 685 AM 10 20 30 784 4 Time STOP TimeStamp ID Frame Type Bytes Data You can click on Window gt Show Block Diagram or CLT E to see how the device works 22 Open and configure the CAN Net
6. Output DAQmx Input vi fa ae e lids frames via the Network f CAN nterface CAN Frame API Output DAQmx Output vi select the CAN Network Interface CAN Object Read Queue receives time stamp on i e CANO CANI etc RTSI vi select the Baud Rate run the VI CAN Object Transmits Periodic on RTSI vi mm select the TimeStamp mode CAN Object Transmits Waveform on RTSI vi CAN Object controls RTSI on Periodic Transmit vi CAN Object controls RTSI on Unsolicited Receive vi _ CAN Object controls RTSI on Waveform Transmit vi E CAN Object controls RTSI on ncAction vi Ah H e an CAM Receive vi CAN Transmit periodic vi CAN Transmit multiple vi The following devices can run this CAN Waveform Input and DAQmx Waveform Input vi I example CAN Waveform Input and DAQmx Waveform NI CAM Interfaces Series 2 Output vi PCI CAN Series 2 CAN Waveform Output and DAQmx Waveform pi PCI CAN 2 Series 2 _Input vi PCI CAN LS Series 2 CAN Waveform Output and DAQmx Waveform PCI CANILS2 Series 2 PE mens vi PCLCANISW Series 2 PCI CAN SW2 Series 2 Create Logfile from Channels vi e nn n LI Figure 14 NI Example Finder This will open the CAN Receive vi make sure you select CANO in the interface window and change the Baudrate to 500000 before hitting run the right pointing arrow CAN Receive vi Fr
7. to simulate different I O signals with the DAQ card To connect correctly with the pins we can look at the reference table below Als Al 1 AI GND AI 10 AI 3 AI GND AI 4 AI GND AI 13 AI 6 AI GND Al 15 AOO AO 1 AO EXT REF PO 4 D GND PFI O Al START TRIG PFI 1 Al REF TRIG D GND 45M D GND PFI 5 AO SAMP CLK PFI 6 AO START TRIG D GND PFI S CTR 0 GATE CTR 0 OUT FREQ OUT Oo m Oo 7 Ne n o j l szsbz sssssssrosNs S ea j 8 8 s 8 8 5 2 8 8 8 5 5 8 8 8 2 8 8 2 8 8 2 8 3 8 2 9 2 2 2 8 2 2 EXT STROBE D GND PFI 2 Al CONV CLK PFI 3 CTR 1 SRC PFI 4 CTR 1 GATE CTR 1 OUT D GND PFI 7 Al SAMP CLK PFI 8 CTR 0 SRC D GND D GND CB 68LP cn 1 p f a AU J pm 1 a a CT gt nao nn LJ S p ES es P m P P i I m TORRY a Bs L7 ce hao I The important pins that are needed to make this terminal connector and the DAQ card work are indicated and you can use the Test Panel to simulate the signals with different input numbers 18 E NI DAQCard 6062E Dev1 Measurement amp Automation Explorer File Edit view Tools Help Configuration Properties gt lt e Esel Test SB Test Panels e My System xl Data Neighborhood Name Value c SN Devices and Interfaces Serial Number Ox10B3AFO gal NI DAQmx Devices I O Port Range xFF80 OxFF9F YBNI DAQCard 6062E Dev1 Bus Number 0x0 aj PXI PXI
8. two VIs that were developed to assist in the process of writing and debugging C code on the C8051F040 EVB Use any of the previous VIs as well as two new ones CAN sender MPS vi and CAN viewer MPS vi These are stripped down versions that have been simplified to be easier to use Before going back to the lab to continue the procedure some of the functions may be checked out here to verify the correct operation of the RC car and its response to commands The following table summarizes the CAN IDs to which the car will respond RC Car Functions Function Arbitration ID Data Data length Headlights 0x01 1 Byte 0 0 Off 1 On Left turn signal 0x02 1 Byte 0 0 Off 1 On Right turn signal 0x03 1 Byte 0 0 Off 1 On Horn 0x04 1 Byte 0 0 Off 1 On Drive Motor DAC 0x05 2 Byte 1 Byte 0 12 bit value 0 4095 0 OxFFF Steering Servo PWM 0x06 2 Byte 1 Byte 0 16 bit value 850 2150 Windshield wiper 0x20 1 Byte 0 0 Off 1 On RC Car Status Replies Function Arbitration ID Data Data length Motor Temperature 0x07 2 Byte 1 Byte 0 12 bit value 0 4095 0 OxFFF Wheel RPM 0x08 2 Byte 1 Byte 0 12 bit value 0 1400 0 0x578 Motor Current 0x09 2 Byte 1 Byte 0 12 bit value 0 4095 0 0xFFF Left Turn Signal Status 0x0A 1 Byte 0 0 Off OxFF On Right Turn Signal Status 0x0B 1 Byte 0 0 0ff OxFF On Works Cited National Instruments 2006 October NI CAN Hardware and Sof
9. 0 180 190 200 Time AutoScale Y Axis Graph a Display Type Configuration Triggering Advanced Timing Channel Settings X Detais gt gt Voltage Input Setup voltage Settings 4 Calibration L Z 1 Signal Input Range Scaled Units Max volts v Min 5 E l Terminal Configuration Glick the Add Channels button Ditrerentia to add more channels fo Custom Scaling the task lt No Scale gt v amp v IAM Timing Settings Hide Help Back El Bi Measuring Voltage Most measurement devices are designed for measuring or reading voltage Two common voltage measurements are DC and AC DC voltages are useful for measuring phenomena that change slovdy vith time such as temperature pressure or strain AC voltages on the other hand are waveforms that constantly increase decrease and reverse polarity Most powerlines deliver AC voltage Context Help This vindow displays context sensitive help Move the cursor over a control or indicator for more information about it Click on Finished once you are done And you will see another window of the kind of tool you have selected In my case have chose Acquire Signals gt Analog Input gt Voltage gt aiO to get the following windows 17 CB 68LP To investigate further the useful feature of the DAQ card we can use an Unshielded Screw Terminal Blocks CB 68LP that has 68 pins
10. LabVIEW and it will open a window labeled Getting Started Click on Find Examples ici File Operate Tools Help rw a LabVIEW 8 5 Licensed For Professional Version New To Lab IEW H Blank VI nw Empty Project M vI from Template O More Getting Started with LabVIEW LabVIEW Fundamentals Guide to LabVIEW Documentation LabVIEW Help Upgrading LabVIEW LabVIEW Project Enhancements i Transceiver Mode vi Network Interface Wait vi Merging VIs CAN Transmit event based vi Conditional Terminals in For Loops m CAN Receive vi List of All New Features Waveform Input vi aan Wieauwcos mi CAN Waveform Input and DAQmx Waveform Discuedon Porte m CAN Waveform Output and DAQmx Wavefor i Training Courses w Channel Monitor vi wj CAN Transmit multiple vi LabVIEW Zone mE Grab and Attributes Setup vi Examples O Browse Q Find Examples Figure 19 LabVIEW Welcome Window Use latest version available e t wil open another window NI Example Finder in which there is a search field on the top left corner Search for CAN Double click the search results in the field below Select CAN Transmit event based vi from the list given in the center 10 NI Example Finder Keywords Search for fany of the words Double click keyword s 4 weighting aborting AC acceleration accelerometer Access Ackermann acoustics acquiring acquisition actions active
11. RENSSELAER POLYTECHNIC INSTITUTE ECSE 4790 MICROPROCESSOR SYSTEMS MPS Controller Area Network National Instruments Manual LabVIEW Team Albert Barsa Carlos Cao Cao Paul Kwoni Update version Manual for ECSE 4790 MPS Course lab experiment dealing specifically with the National Instruments USB CAN Hardware CAN USB The demo box provided by Lesley Yu helped us greatly understand the functionality and limitation of the NI USB 8473 Hardware The CAN USB does not support Channel API because USB devices lack this function This manual will also detail other topics using the National Instrument s NI equipment It will start off by covering the CAN USB it will then cover the DAQ card and finally will cover CAN to DAQ data synchronization Hardware Required Figure 1 Termination Cable Figure 2 NI CAN USB 8473 Wr NATIONAL DO INSTRUMENTS CAN Den Figure 3 NI CAN Demo Box Procedure Installing LabVIEW Software e LabVIEW is already installed on the lab desktops however you ll need it on your laptop to be able to run the example VIs for this demonstration on your laptop This takes quite a bit of time if you are going to install the latest version So far NI HWS NI IMAQ NI IMAQdx NI IMAQ for IEEE 1394 NI IMAQ IO NI Motion and NI RIO are not required to be installed Download the latest version of LabVIEW from RPI Instructions on how to get a license and download are on the help desk site 2 e Follow the
12. System Unidentified EZ IRQ Level 0x7 44 Scales o4 Software x qu IVI Drivers e Remote Systems TOPIC CAN DEMO BOX USB 8473s and DAQ CARD SYNCHRONIZATION Before we start In order to accomplish the goal of this guide we need the following equipments CAN demo box NI USB 8473s DAQCard 6062E and cables that allowing connection between computer CAN demo box and NI USB 8473s Special setup on NI USB 8473s To make this device to work we need to put some wires between the demo box and itself The wires configuration is followed USB CAN CAN Demo Box CLK lt gt F0 TRIG __________ T1 GND GND NATIONAL INSTRUMENTS 19 77 NATIONAL di ha INSTRUMENTS A CAN Demo Box ON n ni com can om L Analogin Ahalogin DAQ Trigger To DAG To CAN A 7 7 FO Cho Chi Cho C GND Gen NW a Measurement amp Automation Next we go to to test if the DAQ card is fuctioning correcting This is important because sometimes the computer does not recognize the DAQ card and cause problems to happen Properties XX lt j Self Test EB Test Panels Configuration e My System Data Neighborhood Name Value c 4g Devices and Interfaces Serial Number x10EB271 ga MI DAQmx Devices EZ 1 0 Port Range OxFF80 OxFF9F ifl NI DAQCard 6062E Devt Bus Number 0x0 PXI PXI System Unidentified IRQ Level
13. e between the CAN and MIO cards If CAN Object Transmits Waveform on RTSI vi E oo you are using PCMCIA cards you CAN Object controls RTSI on Periodic Transmit vi es mi m the signals of the CAN B L card s Sync cable into your DAQcard CAN Object controls RTSI on Unsolicited Receive vi ss mi terminal block If you are using USB CAN Object controls RTSI on Waveform Transmit vi 5M mi CAN you must connect from the hd CAN Object controls RTSI on ncAction vi E du Biscuits CAN Receive Error Frames vi gt Con al y The Following devices can run this lt A CAN Receive vi est a example 3 v CAN Transmit event based vi E a MI CAN Interfaces Series 2 CAN Transmit periodic vi E oy PCI CAN 5eries 2 CAH PCI CANJ2 Series 2 Include ni com examples CAN Transmit multiple vi P 3 T wl CAH PCI CANILS Series 2 i CAN Waveform Input and DAC Traditional Input vi ss dy 4 nicom query timeout wai CAN PCI CANILS2 Series 2 CAN Waveform Input and DAQ Traditional Output vi E gt dy PCI CANISW Series 2 Hardware CAN Waveform Input and DAQmx Waveform Input vi i dg PCI CANISW Series 2 a Find hardware v CAN Waveform Input and DAQmx Waveform I du v 2i lt gt And you will see the following without any problems File Edit View Project Operate Tools Window Help i bm esters eri 65 En See VI Info Ctrl I for more information on how to use this example DAQ Waveform Input
14. install instruction on the RPI web page Installing NI CAN Software e The examples that you need have to be installed separately for NI CAN 2 7 3 that comes with NI USB 8473 It contains specific examples that utilize CAN It also installs the drivers that are required to enable the NI USB modules to properly communicate with your computer Install NI CAN 2 7 3 from http joule ni com nidu cds view p id 2646 lang en e When prompted for a LabVIEW Version choose LabVIEW 2011 unless you have an older version Install all subfeatures e You can disable Visual Basic Visual C Borland C support It is not needed for the CAN viewer NI CAN 2 7 3 elect the features to install SJ NATIONAL j INSTRUMENTS J x NI CAN 2 7 3 Files used to create NI CAN applications using Microsoft Visual Basic Ky This feature will not be installed i e NI O Trace 30 E89 vj NI System Configuration 5 0 0 H E v NI Measurement amp Automation Explorer 5 0 Directory for Microsoft Visual Basic Support CUsers Public Documents National Instruments NI CANNExamples MS Visual Basic RetrefesueDeaus DskCo lt lt Back Neto Ced Figure 4 NI CAN 2 7 3 Examples You are done with the LabVIEW install and may open any CAN VI that you wish to use Installing Measurement amp Automation Explorer Software e The hardware demo comes with another disk labeled NI CAN Demo Box that has a user manual and a couple of files on it Yo
15. ist you in selecting these values CAN Demo Box Functions Changes may be observed directly for most items if the display is already showing the affected menu item Function Arbitration ID Data Data decimal val bytes ChO Data out amp Switches 0x710 3 2 bytes of analog data Read only 1808 3rd byte XX 53 S2 S1 S0 XX Ch1 Data out 0x720 3 2 bytes of analog data Read only 1824 3rd byte 0x00 StringRequest 0x730 0 Ignored but make sure RTR is not set 1840 ignored Box replies with next message StringResponse 0x740 6 6 byte string with ASCII NI CAN codes Read only 1856 reply to StringRequest command TransmitType 0x760 1 0 Disable all 1888 1 Waveform0 Sawtooth0 Switches only 2 Waveform1 Sawtooth1 only 3 Enable all DelayMultiplier 0x763 2 Delay between analog samples 1891 DelayMultiplier x 200 ns Range 0 65535 Default 50 000 10ms BaudRateType 0x765 1 2 125 Kbps Can change but can t change 1893 3 250 Kbps back without using Box menu 4 500 Kbps buttons 5 1 Mbps 12 FunctionGeneratorOutput 0x766 1 0 Sine 1894 1 Square 2 Triangle FunctionGeneratorFrequency 0x767 1 0 to 9 0 1 to 1 Hz in 0 1 Hz increments 1895 9 to 18 1 to 10 Hz in 1 Hz increments 18 to 117 10 Hz to 1 kHz in 10 Hz incr LCDContrast 0x768 1 0 Decrease contrast 1896 1 Increase contrast LCDMenu 0x769 1 0 CAN baud rate Displays selected menu on 1897 1 CAN transmit status Demo Box LCD pa
16. l synchronization cabling is required If you are using PCI cards you must connect a RTSI cable between the CAN and MIO cards IF you are using PCMCIA cards you must connect the signals of the CAN card s Sync cable into your DAQcard terminal block IF you are using USB CAN you must connect from the USB w The Following devices can run this FS example MI CAN Interfaces Series 2 PCI CAN Series 2 PCI CANJ2 Series 2 PCI CANILS Series 2 PCI CANILS2 Series 2 PCI CANISW Series 2 PCI CAN SW2 Series 2 Add to Favorites Setup Help Close e This will open the CAN Transmit event based vi with its default input values gt CAN Transmit event based yvi Front Panel B Figure 21 CAN Transmit event based vi e This step is the most important and it needs to be followed carefully The interface needs to be changed to CANO the Baudrate must be 500000 or you will not be able to communicate with the CAN bus on the car at all 11 CAN Transmit event based vi Front Panel A BARRE OR HERES TCR EE VETTER Mete EMEN EET Es Edit JIENA Project Qperat ools Mi Ne fa CUR view FUP D 2 Figure 22 CAN Transmit event based vi with interface and Baudrate changed e After changing the values of interface and Baudrate you need to change the data length and Arbitration Id The changes in these two values depend on which feature you want to control The following table will ass
17. nel 2 CAN DAQ 3 Function generator output 4 Function generator frequency 5 LCD contrast 6 clear screen 7 High Speed CAN message It is highly recommended that you start off with the simplest feature to control It would be recommended that you try changing the displayed function generator frequency at Id 0x767 As an example to send a single data byte byte value of 1 to a device whose Arbitration ID is 0x30 the setting would be CAN Transmit event based vi Front Panel Di cavo x C 30 FUP VPUNVPITUPVTUIPUPPVPU TUI VPURVTUPPIVPVP VPINPI PUPPI PPP AKAAKA KAKAA KAAK KAKAK KRKK AKAA KAAARAKAAKAAA AKAAKA AKAA Figure 23 Changing Arbitration Id and Data Length New Arbitration Id should be 04 The Data has 8 inputs but when you set the Data length to be 1 it will take only the first input and ignore the rest Now you can click the button with the white arrow on it that will make the VI run The device at 0x30 can be activated when you set the first input to 1 and click Write To turn it off you need to change the input to 0 and click Write once more 13 gt CAN Transmit event based vi Front Panel File Edit wiew Project Operate Tools Window Help interface CANO Baudrate Y J A500000 val Arbitration Id f T0 Figure 24 Running VI and Changing Data input New Arbitration Id should be 04 Getting the DAQ card talking to DAQ assist This section can only be completed if a DAQCard 6062E i
18. ont Panel to fae Timestamp ID jFrameType jBytes Data 11 50 23 254 00000710 CAN DataFrame 3 SF2AO3 11 50 23 244 00000710 CAN DataFrame 3 682203 1 11 50 23 234 00000710 CAN Data Frame 3 701A03 11 50 23 224 00000710 CAN Data Frame 3 761203 11 50 23 22 00000720 CAN Data Frame 3 786E02 11 50 23 214 00000710 CAN Data Frame 3 800A08 11 50 23 04 00000710 CAN Data Frame 3 890209 11 50 23 194 00000710 CANDataFrame 3 SFFAU2 11 50 23 164 00000710 CAN Data Frame 3 97F202 11 50 23 174 00000710 CAN Data Frame 3 SCEAG2 11 50 23 172 00000720 CAN Data Frame 3 9E8202 Figure 15 CAN Receive vi Example Sending a Frame to the CAN bus with LabVIEW Hardware Required Procedure Hardware Connections The connection between the NI USB 8473 and CAN bus requires a termination cable It is an essential component to getting the data from the CAN bus to your PC The termination cable will act as a male male converter between the NI USB 8473 and CAN bus DB9 terminals The NI USB 8473 will connect to your PC through the USB port 9 e You will connect the male DB9 terminal of your NI USB 8473 to one of the female terminals on your termination cable e The other female terminal of the termination cable will be connected to the male DB9 terminal of the CAN bus LabVIEW e Start
19. rt LabVIEW and it will open a window labeled Getting Started Click on Getting Started File Operate Tools Help weaver E Licensed For Professional Version wi Blank VI cn Empty Project 3 VI from Template C3 More mE Transceiver Mode vi we Network Interface Wait vi wi CAN Transmit event based vi m CAN Receive vi mi Waveform Input vi CAN Waveform Input and DAQmx Waveform m CAN Waveform Output and DAQmx Wavefor we Channel Monitor vi wi CAN Transmit multiple vi wi Grab and Attributes Setup vi gt Browse New To LabVIEW Getting Started with LabVIEW LabVIEW Fundamentals Guide to LabVIEW Documentation LabVIEW Help Upgrading LabVIEW LabVIEW Project Enhancements Merging Is Conditional Terminals in For Loops List of All New Features Web Resources Discussion Forums Training Courses LabVIEW Zone QM Find Examples Figure 13 LabVIEW Welcome Window t will open another window NI Example Finder in which there is a search field on the top left corner Search for CAN Double click the search results in the field below Select CAN Receive vi from the list given in the center ey Double click this canonic LI ld No hardware chosen v Demonstrates how to receive CAN frames via the Network Interface patent Description CAN Frame API Input DAQmx Input vi CAN Frame API Input DAQmx Output vi CAN Frame API
20. s available otherwise it should be skipped This part of the procedure requires the use of Frame API for the CAN interface rather than Channel API So far only Channel API has been implemented The USB 8473 converters do not support Frame API Continue with Using LabVIEW With the CAN Demo Box and Analog Signals on page 23 In order for the computer to recognize the DAQ card we need to insert the DAQ card first and install the driver for it At this time of installation am using LabVIEW 8 5 1 to talk to the DAQ card The driver version that worked well talking to LabVIEW 8 5 1 was NI DAQmx 8 8 which can be downloaded from http ftp ni com support softlib multifunction daq nidaqmx 8 8 nidaq880f2 downloader exe Use the defaults setting to install this driver Once the driver is finished installing you can check by Measurement amp Automation NI MAX icon click on Devices and Interfaces gt Ni DAQmx Devices NI DAQCard 6062E Dev1 and choose Test Panels at the upper corner clicking E NI DAQCard 6062E Dev1 Measurement amp Automation Explorer File Edit view Tools Help Configuration S Properties gt lt lt j Self Test ER Test Panels Y e My System x gl Data Neighborhood Name value BN Devices and Interfaces Serial Number Ox 10B34F0 ga MI DAQmx Devices I O Port Range OxFF80 OxFF9F un NI DAQCard 6062E Devi Bus Number 0x0 PXI PXI System Unidentified IRQ Level Ox
21. s b D B Lex f uut E umbet a a s P m tim Instr Assist Instr Drivers Sim Arb Sig Acquire Sound u N E Read Meas File Prompt User File Dialog Initialize the CAN Channel List Configure the AI Channel List Sync Mode is Input and Sample Rate task must be greater than zero conn 5 Choose DAQ Assist and you need to place the DAQ Assist and will see an Initializing dialog 16 6 7 8 Finally you will have the following Create New Express Task NI DAQ DAQ Assistant Select the measurement type for the task fH Generate Signals A task is a collection of one or more virtual channels with timing triggering and other properties To have multiple measurement types within a single task you must first create the task with one measurement type After you create the task click the Add Channels button to add a new measurement type to the task NATIONAL INSTRUMENTS Cancel Then you select either Acquire Signals or Generate Signals to choose the tool you need like Voltage temperature Resistance etc G4 Run Add Channels Remove Channels i Express Task Connection Diagram 1 800m 600m 400m 200m Amplitude e Li 2 m 400m 600m 800m oil A L LU I Lu L Lu I 1 1 Lu Lu L I I Lu 1 10 20 30 40 50 60 70 380 290 100 110 120 130 140 150 160 17
22. tional Instruments 2006 Connect a second jumper wire between the Function Generator Gen terminal and the Analog In To CAN Ch1 terminal National Instruments 2006 nicom cen In in Function DAQ Trigger Em To Generator Menu Select Lc CAN Demo Box el a d z ooo T1 T2 Fo Cho Chi Figure 10 Wiring National Instruments 2006 Connect the DC power supply to the box At power up the box will begin transmitting the WAVEFORMO SAWO SWITCHES FROM CDB and WAVEFORM1 SAW1 FROM CDB messages at the NI CAN default baud rate of 125 K National Instruments 2006 This is what your final setup should look like Figure 11 Properly Connected Hardware E You can verify that the CAN messages are being transmitted by running the Bus Monitor in the Measurement amp Automation Explorer MAX To run the Bus Monitor right click the port connected to the Port connector on the NI CAN Demo Box and select Bus Monitor National Instruments 2006 NI CAN BusMonitor MAX Port Settings Update Rate Busload Interface CANO Baud Rate IK 25 000 kB aud fi 000 v ms o tota ArbID Length Data Time Stamp Rate 3 DF DA 01 36 2031 0x720 3 D1 1E 02 96 1609 0x710 b x Help 6 000e 004 1 299e 002 9606 4 814e 002 5 184e 002 1922 Options Bus Statistics Error Details Listen Only Stop Reset E EN E Close Figure 12 Bus Monitor LabVIEW e Sta
23. tware Manual https forum ecse rpi edu index php topic 7056 0 24
24. u need to copy the content of this disk to the National Instruments folder that is located at C Program Files National Instruments DVD CD RW Drive D NI CAN Demo Box Computer DVD CD RW Drive D NI CAN Demo Box File Edit View Tools Help Organize v 5 Views v Burn to disc m Name Size Type Date modified Loc Favorite Links Files Currently on the Disc 4 E Documents E Pictures R Music More Readme Folders v a Copy these files to you NI Dircetory RE Desktop Ummad di Public jE Computer amp Local Disk C h DVD CD RW Drive D T Figure 5 NI CAN Demo Box CD After you are done copying you need open Measurement amp Automation Explorer that can be found either on your Desktop or in program files under the National Instruments folder N a Measurement amp Automation Figure 6 NI MAX Measurement amp Automation Explorer Icon Once it loads expand the Data Neighborhood by selecting the sign on its left side Left click on CAN Channels Select Load Channel Configuration CAN Channels Measurement amp Automation Explorer File Edit View Tools Help Configuration Create Message amp Save Channel Configuration amp Load Channel Configuration MessageName Arb ID Database Name ta Neighborhood CAM Channels S FieldPoint Items untitled WB Devices and Interfaces 44 Scales 6 Software
25. work Interface AN interface RTSI terminal U321 Label 4 OK message Y vier e g T pe T DA v mE ETAF am T o ANE rex RT W FRAME Baud Rate IL Initialize array For input contest H m E B r ie LETS ient umber of values to read 1329 ample Rate T itte Tg fag SU mm pror x DAQmx JAC mx ay ym EJ EJ m Di Ss Al Voltage Sample Clock Analog 1D wfm g vesc v el J NChan NSamp stop i Initialize the CAN Channel List Configure the AI Channel List Synchronize the CAN and AI Clear the CAN and NI DAQ t Mode is Input and Sample Rate task with appropriate RTSI PFI must be greater than zero connections then Start bi tasks The AI Start uses the same sample rate as CAN Using LabVIEW With the CAN Demo Box and Analog Signals This part of the lab procedure will use NI LabVIEW tools to observe and plot analog waveforms generated in the CAN Demo Box and sampled in the box The data samples are sent out as CAN frames on the bus A VI will be used to read the samples and create a real time plot of the waveforms The procedures and VIs supporting the analog signals generated by the NI CAN Demo Box and displaying them in graphical form are not available yet This part of the exercise will be implemented at a later date 23 Using LabVIEW With the Model Car The second part of the lab procedure involves CAN communications with the model car still using the LabVIEW tools and
Download Pdf Manuals
Related Search
Related Contents
Philips Halogen 12342DVS2 Orion ATLAS EQ-G User's Manual 取扱説明書 - M 2-20dtmkii User Manual - X ADC AD-30V User's Manual Copyright © All rights reserved.
Failed to retrieve file