EasyManua.ls Logo

National Instruments PCI-8430 - Page 97

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SerialInterfaceType(RS-232or
RS-485)
Therearetwowaystoretrievetheserialinterfacetype(RS-232orRS-
485):
ReadtheNI-VISAwiremodeattribute.
TheNI-Serialsoftwareusesprogrammaticcontrolcodesandthe
DeviceIoControlWindowsfunctiontoretrievetheserialinterface
type.
Toretrievetheserialinterfacetype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SERIAL_INTERFACEattributecanhavethefollowingvalues:
RS485_INTERFACE
RS232_INTERFACE
3. Toretrievetheserialinterfacetype,use
NISERIAL_GET_INTERFACE_TYPEandDeviceIoControlwiththe
followingcode:
SERIAL_INTERFACEl_SerialInterface;
DWORDl_ByteCount;
DeviceIoControl(
PortHandle,
NISERIAL_GET_INTERFACE_TYPE,
(LPVOID)NULL,

Related product manuals