Mitsubishi Electric QJ71C24N User Manual page 403

Q corresponding serial communication module
Table of Contents

Advertisement

APPENDICES
Private Sub Command2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Command2.Click
'***********************************
'
Read
'***********************************
Dim rtn As Integer
Dim idata(5) As Short
'D0-D4 are read
rtn = AxActEasyIF1.ReadDeviceBlock2("D0", 5, idata(0))
If rtn = 0 Then
MsgBox("D0-D4 = " & idata(0) & "," & idata(1) & "," & idata(2) & "," & idata(3) & "," & idata(4))
Else
MsgBox("Read Error :" & Hex(rtn))
End If
End Sub
Private Sub Command3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Command3.Click
'***********************************
'
Disconnection
'***********************************
Dim rtn As Integer
'Disconnection
rtn = AxActEasyIF1.Close()
If rtn = 0 Then
MsgBox("The disconnection was successful")
Else
MsgBox("Disconnection Error :" & Hex(rtn))
End If
End Sub
//**************************
//
Connection
//**************************
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
int iRet;
// Get LogicalstationNumber
axActEasyIF1->ActLogicalStationNumber=Convert::ToInt32(textBox1->Text);
// Connection
iRet = axActEasyIF1->Open();
if( iRet == 0 ){
MessageBox::Show( "The connection was successful" );
} else {
MessageBox::Show( String::Format( "Connection Error:0x{0:x8} [HEX]", __box(iRet) ) );
}
}
App. - 30
2)
When Visual C++
®
.NET 2003 is used
MELSEC-Q
App. - 30

Advertisement

Table of Contents
loading

Table of Contents