|
|
|
IG Session Operation
The normal sequence of the initial operation of the IG:
- Setup the IO. (Usually networking.)
- Create a IG session.
- Create Event, Session, and/or Callback processing objects and/or routines.
- Get references to the Incoming Message and the Outgoing Message.
- Set the CIGI version of the external interface.
- Set the external interface as synchronous or asynchronous.
- Get a reference to the Incoming Message object.
- Set the internally used version of CIGI.
- Set whether iteration is used or not used.
- Register all Event, Signal, and Callback processors being used.
- Create a CigiSOFV? object and set the parameters as needed.
The normal per frame sequence of the operation of the IG:
1. |
|
Note the reference to the Outgoing Message object. |
2. |
|
Process the incoming message (if any) from the host. |
if ( CigiIncomingMsgSize > 0 ) {
try {
IncomingMsgPointer->ProcessIncomingMsg(
(unsigned char *)CIncomingMsgBuffer,
CigiIncomingMsgSize );
}
catch ( CigiException & theException ) {
std::cout << "getNetMessages - Exception: "
<< theException.what()
<< std::endl;
}
}
|
| |
3. | |
Modify the Start of Frame object as needed. |
4. | |
Pack the Start of Frame packet onto the outgoing message buffer as shown: |
OutgoingMessage << SOF;
|
|
|
5. | |
Update the frame counter |
6. | |
Prepare the outgoing message for sending. |
try {
Omsg.PackageMsg(&pCigiOutBuf,CigiOutSz);
}
catch ( CigiException &theException ) {
std::cout << "getNetMessages - Exception: "
<< theException.what()
<< std::endl;
}
Omsg.UpdateSOF(pCigiOutBuf);
|
| |
7. | |
Wait until start of frame time |
8. | |
Send the message: |
waitUntilBeginningOfFrame();
int sentBytes = network.send(
pCigiOutgoingMsgBuffer,
CigiOutgoingMsgSize );
|
| |
9. | |
Receive the message from the Host: |
CigiIncomingMsgSize = network.recv(
CIncomingMsgBuffer,
RECV_BUFFER_MAX_SIZE );
|
| |
|
|
|
|
|
|
|
|
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ********
******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** ******** |
|