Introduction:
As beginning to code an entire vehicle template can be time consuming, we’ve provided an example template to help you get started with basic DAQ measurements using CompactRIO. While this template provides coding techniques for many sensors and measurements, you can customize and simplify if you only want parts of the code functionality that is provided here.
In the near future, this example template will include additional functionality such as CAN, sensor calibration, Dyno control, and more advanced coding for sensors used on your FSAE vehicle. Currently the template is designed to help you better understand and begin utilizing functions such as basic sensor inputs and outputs, writing data to a Host VI using FIFOs and read/ write controls, saving data on the controller for post-acquisition analysis, and general FPGA programming.
This code is designed to be able to run wirelessly on a vehicle using a router, however, for testing purposes, the easiest way to test the code is to run it while connected to the controller via PC. The data from the controller is sent back to a Host PC via network-published shared variables. More information about shared variables can be found at the link below:
http://zone.ni.com/devzone/cda/tut/p/id/4679
Instructions:
Note: Currently, the code reads raw voltage values and will not correspond to the appropriate parameter that you are measuring. Additional functionality can be added to the VI to calibrate this data to the correct units of measurement.
Hardware:
cRIO 9022 controller
cRIO 9013 chassis with FPGA
NI 9205 Analog Input module
NI 9403 Digital Input/ Output module
Software:
LabVIEW 2011
RT Module
FPGA Module
Ni-RIO 4.0
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.