![National Instruments ENET-232 Series Скачать руководство пользователя страница 51](http://html2.mh-extra.com/html/national-instruments/enet-232-series/enet-232-series_user-manual_3450879051.webp)
Chapter 6
Using Your Serial Device Server
ENET-232 and ENET-485 Series User Manual
6-10
ni.com
Linux
x
86/Solaris 2.
x
You can get and set Transceiver (or Wire) modes programmatically
through the NI-VISA API using
viGetAttribute()
and
viSetAttribute()
. However, you cannot statically configure
transceiver modes.
Controlling the Transceiver Mode Programmatically
viGetAttribute()
and
viSetAttribute()
are documented in the
NI-VISA manuals in the
NIvisa
subdirectory of your installation. Use
VI_ATTR_ASRL_WIRE_MODE
, which is documented below.
VI_ATTR_ASRL_WIRE_MODE
Resource Classes
Serial INSTR
Attribute Information
Access Privilege
Data Type
Range
Default
Read/Write Global
ViInt16
VI_ASRL_WIRE_485_4
(0)
N/A
VI_ASRL_WIRE_485_2_DTR_ECHO
(1)
VI_ASRL_WIRE_485_2_DTR_CTRL
(2)
VI_ASRL_WIRE_485_2_AUTO
(3)
VI_STATE_UNKNOWN
(–1)
Description
This attribute is valid only with the RS-485 serial drivers developed by
National Instruments, and sets the transceiver mode.
For example, to set two-wire Auto Control mode, use the following code:
status = viSetAttribute( instr, VI_ATTR_ASRL_WIRE_MODE,
VI_ASRL_WIRE_485_2_AUTO );
Table 6-3.
VI_ATTR_ASRL_WIRE_MODE
Attribute States
Transceiver Mode
VI_ATTR_ASRL_WIRE_MODE
Attribute States
Four-wire mode
VI_ASRL_WIRE_485_4
Two-wire mode: DTR with echo
VI_ASRL_WIRE_485_2_DTR_ECHO
Two-wire mode: DTR controlled
VI_ASRL_WIRE_485_2_DTR_CTRL
Two-wire mode: Auto Control
VI_ASRL_WIRE_485_2_AUTO