App. - 28                            App. - 28
MELSEC-Q
APPENDIX
Private Sub Command3_Click()
' 
'      Disconnection
' 
Dim rtn As Long
      ' Disconnection
      rtn = ActEasyIF1. Close()
      If rtn = 0 Then
   MsgBox "The disconnection was successful"
      Else
   MsgBox "Disconnection Error:" & Hex(rtn)
      End If
End Sub
(b)     When Visual C++
®
 is used
// 
//      Connection
// 
void CVCDlg::OnOpen()
{
 long lRet;
         CString szMessage;
         UpdateData();
      // Get LogicalStationNumber
         m_actEasyIF. SetActLogicalStationNumber ( m_lLogicalStationNumber ):
      // Connection
 lRet = m_actEasyIF. Open();
 if ( lRet == 0) {
      MessageBox ( "The connection was successful" )
         } else {
      szMessage. Format ( "Connection Error: %x", lRet );
      MessageBox ( szMessage )
         }
}