Chapter 6
Using Your Serial Device Server
Access Privilege
Read/Write Global
Transceiver Mode
Four-wire mode
Two-wire mode: DTR with echo
Two-wire mode: DTR controlled
Two-wire mode: Auto Control
ENET-232 and ENET-485 Series User Manual
Linux x86/Solaris 2.x
You can get and set Transceiver (or Wire) modes programmatically
through the NI-VISA API using
viSetAttribute()
transceiver modes.
Controlling the Transceiver Mode Programmatically
viGetAttribute()
NI-VISA manuals in the
VI_ATTR_ASRL_WIRE_MODE
VI_ATTR_ASRL_WIRE_MODE
Resource Classes
Serial INSTR
Attribute Information
Data Type
Range
ViInt16
VI_ASRL_WIRE_485_4
VI_ASRL_WIRE_485_2_DTR_ECHO
VI_ASRL_WIRE_485_2_DTR_CTRL
VI_ASRL_WIRE_485_2_AUTO
VI_STATE_UNKNOWN
Description
This attribute is valid only with the RS-485 serial drivers developed by
National Instruments, and sets the transceiver mode.
Table 6-3. VI_ATTR_ASRL_WIRE_MODE Attribute States
VI_ASRL_WIRE_485_4
VI_ASRL_WIRE_485_2_DTR_ECHO
VI_ASRL_WIRE_485_2_DTR_CTRL
VI_ASRL_WIRE_485_2_AUTO
For example, to set two-wire Auto Control mode, use the following code:
status = viSetAttribute( instr, VI_ATTR_ASRL_WIRE_MODE,
viGetAttribute()
. However, you cannot statically configure
and
viSetAttribute()
subdirectory of your installation. Use
NIvisa
, which is documented below.
(0)
(–1)
VI_ATTR_ASRL_WIRE_MODE
VI_ASRL_WIRE_485_2_AUTO );
6-10
and
are documented in the
Default
N/A
(1)
(2)
(3)
Attribute States
ni.com