110
Appendix: X-I/O Module Option
X64-AN Quad User's Manual
// direct read access to low-level Sapera C library capability to
// check I/O Input module
if
(m_pGio[iDevice]->IsCapabilityValid(CORGIO_CAP_DIR_INPUT))
status
=
m_pGio[iDevice]->GetCapability(CORGIO_CAP_DIR_INPUT,&capInput);
[ . . . ]
// Constructor used for I/O Output module dialog.
if
(capOutput)
{
m_pDlgOutput[iDevice] = new CGioOutputDlg(this, iDevice, m_pGio[iDevice]);
}
[ . . . ]
// Constructor used for I/O Input module dialog.
if (capInput)
{
m_pDlgInput[iDevice] = new CGioInputDlg(this, iDevice, m_pGio[iDevice]);
}
}
//end
for
} // end if
[ . . . ]
}
Function CreateObjects()
BOOL CreateObjects()
{
CWaitCursor wait;
// Loop for all I/O resources
for (UINT32 iDevice = 0; (iDevice < MAX_GIO_DEVICE) && (iDevice < m_gioCount);
+)
{
// The SapLocation object specifying the server where the I/O resource is located
SapLocation location(m_ServerIndex, iDevice);
// The SapGio constructor is called for each resource found.
m_pGio[iDevice] = new SapGio(location);
// Creates all the low-level Sapera resources needed by the I/O object
if (m_pGio[iDevice] && !*m_pGio[iDevice] && !m_pGio[iDevice]->Create())
{
DestroyObjects();
return
FALSE;
}
}
return TRUE;
}