PCI WATCHDOG TIME CARD

Local Watchdog

LOCAL WATCHDOG WITH SOURCE CODE

PC AUTO-RESET APPLICATION
Main function: This basic software is designer to use for PCI Watchdog Card. It will continuously monitor PC critical counter function. When a fault occurs, the card will automatically generates off power box or reset main board and reboot PC.


Introduction

Once you run the program it will enable (start) the timer and it will automatically refresh the card as well. If the software did not refresh the Watchdog card for whatever reason (e.g. Computer locks-up) it will automatically reset the PC.

If you want to Change the count down time:

Click the "Stop" (Disable) button.

Edit the countdown text boxClick the "Start" (Enable) button.


To work with the power control box:

Click the "Power ON" button or Ctrl + N to turn the Power on.

Click the "Power OFF" button or Ctrl + F to turn the power off.

The "Start" button will enable or load the timer of the card.

The "Stop" button will disable the timer of the card.

The "Refresh" button will re-initialize the timer of the card.

To exit click the "Exit" button or Ctrl + X


Private Sub cmdDisable_Click()

WatchDog_OCX1.Disable

Timer1.Enabled = False

End Sub

Private SubcmdEnable_Click()

WatchDog_OCX1.EnableorLoad

WatchDog_OCX1.SetCounter (txtCountDown) 'Set the counter

Timer1.Enabled = True

End Sub

Private Sub cmdExit_Click()

End

End Sub

Private Sub cmdOff_Click()

WatchDog_OCX1.PowerOFF

End Sub

Private Sub cmdOn_Click()

WatchDog_OCX1.PowerON

End Sub

Private Sub cmdRefresh_Click()

WatchDog_OCX1.EnableorLoad WatchDog_OCX1.Disable

End Sub

Private Sub Form_Load()

WatchDog_OCX1.SetCounter (txtCountDown) 'Set the counter

WatchDog_OCX1.SetTimeUnit (10) 'Set the Time unit

WatchDog_OCX1.EnableorLoad

Timer1.Enabled = True

End Sub

Private Sub Timer1_Timer()

txtCountDown.Text = WatchDog_OCX1.GetCounter

If txtCountDown.Text = 1 Then

Call cmdRefresh_Click

End If

End Sub


BOOL CReseterWatchdogDlg::OnInitDialog()

{

CDialog::OnInitDialog();

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.

ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);

ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);

if (pSysMenu != NULL)

{

CString strAboutMenu;

strAboutMenu.LoadString(IDS_ABOUTBOX);

if (!strAboutMenu.IsEmpty())

{

pSysMenu->AppendMenu(MF_SEPARATOR);

pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);

}

}

// Set the icon for this dialog. The framework does this automatically

// when the application's main window is not a dialog

SetIcon(m_hIcon, TRUE); // Set big icon

SetIcon(m_hIcon, FALSE); // Set small icon

NEXT