Check before sending a command or command parameter:
Bit 1 = 1 Host input FIFO is empty, can send command
0 Host input FIFO is not empty, cannot send command
Check before reading a reply data value:
Bit 2 = 1 DSP output FIFO is not empty, can read data
0 DSP output FIFO is empty, no data
Three bits (3, 4, 5) are used to communicate replies from both the PCI board and the
controller. The default value is 0, which would mean a timeout has occurred if the
bits are not changed to one of the other values before a specified amount of time
has elapsed. A value of 1 means the last command completed successfully. A value
of 2 means the last command has generated a reply data value, which is now avaiable
for reading from the Reply Buffer. A value of 3 means an error has occurred and the
last command has failed. A value of 4 means a system reset has occurred and may or
may not be an error, depending on the command. A value of 5 means the controller is
currently reading out an image and cannot be interrupted or process ascii commands.
A value of 6 means the PCI board is currently busy processing a command and cannot
be interrupted. The device driver will wait for one of the other reply values to be
set before returning.
Bits 3, 4, 5
= 0 TIMEOUT (Timeout)
= 1 DON (Done)
= 2 RDR (Read Reply Value)
= 3 ERR (Error)
= 4 SYR (System Reset)
= 5 READOUT (Readout)
= 6 BUSY (PCI Busy)
CController class methods that use these values:| NAME | DESCRIPTION | VALUE |
| HTF_BITS | A bit-mask for the HTF ( Host Transfer Flags ) that is used in conjunction with the CController::GetHstr() method. The resulting value will be one of the remaining values. | 0x00000038 |
| TIMEOUT | The last command failed to receive a reply from the PCI board or controller. | 0 |
| READOUT | The controller is currently reading out image data. | 5 |
| BUSY | The PCI board is busy. The user must wait until this is cleared before it will accept any new commands. | 6 |
// Demonstrates how to check if the controller
// is in readout before sending more commands.
#include <iostream.h>
#include "CController.h"
using namespace std;
using namespace arc;
CController cController;
try {
// .... open driver, initialize, etc ....
lHstr = cController.GetHstr();
if ( ( ( lHstr & HTF_BITS ) >> 3 ) == READOUT )
throw std::runtime_error( "Cannot send command; controller reading out!" );
// .... do some command ....
}
catch ( std::exception &e )
{
cerr << "Exception Occurred: " << e.what() << endl;
}
© Astronomical Research Cameras, Inc.