Professional Documents
Culture Documents
TOPICS
A. Understanding File I/O B. Understanding High-level File I/O C. Understanding Low-level File I/O D. DAQ Programming E. CAN APIs F. CAN Programming in LabVIEW (Channel API)
ni.com/training
Close File
ni.com/training
ni.com/training
Low-level VIs
Individual VI for each step If you are writing to a file in a loop, use low-level file I/O functions
ni.com/training
ni.com/training
ni.com/training
What would happen if you used the Write to Measurement File Express VI inside the While loop?
DISCUSSION
D. DAQ Programming
1. 2. 3. 4. 5. Signal Terminal Block Cable DAQ Device Computer
ni.com/training
DAQ Assistant
Configurable Express VI used to create a DAQ application
DAQmx API
Provides a set of VIs to program DAQ applications
ni.com/training
ni.com/training
ni.com/training
ni.com/training
ni.com/training
ni.com/training
ni.com/training
ni.com/training
E. CAN APIs
Channel API
High level Easy to use physical units Easy CAN/DAQ synchronization Not compatible with NI-CAN 1.6 or lower
Lower-level, advanced API Command/response protocol Advanced CAN/DAQ synchronization Compatible with all versions of NI-CAN
ni.com/training
Frame API
E. CAN APIs
You can use only one API at a time per CAN port For most applications, use Channel API Use Frame API when:
you require use of remote frames you have advanced requirements for synchronizing CAN and DAQ cards you are using a USB-CAN Interface
ni.com/training
ni.com/training
<or>
ni.com/training
ni.com/training
Choose One: Exercise 6-3 Using DAQmx (DAQ) or Exercise C-3 Read and Write CAN Channels (CAN)
6-3: Explore a DAQmx example program that continuously acquires data, and modify it to wait on a digital trigger. C-3: Read and write channels from the CAN card using the LabVIEW environment. GOAL
Choose One: Exercise 6-3 Using DAQmx (DAQ) or Exercise C-3 Read and Write CAN Channels (CAN)
In Exercise 6-3, what types of VIs did you use outside of the While Loop? In Exercise C-3, how would modify the VI to acquire from an additional channel? DISCUSSION
SummaryQuiz
1. Your continuously running test program logs to a single file the results of all tests that occur in one hour as they are calculated. If you are concerned about the execution speed of your program, should you use low-level or high-level File I/O VIs?
a) Low-level file I/O VIs b) High-level file I/O VIs
ni.com/training
SummaryQuiz Answer
1. Your continuously running test program logs to a single file the results of all tests that occur in one hour as they are calculated. If you are concerned about the execution speed of your program, should you use low-level or high-level File I/O VIs?
a) Low-level file I/O VIs b) High-level file I/O VIs
ni.com/training
SummaryQuiz
2. If you want to view data in a text editor like Notepad, what file format should you use to save the data?
a) ASCII b) TDMS
ni.com/training
SummaryQuiz Answer
2. If you want to view data in a text editor like Notepad, what file format should you use to save the data?
a) ASCII b) TDMS
ni.com/training
SummaryQuiz
3. Which of the following conveys the basic DAQmx programming flow?
a) Create TaskConfigure TaskAcquire/Generate DataStart Task b) Acquire/Generate DataStart TaskClear Task c) Start TaskCreate TaskConfigure TaskAcquire/Generate DataClear Task d) Create TaskConfigure TaskStart TaskAcquire/Generate DataClear Task
ni.com/training
SummaryQuiz Answer
3. Which of the following conveys the basic DAQmx programming flow?
a) Create TaskConfigure TaskAcquire/Generate DataStart Task b) Acquire/Generate DataStart TaskClear Task c) Start TaskCreate TaskConfigure TaskAcquire/Generate DataClear Task d) Create TaskConfigure TaskStart TaskAcquire/Generate DataClear Task
ni.com/training
SummaryQuiz
4. Which of the following are ways to access CAN channels in your CAN application?
a) Specify a channel name that has been imported into MAX b) Specify a database file and channel name for channels not in MAX c) Use the CAN Get Names VI to access all channels in a database file
ni.com/training
SummaryQuiz Answers
4. Which of the following are ways to access CAN channels in your CAN application?
a) Specify a channel name that has been imported into MAX b) Specify a database file and channel name for channels not in MAX c) Use the CAN Get Names VI to access all channels in a database file
ni.com/training