
63
Chapter 4
While (1) {
// do your job here.
Sleep(8000);
DeviceIoControl(m_hWDT, IOCTL_WDT_STROBE, NULL,0, NULL,
0, &dwTemp, NULL);
}
DeviceIoControl(m_hWDT, IOCTL_WDT_DISABLE, NULL, , NULL,
0, &dwTemp, NULL);
CloseHandle(m_hWDT);
4.5.3 DIO, LED and Buzzer
UNO-1019 has 2 DI(Digital Input) , 2 DO(Digital Output), 3 LED and a
Buzzer. Users can access these resources via the built-in Advantech IO
Service driver named “ADV1:”.The follows are the descriptions and
examples of the usable DeviceIoControl codes in this driver:
How to Use the Control Code
There are 11 control codes for the operation codes in DIO, LED, and
Buzzer (driver).
1. ADV_IOCTL_READ_DI:
Read the Digital Input value.
lpInBuffer : unsed.
nInBufferSize: unused.
lpOutBuffer: The BYTE pointer to the current DI value. BIT0 indicates
DI_0 state; BIT1 indicates DI_1 state.
nOutBufferSize: User provided output buffer size.