EasyManua.ls Logo

National Instruments PCI-8430 - Page 116

National Instruments PCI-8430
237 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
RetrievingtheRS-232TransceiverState
TheNI-SerialsoftwarereturnswhichmodetheRS-232transceiversare
currentlyoperatingin,andwhethertheserialconnectionisvalid.
NoteTransceivermodereferstotheprogrammedmode.
Transceiverstatereferstothephysicalstateofthetransceivers
(actualoperatingmodeandwhethervalidorinvalid).
TherearetwowaystoretrievetheRS-232transceiverstateand
tranceivermode:
ReadtheNI-VISAwiremodeattributetoretrievethetransceiver
stateandtheNI-VISAIsPortConnectedattributetoretrievethe
transceivermode.
TheNI-Serialsoftwareusesprogrammaticcontrolcodesandthe
DeviceIoControlWindowsfunctiontoretrievetheRS-232
transceiverstateandtransceivermode.
ToretrievetheRS-232transceiverstateusingtheDeviceIoControl
Windowsfunction,completethefollowingsteps:
1. Addthefollowinglinestoyoursourcecode:
#include<winioctl.h>
#include<NiSerial.h>
NoteTheheaderfileNiSerial.hisincludedonyourNI-
SerialsoftwareCD.YoualsocanfinditintheNI-Serial
folderwhereyouinstalledyourNationalInstruments
software(typically,C:\ProgramFiles\NationalInstruments\NI-
Serial).
2. TheRS-232transceiverstateattributeiscontainedwithinastruct
oftypeSERIAL_RS232_STATE.Thestructmembersandpossible
valuesareshownbelow:
Member
Name
Values
PortMode RS232_MODE_DTE
RS232_MODE_DCE
RS232_MODE_AUTO

Related product manuals