PXIE Loss Detection

A VxWorks task has been written to interface to the Control Department's MOOC framework allowing the task to be controlled via ACNET. The driver exports several functions. Some are to be used in VxWorks startup scripts and others can be invoked from the VxWorks shell. Although the source compiles for several targets, we've only done extensive testing on MVME-5500 boards running VxWorks 6.4.

Startup Example

Here's an example of using the driver:

ld (1, 1, "vxworks_boot/v6.4/module/mv5500/mooc-4.7.out");

ld (1,1,"vxworks_boot/v6.4/module/mv5500/peci-1.3.out");



STATUS PXIELOSS_create_mooc_class(uint8_t cls);

This function should be called once in a front-end's startup script. It attaches the device driver to MOOC and allows instances to be created (via PXIELOSS_create_mooc_instance()). The parameter, cls, is a "class code" to use for the class. On a given front-end, all class codes need to be unique.

STATUS PXIELOSS_create_mooc_instance(unsigned short oid, int dip, int intLevel, int vector, void* a32base);

Used in startup scripts, this function creates an instance of a MOOC class (i.e. driver). The startup script should have previously called PXIELOSS_create_mooc_class().

oid represents the instance's "object ID", which needs to be unique on the front-end. All ACNET devices that refer to this instance will have the second word of their SSDN set to this value. The parameter, dip, should be set to the board's DIP switch setting (your kernel needs to have a working sysBusToLocalAdrs() for this to work properly.) intLevel specifies which VME interrupt level should be used. vector is the number of the interrupt vector the driver will use to handle interrupts. The board has a large buffer, located in A32 space, to hold waveforms. The last parameter, a32base, specifies where in A32 space the driver should locate the waveform buffer.

If the function detects and initializes the hardware correctly, this function returns OK. Any errors results in ERROR being returned.


PXIELOSS_max_tick represents, in microseconds, the time between updates. The driver wants to be updated at 8 kHz, so this variable should be very close to 125.

PXIELOSS_max_time represents, in microseconds, the time it takes to complete an iteration of detecting and responding to losses. The time is measured from when the task wakes up until it sets the computed state of the source.