Mitsubishi Melsec-L Series User Manual page 412

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

Advertisement

//**************************
//
Read
//**************************
private: System::Void button2_Click(System::Object * sender, System::EventArgs * e)
{
int iRet;
short sData[5];
String* szMessage= "";
String* lpszarrData[];
int iNumber;
String* szReadData;
// D0-D4 are read
iRet = axActEasyIF1->ReadDeviceBlock2( "D0", 5, sData );
if( iRet == 0 ){
lpszarrData = new String * [ 5 ];
lpszarrData[0] = "D0-D4 = ";
// Storage of data to display the results
for( iNumber = 0 ; iNumber < 5 ; iNumber++ )
{
lpszarrData[ iNumber ] = sData[ iNumber ].ToString();
}
szReadData = String::Join(",",lpszarrData);
MessageBox::Show(String::Format("D0-D4 = {0}",szReadData));
} else {
MessageBox::Show( String::Format( "Read Error:0x{0:x8} [HEX]", __box(iRet) ) );
}
}
//**************************
//
Disconnection
//**************************
private: System::Void button3_Click(System::Object * sender, System::EventArgs * e)
{
int iRet;
// Disconnection
iRet = axActEasyIF1->Close();
if( iRet == 0 ){
MessageBox::Show( "The disconnection was successful" );
} else {
MessageBox::Show( String::Format( "Disconnection Error:0x{0:x8} [HEX]", __box(iRet) ) );
}
}
App. - 83
APPENDIXES
App. - 83

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lj71c24Lj71c24-r2

Table of Contents