<< Chapter < Page | Chapter >> Page > |
You transfer data among block diagram objects through
wires. Wires are analogous to variables in text-basedprogramming languages. In
, wires connect
the control and indicator terminals to the
Add
and
Subtract
functions. Each wire has a single
data source, but you can wire it to many VIs and functionsthat read the data. Wires are different colors, styles, and
thicknesses, depending on their data types. A broken wireappears as a dashed black line with a red X in the
middle. The examples in
are the most
common wire types.
Wire Type | Scalar | 1D Array | 2D Array | Color |
---|---|---|---|---|
Numeric | Orange (floating-point), Blue (integer) | |||
Boolean | Green | |||
String | Pink |
In LabVIEW, you use wires to connect multiple terminals together to pass data in a VI. The wires must be connectedto inputs and outputs that are compatible with the data that is transferred with the wire. For example, you cannot wirean array output to a numeric input. In addition the direction of the wires must be correct. The wires must beconnected to only one input and at least one output. For example, you cannot wire two indicators together. Thecomponents that determine wiring compatibility include the data type of the control and/or indicator and the data typeof the terminal.
Data types indicate what objects, inputs, and outputs you can wire together. For example, a switch has a greenborder so you can wire a switch to any input with a green label on an Express VI. A knob has an orange border so youcan wire a knob to any input with an orange label. However, you cannot wire an orange knob to an inputwith a green label. Notice the wires are the same color as the terminal.
The dynamic data type stores the information generated oracquired by an Express VI. The dynamic data type appears as a dark blue terminal, shown at left. Most Express VIsaccept and/or return the dynamic data type. You can wire the dynamic data type to any indicator or input thataccepts numeric, waveform, or Boolean data. Wire the dynamic data type to an indicator that can best presentthe data. Indicators include a graph, chart, or numeric indicator.
Most other VIs and functions in LabVIEW do not accept the dynamic data type. To use a built-in VI or function toanalyze or process the data the dynamic data type includes, you must convert the dynamic data type.
Use the
Convert from Dynamic Data
Express VI, shown at
left, to convert the dynamic data type to numeric,Boolean, waveform, and array data types for use with other
VIs and functions. When you place the
Convert from
Dynamic Data
Express VI on the block diagram, the
Configure Convert from Dynamic Data
dialog
box appears. The
Configure Convert from DynamicData
dialog box displays options that let you
specify how you want to format the data that the
Convert from Dynamic Data
Express VI returns.
When you wire a dynamic data type to an array indicator,
LabVIEW automatically places the
Convert from
Dynamic Data
Express VI on the block
diagram. Double-click the
Convert from Dynamic
Data
Express VI to open the
Configure Convert
from Dynamic Data
dialog box to control how the
data appears in the array.
Use the
Convert to Dynamic Data
Express VI to
convert numeric, Boolean, waveform, and array data typesto the dynamic data type for use with Express VIs. When
you place the
Convert to Dynamic Data
Express
VI on the block diagram, the
Configure Convert to
Dynamic Data
dialog box appears. Use this dialog
box to select the kind of data to convert to the dynamicdata type.
LabVIEW automatically wires objects as you place them on the block diagram. You also can automatically wire objectsalready on the block diagram. LabVIEW connects the terminals that best match and leaves terminals that do notmatch unconnected.
As you move a selected object close to other objects on the block diagram, LabVIEW draws temporary wires to showyou valid connections. When you release the mouse button to place the object on the block diagram, LabVIEWautomatically connects the wires.
Toggle automatic wiring by pressing the spacebar while you
move an object using the
Positioning
tool. You can adjust the automatic wiring settings by
selecting
Tools>>Options
and selecting
Block Diagram
from the top pull-down menu.
When you pass the
Wiring
tool over a
terminal, a tip strip appears with the name of theterminal. In addition, the terminal blinks in the
Context Help
window and on the icon to help
you verify that you are wiring to the correct terminal.
Notification Switch
Would you like to follow the 'Labview graphical programming' conversation and receive update notifications?