#include <CVMUSBRemote.h> classCVMUSBRemote
{CVMUSBRemote(std::string deviceName = "vmusb", std::string host = "localhost", unsigned int port = 27000);
virtual ~CVMUSBRemote();
uint32_t readFirmwareID();
void writeGlobalMode(uint16_t value));
uint16_t readGlobalMode();
void writeDAQSettings(uint32_t value);
uint32_t readDAQSettings();
void writeLEDSource(uint32_t value);
uint32_t readLEDSource();
void writeDeviceSource(uint32_t value);
uint32_t readDeviceSource();
void writeDGG_A(uint32_t value);
uint32_t readDGG_A();
void writeDGG_B(uint32_t value);
uint32_t readDGG_B();
void writeDGG_Extended(uint32_t value);
uint32_t readDGG_Extended();
uint32_t readScalerA();
uint32_t readScalerB();
void writeVector(int which, uint32_t value);
uint32_t readVector(int which);
void writeBulkXferSetup(uint32_t value);
uint32_t readBulkXferSetup();
int vmeWrite32(uint32_t address, uint8_t aModifier, uint32_t data);
int vmeRead32(uint32_t address, uint8_t aModifier, uint32_t* data);
int vmeWrite16(uint32_t address, uint8_t aModifier, uint16_t data);
int vmeRead16(uint32_t address, uint8_t aModifier, uint16_t* data);
int vmeWrite8(uint32_t address, uint8_t aModifier, uint8_t data);
int vmeRead8(uint32_t address, uint8_t aModifier, uint8_t* data);
int vmeBlockRead(uint32_t baseAddress, uint8_t aModifier, void* data, size_t transferCount, size_t* countTransferred);
int vmeFifoRead(uint32_t address, uint8_t aModifier, void* data, size_t transferCount, size_t* countTransferred);
int vmeReadBlockCount8(uint32_t address, uint32_t mask, uint8_t amod);
int vmeReadBlockCount16(uint32_t address, uint32_t mask, uint8_t amod);
int vmeReadBlockCount32(uint32_t address, uint32_t mask, uint8_t amod);
int vmeVariableBlockRead(uint32_t address, uint8_t amod, void* data, size_t maxCount, size_t* countTransferred);
int vmeVariableFifoRead(uint32_t address, uint8_t amod, void* data, size_t maxCount, size_t* countTransferred);
int executeList(CVMUSBReadoutList& list, void* pReadBuffer, size_t readBufferSize, size_t* bytesRead);
// Register bit definintions. public: classRegisterOffsets
{ public:static const unsigned int FIDRegister = 0;
static const unsigned int GMODERegister = 4;
static const unsigned int DAQSetRegister = 8;
static const unsigned int LEDSrcRegister = 0xc;
static const unsigned int DEVSrcRegister = 0x10;
static const unsigned int DGGARegister = 0x14;
static const unsigned int DGGBRegister = 0x18;
static const unsigned int ScalerA = 0x1c;
static const unsigned int ScalerB = 0x20;
static const unsigned int ExtractMask = 0x24;
static const unsigned int ISV12 = 0x28;
static const unsigned int ISV34 = 0x2c;
static const unsigned int ISV56 = 0x30;
static const unsigned int ISV78 = 0x34;
static const unsigned int DGGExtended = 0x38;
static const unsigned int USBSetup = 0x3c;
static const unsigned int USBVHIGH1 = 0x40;
static const unsigned int USBVHIGH2 = 0x44;
}; classActionRegister
public:static const uint16_t startDAQ = 1;
static const uint16_t usbTrigger = 2;
static const uint16_t clear = 4;
static const uint16_t sysReset = 8;
static const uint16_t scalerDump = 0x10;
}; classFirmwareRegister
{ public:static const uint32_t minorRevMask = 0x000000ff;
static const uint32_t minorRevShift = 0;
static const uint32_t majorRevMask = 0x0000ff00;
static const uint32_t majorRevShift = 8;
static const uint32_t betaVersionMask = 0x00ff0000;
static const uint32_t betaVersionShift = 16;
static const uint32_t yearMask = 0x0f000000;
static const uint32_t yearShift = 24;
static const uint32_t monthMask = 0xf0000000;
static const uint32_t monthshift = 27;
}; classGlobalModeRegister
{ public:static const uint16_t bufferLenMask = 0xf;
static const uint16_t bufferLenShift = 0;
static const uint16_t bufferLen13K = 0;
static const uint16_t bufferLen8K = 1;
static const uint16_t bufferLen4K = 2;
static const uint16_t bufferLen2K = 3;
static const uint16_t bufferLen1K = 4;
static const uint16_t bufferLen512 = 5;
static const uint16_t bufferLen256 = 6;
static const uint16_t bufferLen128 = 7;
static const uint16_t bufferLen64 = 8;
static const uint16_t bufferLenSingle = 9;
static const uint16_t mixedBuffers = 0x20;
static const uint16_t doubleSeparater = 0x40;
static const uint16_t align32 = 0x80;
static const uint16_t doubleHeader = 0x100;
static const uint16_t flushScalers = 0x200;
static const uint16_t busReqLevelMask = 0x7000;
static const uint16_t busReqLevelShift = 12;
}; classDAQSettingsRegister
{ public:static const uint32_t readoutTriggerDelayMask = 0xff;
static const uint32_t readoutTriggerDelayShift = 0;
static const uint32_t scalerReadoutPeriodMask = 0xff00;
static const uint32_t scalerReadoutPeriodShift = 8;
static const uint32_t scalerReadoutFrequenyMask = 0xffff0000;
static const uint32_t scalerReadoutFrequencyShift = 16;
}; classLedSourceRegister
{ public: // Top yellow led:static const uint32_t topYellowOutFifoNotEmpty = 0;
static const uint32_t topYellowInFifoNotEmpty = 1;
static const uint32_t topYellowScalerEvent = 2;
static const uint32_t topYellowInFifoFull = 3;
static const uint32_t topYellowDTACK = 4;
static const uint32_t topYellowBERR = 5;
static const uint32_t topYellowBusRequest = 6;
static const uint32_t topYellowBusGranted = 7;
static const uint32_t topYellowInvert = 0x8;
static const uint32_t topYellowLatch = 0x10;
// Red LED:static const uint32_t redEventTrigger = (0 << 8);
static const uint32_t redNimInput1 = (1 << 8);
static const uint32_t redNimInput2 = (2 << 8);
static const uint32_t redBusy = (3 << 8);
static const uint32_t redDTACK = (4 << 8);
static const uint32_t redBERR = (5 << 8);
static const uint32_t redBusRequest = (6 << 8);
static const uint32_t redBusGranted = (7 << 8);
static const uint32_t redInvert = (8 << 8);
static const uint32_t redLatch = (0x10 << 8);
// Green led:static const uint32_t greenAcquire = (0 << 16);
static const uint32_t greenStackNotEmpty = (1 << 16);
static const uint32_t greenEventReady = (2 << 16);
static const uint32_t greenEventTrigger = (3 << 16);
static const uint32_t greenDTACK = (4 << 16);
static const uint32_t greenBERR = (5 << 16);
static const uint32_t greenBusRequest = (6 << 16);
static const uint32_t greenBusGranted = (7 << 16);
static const uint32_t greenInvert = (8 << 16);
static const uint32_t greenLatch = (0x10 << 16);
// Bottom yellow LEDstatic const uint32_t bottomYellowNotArbiter = (0 << 24);
static const uint32_t bottomYellowUsbTrigger = (1 << 24);
static const uint32_t bottomYellowUSBReset = (2 << 24);
static const uint32_t bottomYellowBERR1 = (3 << 24);
static const uint32_t bottomYellowDTACK = (4 << 24);
static const uint32_t bottomYellowBERR = (5 << 24);
static const uint32_t bottomYellowBusRequest = (6 << 24);
static const uint32_t bottomYellowBusGranted = (7 << 24);
static const uint32_t bottomYellowInvert = (8 << 24);
static const uint32_t bottomYellowLatch = (0x10 << 24);
}; classCVMUSB::DeviceSourceRegister
{static const uint32_t nimO1Busym = 0;
static const uint32_t nimO1Trigger = 1;
static const uint32_t nimO1BusRequest = 2;
static const uint32_t nimO1EventToBuffer = 3;
static const uint32_t nimO1DGGA = 4;
static const uint32_t nimO1DGGB = 5;
static const uint32_t nimO1EndOfEvent = 6;
static const uint32_t nimO1UsbTrigger = 7;
static const uint32_t nimO1Invert = 8M;
static const uint32_t nimO1Latch = 0x10;
static const uint32_t nimO2UsbTrigger1 = (0 << 8);
static const uint32_t nimO2VMEExecuting = (1 << 8);
static const uint32_t nimO2VMEAS = (2 << 8);
static const uint32_t nimO2DataToUsbFIFO = (3 << 8);
static const uint32_t nimO2DGGA = (4 << 8);
static const uint32_t nimO2DGGB = (5 << 8);
static const uint32_t nimO2EndOfEvent = (6 << 8);
static const uint32_t nimO2UsbTrigger = (7 << 8);
static const uint32_t nimO2Invert = (8 << 8);
static const uint32_t nimO2Latch = (0x10 << 8);
static const uint32_t scalerADisabled = (0 << 16);
static const uint32_t scalerANIMI1 = (1 << 16);
static const uint32_t scalerANIMI2 = (2 << 16);
static const uint32_t scalerAEvent = (2 << 16);
static const uint32_t scalerAEnable = (8 << 16);
static const uint32_t scalerAReset = (0x10 << 16);
static const uint32_t scalerBDisabled = (0 << 20);
static const uint32_t scalerBNIMI1 = (1 << 20);
static const uint32_t scalerBNIMI2 = (2 << 20);
static const uint32_t scalerBEvent = (2 << 20);
static const uint32_t scalerBEnable = (8 << 20);
static const uint32_t scalerBReset = (0x10 << 20);
static const uint32_t dggADisabled = (0 << 24);
static const uint32_t dggANIMI1 = (1 << 24);
static const uint32_t dggANIMI2 = (2 << 24);
static const uint32_t dggAEventTrigger = (3 << 24);
static const uint32_t dggAEndOfEvent = (4 << 24);
static const uint32_t dggAUsbTrigger = (5 << 24);
static const uint32_t dggAPulser = (6 << 24);
static const uint32_t dggBDisabled = (0 << 28);
static const uint32_t dggBNIMI1 = (1 << 28);
static const uint32_t dggBNIMI2 = (2 << 28);
static const uint32_t dggBEventTrigger = (3 << 28);
static const uint32_t dggBEndOfEvent = (4 << 28);
static const uint32_t dggBUsbTrigger = (5 << 28);
static const uint32_t dggBPulser = (6 << 28);
}; classCVMUSB::DGGAndPulserRegister
{static const uint32_t dggFineDelayMask = 0xffff;
static const uint32_t dggFineDelayShift = 0;
static const uint32_t dggGateWidthMask = 0xffff0000;
static const uint32_t dggGateWidthShift = 16;
}; classCVMUSB::DGGCoarseRegister
{static const uint32_t ACoarseMask = 0xffff;
static const uint32_t ACoarseShift = 0;
static const uint32_t BCoarseMask = 0xffff0000;
static const uint32_t BCoarseShift = 16;
}; classCVMUSB::ISVRegister
{static const uint32_t AVectorMask = = 0xff;
static const uint32_t AVectorShift = 0;
static const uint32_t AIPLMask = 0x700;
static const uint32_t AIPLShift = 8;
static const uint32_t AStackIDMask = 0x7000;
static const uint32_t AStackIDShift = 12;
static const uint32_t BVectorMask = 0xff0000;
static const uint32_t BVectorShift = 16;
static const uint32_t BIPLMask = 0x7000000;
static const uint32_t BIPLShift = 24;
static const uint32_t BStackIDMask = 0x70000000;
static const uint32_t BStackIDShift = 28;
}; classCVMUSB::TransferSetupRegister
{static const uint32_t multiBufferCountMask = 0xff;
static const uint32_t multiBufferCountShift = 0;
static const uint32_t timeoutMask = 0xf00;
static const uint32_t timeoutShift = 8;
}; };
Provides remote access to the VM-USB via the VMUSBReadout's slow controls server. This class is a proxy and transparently performs network operations with the slow control server to execute each method.
With the exception of the constructor, please refer to CVMUSB for per method documentation. The constructor forms a connection with the VMUSBReadout's control server or throws an exception if that is not possible.
The parameter constrcutors are:
std::string deviceName = "vmusb";
The n ame of the device driver to direct requests to. This is the name of the driver instance created by the Module command in the control configuration file.
std::string host = "localhost";
The host in which the readout software is running.
unsigned int port = 27000;
The port on which the control server is running.