SettingRingIndicate(RI)andDataCarrier
Detect(DCD)withDeviceIoControl
TherearetwowaystosetandretrievetheseRS-232signals:
SetandreadtheNI-VISALineRIStateandLineDCDState
attributes.
TheNI-Serialsoftwareusesprogrammaticcontrolcodesandthe
DeviceIoControlWindowsfunctiontoretrievetheseRS-232
signals.
ToretrievetheseRS-232signalsusingtheDeviceIoControlWindows
function,completethefollowingsteps:
1. Addthefollowinglinestoyoursourcecode:
#include<winioctl.h>
#include<NiSerial.h>
NoteTheheaderfileNiSerial.hisincludedonyourNI-
SerialsoftwareCD.YoualsocanfinditintheNI-Serial
folderwhereyouinstalledyourNationalInstruments
software(typically,C:\ProgramFiles\NationalInstruments\NI-
Serial).
2. TheSERIAL_RI_OUTattributecanhavethefollowingvalues:
SERIAL_RI_ON
SERIAL_RI_OFF
3. TosettheRS-232signalRIwhenthetransceiverisinDCEmode,
usethefollowingcode:
DWORDl_ByteCount;
DeviceIoControl(
PortHandle,
NISERIAL_SET_RI,
(LPVOID)NULL,
0,