JLab Pipeline TS Library  3v7.1
Data Readout

Functions

int tsReadBlock (volatile unsigned int *data, int nwrds, int rflag)
 Read a block of events from the TI. More...
 
int tsReadTriggerBlock (volatile unsigned int *data)
 Read a block from the TS and form it into a CODA Trigger Bank. More...
 
int tsReadScalers (volatile unsigned int *data, int choice)
 Readout input scalers Returned data: bit 31 0: As stored 1: Shifted by 7 bits (must multiply by 2**7) More...
 
int tsPrintScalers (int choice)
 Print input scalers to standard out. More...
 
unsigned int tsBReady ()
 Returns the number of Blocks available for readout. More...
 
int tsGetSyncEventFlag ()
 Return the value of the Synchronization flag, obtained from tsBReady. i.e. Return the value of the SyncFlag for the current readout block. More...
 
int tsGetSyncEventReceived ()
 Return the value of whether or not the sync event has been received. More...
 
int tsForceSyncEvent ()
 Force a sync event (type = 0). More...
 
int tsSyncResetRequest ()
 Sync Reset Request is sent to TI-Master or TS. More...
 
int tsGetSyncResetRequest ()
 Determine if a TI has requested a Sync Reset. More...
 
int tsFillToEndBlock ()
 Generate non-physics triggers until the current block is filled. This feature is useful for "end of run" situations. More...
 
int tsReadScalersMon (volatile unsigned int *data)
 Readout input scalers Returned data: bit 31 0: As stored 1: Shifted by 7 bits (must multiply by 2**7) More...
 

Detailed Description

Function Documentation

◆ tsBReady()

unsigned int tsBReady ( )

Returns the number of Blocks available for readout.

Returns
Number of blocks available for readout if successful, otherwise ERROR

References TS_A24RegStruct::blockBuffer, TS_BLOCKBUFFER_BLOCKS_READY_MASK, TS_BLOCKBUFFER_BREADY_INT_MASK, and TSLOCK.

◆ tsFillToEndBlock()

int tsFillToEndBlock ( )

Generate non-physics triggers until the current block is filled. This feature is useful for "end of run" situations.

Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::reset, TS_RESET_FILL_TO_END_BLOCK, TSLOCK, and TSUNLOCK.

Referenced by tsDisableTriggerSource().

◆ tsForceSyncEvent()

int tsForceSyncEvent ( )

Force a sync event (type = 0).

Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::reset, TS_RESET_FORCE_SYNCEVENT, TSLOCK, and TSUNLOCK.

◆ tsGetSyncEventFlag()

int tsGetSyncEventFlag ( )

Return the value of the Synchronization flag, obtained from tsBReady. i.e. Return the value of the SyncFlag for the current readout block.

See also
tsBReady
Returns
  • 1: if current readout block contains a Sync Event.
  • 0: Otherwise

References TSLOCK.

◆ tsGetSyncEventReceived()

int tsGetSyncEventReceived ( )

Return the value of whether or not the sync event has been received.

Returns
  • 1: if sync event received
  • 0: Otherwise

References TSLOCK.

◆ tsGetSyncResetRequest()

int tsGetSyncResetRequest ( )

Determine if a TI has requested a Sync Reset.

Returns
1 if requested received, 0 if not, otherwise ERROR

References TS_A24RegStruct::blockBuffer, TS_BLOCKBUFFER_SYNCRESET_REQUESTED, TSLOCK, and TSUNLOCK.

◆ tsPrintScalers()

int tsPrintScalers ( int  choice)

Print input scalers to standard out.

Parameters
choice
  • 1-4: Scaler set (1-4)
Returns
Number of words transferred to data if successful, ERROR otherwise

References TS_SCALER_SCALE_HI, and tsReadScalers().

◆ tsReadBlock()

int tsReadBlock ( volatile unsigned int *  data,
int  nwrds,
int  rflag 
)

Read a block of events from the TI.

Parameters
data- local memory address to place data
nwrds- Max number of words to transfer
rflag- Readout Flag
  • 0 - programmed I/O from the specified board
  • 1 - DMA transfer using Universe/Tempe DMA Engine (DMA VME transfer Mode must be setup prior)
Returns
Number of words transferred to data if successful, ERROR otherwise

References TSLOCK, and TSpd.

Referenced by tsReadTriggerBlock().

◆ tsReadScalers()

int tsReadScalers ( volatile unsigned int *  data,
int  choice 
)

Readout input scalers Returned data: bit 31 0: As stored 1: Shifted by 7 bits (must multiply by 2**7)

Parameters
data- local memory address to place scaler data
choice
  • 1-4: Scaler set (1-4)
Returns
Number of words transferred to data if successful, ERROR otherwise

References ScalerStruct::fp, ScalerStruct::gen, ScalerStruct::GTP, TS_A24RegStruct::Scalers1, TS_A24RegStruct::Scalers2, TS_A24RegStruct::Scalers3, TS_A24RegStruct::Scalers4, TS_SCALER_SCALE_HI, TS_SCALER_SCALE_HI_LSB_MASK, TS_SCALER_SCALE_HI_MSB_MASK, TSLOCK, and TSUNLOCK.

Referenced by tsPrintScalers().

◆ tsReadScalersMon()

int tsReadScalersMon ( volatile unsigned int *  data)

Readout input scalers Returned data: bit 31 0: As stored 1: Shifted by 7 bits (must multiply by 2**7)

Parameters
data- local memory address to place scaler data
Returns
Number of words transferred to data if successful, ERROR otherwise

References TS_A24RegStruct::busytime, ScalerStruct::gen, ScalerStruct::GTP, TS_A24RegStruct::livetime, TS_A24RegStruct::reset, TS_A24RegStruct::Scalers1, TS_A24RegStruct::Scalers2, TS_A24RegStruct::Scalers3, TS_A24RegStruct::Scalers4, TS_RESET_LATCH_TIMERS, TS_SCALER_SCALE_HI, TS_SCALER_SCALE_HI_LSB_MASK, TS_SCALER_SCALE_HI_MSB_MASK, TSLOCK, and TSUNLOCK.

◆ tsReadTriggerBlock()

int tsReadTriggerBlock ( volatile unsigned int *  data)

Read a block from the TS and form it into a CODA Trigger Bank.

Parameters
data- local memory address to place data
Returns
Number of words transferred to data if successful, ERROR otherwise

References TS_DATAFORMAT_DATA_TYPE_WORD, TS_DATAFORMAT_TYPE_BLOCK_HEADER, TS_DATAFORMAT_TYPE_BLOCK_TRAILER, TS_DATAFORMAT_TYPE_MASK, tsBlockLevel, and tsReadBlock().

◆ tsSyncResetRequest()

int tsSyncResetRequest ( )

Sync Reset Request is sent to TI-Master or TS.

This option is available for multicrate systems when the synchronization is suspect. It should be exercised only during "sync events" where the requested sync reset will immediately follow all ROCs concluding their readout.

Returns
OK if successful, otherwise ERROR

References TSLOCK.