The following program instantiates a CController object, which it uses to open
the driver for device 0 and sends a Test Data Link ( TDL ) to the timing board.
An exception is thrown if an error occurs within any of the method calls. The
error message will be printed within the catch block. For example, an error
will occur if the TDL command returns anything other than 0x112233.
#include <iostream>
#include <cstdlib>
#include "CController.h"
using namespace std;
using namespace arc;
int main()
{
CController cController;
try
{
cController.GetDeviceBindings();
cController.OpenDriver( 0, 4200 * 4200 * sizeof( unsigned short ) );
cController.CheckReply( cController.Command( TIM_ID, TDL, 0x112233 ), 0x112233 );
cController.CloseDriver();
}
catch ( std::exception &e )
{
cController.CloseDriver();
cerr << e.what() << endl;
}
return EXIT_SUCCESS;
}