EasyManua.ls Logo

National Instruments PCI-8430 - Page 107

National Instruments PCI-8430
237 pages
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...
DeviceIoControlWindowsfunctiononENETRS-485hardware,
completethefollowingsteps:
1. Addthefollowinglinestoyoursourcecode:
#include<winioctl.h>
#defineSERIAL_TM_4WIRE 0x80
#defineSERIAL_TM_2W_ECHO0x81
#defineSERIAL_TM_2W_DTR 0x81
#defineSERIAL_TM_2W_AUTO0x83
#defineIOCTL_SERIAL_SET_TRANSCEIVER_MODE
CTL_CODE(FILE_DEVICE_SERIAL_PORT,37,METHOD_BUFFERED,FILE_ANY_ACCESS)
2. TosettheRS-485transceivercontrolmode,use
IOCTL_SERIAL_SET_TRANSCEIVER_MODEand
DeviceIoControl.Forexample,tosettotwo-wireAuto
Controlmode,usethefollowingcode:
ULONGbytecount;
TRANSCEIVER_MODEtransceiver_mode=SERIAL_TM_2W_AUTO;
DeviceIoControl(
comhandle,
IOCTL_SERIAL_SET_TRANSCEIVER_MODE,
(PVOID)&transceiver_mode,
sizeof(transceiver_mode),
(PVOID)NULL,0,
&bytecount,
NULL
);

Related product manuals