Documente Academic
Documente Profesional
Documente Cultură
TOPICS
A. Understanding File I/O B. Understanding High-level File I/O C. Understanding Low-level File I/O D. DAQ Programming E. Instrument Control Programming F. Using Instrument Drivers
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
ni.com/training
VISA
VISA
Virtual Instrument System Architecture
Serial
GPIB
VXI
USB
ni.com/training
Session
When you open a session to a resource, LabVIEW returns a VISA session number, which is a unique refnum to that instrument
Instrument Descriptor
Specifies the interface type (GPIB,VXI, ASRL), the address of the device, and the VISA session type (INSTR or Event)
ni.com/training
VISA Alias
Assign a user-defined name to a device or resource in place of the instrument descriptor
ni.com/training
VISA Programming
VISA functions operate similar to File I/O functions
ni.com/training
ni.com/training
ni.com/training
ni.com/training
ni.com/training
VISA Serial
The VISA Configure Serial Port VI initializes the port identified by VISA resource name to the specified settings
ni.com/training
ni.com/training
ni.com/training
Choose One: Exercise 6-3 Using DAQmx (DAQ) or Exercise 6-4 NI Devsim VI(GPIB/serial)
6-3: Explore a DAQmx example program that continuously acquires data, and modify it to wait on a digital trigger 6-4: Install an instrument driver and explore the example programs that accompany the instrument driver GOAL
Choose One: Exercise 6-3 Using DAQmx (DAQ) or Exercise 6-4 NI Devsim VI(GPIB/serial)
In Exercise 6-3, what types of VIs did you use outside of the While Loop? In Exercise 6-4, how would modify the example programs if you wanted to continuously acquire data? 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. VISA is a high-level API that calls low-level drivers.
a) True b) False
ni.com/training
SummaryQuiz Answer
4. VISA is a high-level API that calls low-level drivers.
a) True b) False
ni.com/training