APPENDIX
//
//
Lectura
//
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",
MessageBox ( szMessage )
} else {
szMessage. Format ( "Read Error: %x", lRet );
MessageBox ( szMessage )
}
}
//
//
Desconexión
//
void CVCDlg::OnOpen()
{
long lRet;
CString szMessage;
// Desconexión
lRet = m_actEasyIF. Close();
if ( lRet == 0) {
MessageBox ( "The disconnection was successful" )
} else {
szMessage. Format ( "Disconnection Error: %x", lRet );
MessageBox ( szMessage )
}
}
App - 35
sData[0], sData[1], sData[2], sData[3], sData[4] );
MELSEC-Q
App - 35