App. - 31 App. - 31
MELSEC-Q
APPENDIXES
//**************************
// 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 ; + )
{
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) ) );
}
}
Summary of Contents for MELSEC QJ71C24
Page 1: ......
Page 2: ......
Page 103: ...3 42 3 42 MELSEC Q 3 SPECIFICATIONS MEMO ...
Page 177: ...6 33 6 33 MELSEC Q 6 DATA COMMUNICATION USING THE NON PROCEDURE PROTOCOL MEMO ...
Page 397: ...App 24 App 24 MELSEC Q APPENDIXES Connection example 3 Connection example 4 ...
Page 441: ......
Page 442: ......