VERSION 5.00
Begin VB.Form frmWDT 
   BorderStyle     =   1  'Œ()
   Caption         =   "fcWDT"
   ClientHeight    =   1230
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   2550
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1230
   ScaleWidth      =   2550
   StartUpPosition =   3  'Windows ̊l
   Begin VB.Timer Timer1 
      Left            =   2040
      Top             =   720
   End
   Begin VB.CommandButton cmdStop 
      Caption         =   "WDT Stop"
      Height          =   375
      Left            =   120
      TabIndex        =   1
      Top             =   720
      Width           =   1815
   End
   Begin VB.CommandButton cmdWdtStart 
      Caption         =   "WDT Reset && Start"
      Height          =   375
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   1815
   End
   Begin VB.Label lblCount 
      Alignment       =   1  'E
      Caption         =   "10"
      Height          =   255
      Left            =   2040
      TabIndex        =   2
      Top             =   240
      Width           =   375
   End
End
Attribute VB_Name = "frmWDT"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'*****************************************************************************
'   t@C F frmDIO.frm
'
'   @\ F DIO\^o͋@\(Tvj
'
'
' Copyright (C) NEC Corporation 2006
'*****************************************************************************
'*****************************************************************************
' \tgRASI/F`
'*****************************************************************************
Private Declare Function fcsoftrasOpen Lib "FcSrasapiP.dll" Alias "fcsoftrasOpenP" () As Long
Private Declare Function fcsoftrasClose Lib "FcSrasapiP.dll" Alias "fcsoftrasCloseP" () As Long
Private Declare Function fcrasResetAndStartWDT Lib "FcSrasapiP.dll" Alias "fcrasResetAndStartWDTP" (ByVal TimerValue As Long) As Long
Private Declare Function fcrasStopWDT Lib "FcSrasapiP.dll" Alias "fcrasStopWDTP" () As Long



' RETURNXe[^X
Private Const FCSRASAPI_SUCCESS   As Integer = &H0
Private Const FCSRASAPI_DRVERR    As Integer = &H1

'*****************************************************************************
' ʃf[^
'*****************************************************************************
Dim StartTime As Date
'****************************************************
'   ֐ F cmdWdtStart_Click
'   @\   F WDT^C}[~
'      F Ȃ
'   ߂l F Ȃ
'****************************************************
Private Sub cmdStop_Click()
    Call fcrasStopWDT
    Timer1.Enabled = False
End Sub

'****************************************************
'   ֐ F cmdWdtStart_Click
'   @\   F WDT^C}[Jn
'      F Ȃ
'   ߂l F Ȃ
'****************************************************
Private Sub cmdWdtStart_Click()
    Call fcrasResetAndStartWDT(10000)
    StartTime = Now
    lblCount.Caption = 10
    Timer1.Interval = 500
    Timer1.Enabled = True
End Sub

'****************************************************
'   ֐ F Form_Load
'   @\   F 
'      F Ȃ
'   ߂l F Ȃ
'****************************************************
Private Sub Form_Load()
    Call fcsoftrasOpen
End Sub
'****************************************************
'   ֐ F Form_Unload
'   @\   F ㏈
'      F Ȃ
'   ߂l F Ȃ
'****************************************************
Private Sub Form_Unload(Cancel As Integer)
    Call fcsoftrasClose
End Sub

Private Sub Timer1_Timer()
    lblCount.Caption = 10 - DateDiff("s", StartTime, Now)
    If lblCount.Caption < -4 Then
        Timer1.Enabled = False
    End If
End Sub
