79
HANDLE m_hWDT=NULL;
TCHAR szClassName[60];
...
// assign the WDT driver name
wsprintf(szClassName, TEXT("WDT1:"));
// Open the WDT driver
m_hWDT = CreateFile(szClassName, GENERIC_READ | GENERIC_WRITE, 0,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if ( m_hWDT == INVALID_HANDLE_VALUE )
{
DebugMsg(CString("WDT driver fail"));
return;
}
...
DWORD dwTemp;
DWORD nPeriod=10000;
// Set the Watchdog Timer as 10 seconds (10000 mini-seconds)
DeviceIoControl(m_hWDT, IOCTL_SET_WDTPERIOD, &nPeriod, 4, NULL, 0, &dwTemp, NULL);
// Enable the Watchdog timer
DeviceIoControl(m_hWDT, IOCTL_ENABLE_WDT, NULL, NULL, NULL, 0, &dwTemp, NULL);
While (1)
{
// do your job here...
Sleep(8000);
DeviceIoControl(m_hWDT, IOCTL_ACCESS_WDT, NULL, NULL, NULL, 0, &dwTemp, NULL);
}
DeviceIoControl(m_hWDT, IOCTL_DISABLE_WDT, NULL, NULL, NULL, 0, NULL, NULL);
CloseHandle(m_hWDT);
Summary of Contents for SPC-57
Page 6: ...disclaims all responsibility for the accuracy of any statements contained herein...
Page 15: ...1 7 Mounting...
Page 16: ......
Page 17: ...1 8 Dimension and cutout...
Page 18: ...CHAPTER 2 Getting Start This chapter provides brief instructions for operating the SPC 57...
Page 20: ...Vcc GND 4 Plug the male power connector into female power connector in SPC...
Page 21: ......
Page 28: ......
Page 29: ......
Page 30: ...Figure 3 1 The PCM 7230 for SPC 57 Block Diagram...
Page 72: ...72 Figure 4 22 Step 5 Tap Install button to install SDK Figure 4 23...
Page 73: ...73 Install SDK Figure 4 24 Step6 Finish installing...
Page 85: ...85...