Virtual channel

Download Report

Transcript Virtual channel

Course contents
1.
Labview basics
–
2.
Structures
–
–
3.
SubVIs
File I/O
Analysis
Signal processing
Communication between loops
Instrument control
–
7.
State machines, SubVIs, MainCluster
Modular programming + recording
–
–
–
–
–
6.
arrays, clusters, charts, graphs
Additional lecture
–
5.
for, while, case, ...
editing techniques
Controls&Indicators
–
4.
virtual instruments, data flow, palettes
DAQ , Data collection, GPIB, Serial
Additional lecture
–
Data Acquisition, Instrument control
Measurement & Automation Explorer
(MAX)
• View and control your devices and software
Create simulated device
• You can test your code without the hardware
Create simulated device
• Real devices are
green
• Simulated devices
are yellow
– simulated devices
work just like real
devices
Test panel
MAX
• Check pinouts
MAX
• Self Test
DAQ Assistant
DAQ Assistant
• Create new task
– put express VI to
block diagram
DAQ Assistant
DAQ Assistant
• Define Task
– 1 sample
Acquire 1 sample with DAQ assistant
Acquire multiple samples from multiple channels
Acquire multiple samples from multiple channels
• N Samples
Acquire multiple samples from multiple channels
• You can sample within a loop
Acquire continuosly
Acquire continuosly
Create NI-DAQmx tasks from MAX
Define Task
Define Task
• Tasks are visible in all LabVIEW applications
Task settings
•
•
•
•
Input range
Timing
Terminal configuration
Add channels
Run task
• Simulated device will produce sine wave
• Press Save to save the task settings
Test simulated device on LabVIEW
• Hardware Input and Output»DAQmx»Analog
Measurements»Voltage»Cont Acq&Graph Voltage-Int Clk.VI
Test simulated device on LabVIEW
Create task from express VI
Generate code from express VI
• Express VI set to Continuos mode
Generate code from Task name constant
Generate code from Task name constant
Output voltages
Output Voltages
• N samples
• Generate >> Example
Digital input
• 1 Sample
Digital input
• 1 Sample
• Generate >> Example
Digital output
• 1 Sample
Triggered acquisition
Counter
NI DAQmx Help
• Start»Programs»National Instruments»NI-DAQ
Terms
•
•
•
•
•
Physical channel - A terminal or pin at which you can measure or generate an analog or
digital signal.
Virtual channel - A collection of settings that can include a name, a physical channel,
input terminal connections, the type of measurement or generation, and scaling
information. In NI-DAQmx, virtual channels are integral to every measurement. You can
configure virtual channels with the DAQ Assistant, which you can open from
Measurement & Automation Explorer (MAX) or your application software. You also can
configure virtual channels with the NI-DAQmx API in your application program.
Task - A collection of one or more virtual channels with timing, triggering, and other
properties. Conceptually, a task represents a measurement or generation you want to
perform. You can set up and save all of the configuration information in a task and use
the task in an application. In NI-DAQmx, you can configure virtual channels as part of a
task or separate from a task.
Local channels - Virtual channels created inside a task.
Global channels - Virtual channels defined outside a task. You can create global
channels in MAX or in your application software. You can use global channels in any
application or add them to a number of different tasks. If you modify a global channel,
the change affects all tasks in which you reference that global channel. In most cases, it
is simpler to use local channels.
Links
• DAQmx Simulated Devices
– http://zone.ni.com/devzone/cda/tut/p/id/3698
• DAQ Assistant and automatic code generation
– http://zone.ni.com/devzone/cda/tut/p/id/4656
• Useful DAQmx functions
– http://zone.ni.com/devzone/cda/tut/p/id/2835
• Continuous vs. Finite Sampling
– http://digital.ni.com/public.nsf/allkb/B86AA2D2FDE9A16086256FFC00
604202
• Read multiple channels sequentially (advanced)
– https://decibel.ni.com/content/docs/DOC-6901