Mitsubishi Melsec-L Series User Manual page 411

Communication module
Hide thumbs Also See for Melsec-L Series:
Table of Contents

Advertisement

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. - 82
2)
When Visual C++
®
.NET 2003 is used
APPENDIXES
App. - 82

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lj71c24Lj71c24-r2

Table of Contents