ROCKM farm frame-conversion library


This module implements the conversion between the collector format, based on the ROCKM Super-Frames, and the farm specific format.

Index:


The new format specification

The new format is made of:
OffsetNameTypeMeaning
0 Length unsigned int Length of the structure, in bytes, including the length.
The same value as in the collector format.
4 event_number unsigned int
8 data array(arrlen) of slave word
length-4 arrlen unsigned int Nr. of elements in the array.

The format of a slave word is:
[31:27][26:24][23:20][19:13]12,[11:0]
Chain_nrCrate_addrSlave_addrChannel_addrSlave_data


The conversion routine

The conversion from the collector to the new format is done by the
rockm_farm_compact routine.

Syntax:
int rockm_farm_compact(unsigned int chain_nr, unsigned int chan_mask, unsigned int *data);
Parameters:
IN: chain_nr
chain number
IN: chan_mask
AND mask to be used with the Channel_addr
IN: data
data in collector format
OUT: data
data in new format
Returns:
ROCKM_ERROR_FARM_OK if no error found
ROCKM_ERROR_FARM_SUBHEADER if an error is found looking for a sub-header
ROCKM_ERROR_FARM_SLAVE if an error is found looking for a slave
ROCKM_ERROR_FARM_SUBFOOTER if an error is found looking for a sub-footer


Encode/Decode routines

To encode/decode a slave word, use the encode/decode routines:

rockm_farm_raw2farm
Decode a slave word

Syntax:
rockm_farm_raw2farm(/*unsigned int */ raw, /*rockm_farm*/ farm);
Parameters:
IN: raw
a slave word
OUT: farm
the decoded slave word
Returns:
nothing
Note:
Implemented as a macro.

rockm_farm_farm2raw
Encode a slave word

Syntax:
rockm_farm_farm2raw(/*rockm_farm*/ farm);
Parameters:
IN: farm
a decoded slave word
Returns:
The encoded slave word
Note:
Implemented as a macro.

ROCKM documentation. Top of the page.
Send comments to: Igor Sfiligoi

Created:2.9.1997
Last modified:2.9.1997