App. - 33 App. - 33
MELSEC-Q
APPENDIXES
4) When Visual C++
®
6.0 is used
//**************************
// Connection
//**************************
void CVCDlg::OnOpen()
{
long
lRet;
CString
szMessage;
// Reflects the logical station No. set in the text box to variables.
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
);
}
}
//**************************
// Read
//**************************
void CVCDlg::OnRead()
{
long
lRet;
short
sData[5];
CString
szMessage;
// D0-D4 are read
lRet = m_actEasyIf.ReadDeviceBlock2( "D0", 5, sData );
if( lRet == 0 ){
szMessage.Format(
"D0-D5
=
%d,%d,%d,%d,%d",
sData[0],sData[1],sData[2],sData[3],sData[4]
);
MessageBox(
szMessage
);
}
else
{
szMessage.Format( "Read Error : %x", lRet );
MessageBox(
szMessage
);
}
}
Содержание MELSEC QJ71C24
Страница 1: ......
Страница 2: ......
Страница 103: ...3 42 3 42 MELSEC Q 3 SPECIFICATIONS MEMO ...
Страница 177: ...6 33 6 33 MELSEC Q 6 DATA COMMUNICATION USING THE NON PROCEDURE PROTOCOL MEMO ...
Страница 397: ...App 24 App 24 MELSEC Q APPENDIXES Connection example 3 Connection example 4 ...
Страница 441: ......
Страница 442: ......