Mitsubishi Electronics QJ71C24N Network Card User Manual


 
App. - 29 App. - 29
MELSEC-Q
APPENDIX
//
// 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 )
}
}
//
// Disconnection
//
void CVCDlg::OnOpen()
{
long lRet;
CString szMessage;
// Disconnection
lRet = m_actEasyIF. Close();
if ( lRet == 0) {
MessageBox ( "The disconnection was successful" )
} else {
szMessage. Format ( "Disconnection Error: %x", lRet );
MessageBox ( szMessage )
}
}