VERSION 5.00
Begin VB.Form frmDIO 
   BorderStyle     =   1  'Œ()
   Caption         =   "FcDIO"
   ClientHeight    =   3300
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   1695
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3300
   ScaleWidth      =   1695
   StartUpPosition =   3  'Windows ̊l
   Begin VB.Frame FrmDO 
      Caption         =   "DO"
      Height          =   1335
      Left            =   120
      TabIndex        =   2
      Top             =   1560
      Width           =   1455
      Begin VB.CommandButton cmdDoOff 
         Caption         =   "OFF"
         Height          =   255
         Left            =   360
         TabIndex        =   5
         Top             =   960
         Width           =   615
      End
      Begin VB.CommandButton cmdDoOn 
         Caption         =   "ON"
         Height          =   255
         Left            =   360
         TabIndex        =   4
         Top             =   600
         Width           =   615
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "CH1"
         Height          =   180
         Left            =   502
         TabIndex        =   3
         Top             =   240
         Width           =   330
      End
   End
   Begin VB.Frame frmDI 
      Caption         =   "DI"
      Height          =   1215
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   1455
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "CH1"
         Height          =   180
         Left            =   502
         TabIndex        =   1
         Top             =   360
         Width           =   330
      End
      Begin VB.Shape ShDI 
         FillStyle       =   0  'hԂ
         Height          =   375
         Left            =   420
         Shape           =   3  '~
         Top             =   600
         Width           =   495
      End
   End
   Begin VB.Timer Timer1 
      Interval        =   500
      Left            =   120
      Top             =   2880
   End
End
Attribute VB_Name = "frmDIO"
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 fcrasDigitalIn Lib "FcSrasapiP.dll" Alias "fcrasDigitalInP" (ByRef data As Byte) As Long
Private Declare Function fcrasDigitalOut Lib "FcSrasapiP.dll" Alias "fcrasDigitalOutP" (ByVal data As Byte) As Long
' RETURNXe[^X
Private Const FCSRASAPI_SUCCESS   As Integer = &H0
Private Const FCSRASAPI_DRVERR    As Integer = &H1

'****************************************************
'   ֐ F cmdDoOff_Click
'   @\   F DO@Offo
'      F Ȃ
'   ߂l F Ȃ
'****************************************************
Private Sub cmdDoOff_Click()
    fcrasDigitalOut (&H0)
End Sub

'****************************************************
'   ֐ F cmdDoOn_Click
'   @\   F DO@ONo
'      F Ȃ
'   ߂l F Ȃ
'****************************************************
Private Sub cmdDoOn_Click()
    fcrasDigitalOut (&H1)
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

'****************************************************
'   ֐ F Timer1_Timer
'   @\   F^C}[ɂʍXV
'      F Ȃ
'   ߂l F Ȃ
'****************************************************
Private Sub Timer1_Timer()
    Dim DIdata As Byte
    Dim Ret As Long
    Ret = fcrasDigitalIn(DIdata)
    
    If FCSRASAPI_SUCCESS = Ret Then
        If (DIdata And &H1) <> 0 Then
            ShDI.FillColor = vbRed
        Else
            ShDI.FillColor = vbWhite
        End If
    End If
    
End Sub
