JLab Pipeline TS Library  3v7.1
Status

Functions

void tsStatus (int pflag)
 Print some status information of the TS to standard out. More...
 
int tsGetPortTrigSrcEnabled (int port)
 Get the trigger sources enabled bits of the selected port. More...
 
int tsGetTrigSrcEnabledFiberMask ()
 Returns the mask of fiber channels that report a "connected" status from a TI has it's trigger source enabled. More...
 
int tsGetFirmwareVersion ()
 Get the Firmware Version. More...
 
unsigned int tsGetSerialNumber (char **rSN)
 Get the Module Serial Number. More...
 
int tsGetCrateID (int port)
 Get the crate ID of the selected port. More...
 
int tsGetNextBlockLevel ()
 Get the block level that will be updated on the end of the block readout. More...
 
int tsGetCurrentBlockLevel ()
 Get the current block level. More...
 
int tsGetInstantBlockLevelChange ()
 Get Status of instant blocklevel change when broadcast is received. More...
 
int tsGetPrescale ()
 Get the current prescale factor. More...
 
unsigned int tsGetTriggerPrescaleMask (int type, int bank)
 FIXME: This is not quite right. More...
 
unsigned long long int tsGetEventCounter ()
 Returns the event counter (48 bit) More...
 
unsigned int tsGetBlockLimit ()
 Returns the value that is currently programmed as the block limit. More...
 
int tsGetBlockLimitStatus ()
 Get the current status of the block limit. More...
 
unsigned int tsGetIntCount ()
 Return current readout count. More...
 
int tsGetTriggerHoldoff (int rule)
 Get the value for a specified trigger rule. More...
 
int tsGetTriggerHoldoffMin (int rule, int pflag)
 Get the value for a specified trigger rule minimum busy. More...
 
int tsGetSpecialEventType (int trigOpt)
 Get the trigger type for the specified special trigger. More...
 
void tsPrintTriggerTable (int inputType, int subGroup, int showbits)
 Print trigger table to standard out. More...
 
unsigned int tsGetLiveTime ()
 Return the current "live" time of the module. More...
 
unsigned int tsGetBusyTime ()
 Return the current "busy" time of the module. More...
 
unsigned int tsGetLiveTime_InputHigh ()
 Return the current "live" time of the module. More...
 
unsigned int tsGetBusyTime_InputHigh ()
 Return the current "busy" time of the module. More...
 
int tsLive (int sflag)
 Calculate the live time (percentage) from the live and busy time scalers. More...
 
unsigned int tsBlockStatus (int fiber, int pflag)
 Show block Status of specified fiber. More...
 
int tsGetBusyStatus (int pflag)
 Returns the bits that are contributing to the current busy state. More...
 
int tsCurrentBlockFilled (unsigned short npoll)
 Poll the TS to determine status of current block, for specified number of times. Return immediately when block has been filed, or when timeout has occurred. More...
 
int tsGetFPDelay (int chan)
 Get the input delay for teh specified front panel input (0-31) More...
 
int tsPrintFPDelay ()
 Print Front Panel Channel Delays to Standard Out. More...
 
int tsGetTSIODrive ()
 Return the Enable/Disable status the FPGA drive to the TSIO. More...
 
int tsGetDriverSupportedVersion ()
 Return the Firmware Version that is Supported by the Library. More...
 
int tsGetTrigCoinWindow ()
 Get the trigger coincidence window. More...
 
int tsGetTrigInhibitWindow ()
 Get the trigger inhibit window. More...
 

Detailed Description

Function Documentation

◆ tsBlockStatus()

unsigned int tsBlockStatus ( int  fiber,
int  pflag 
)

Show block Status of specified fiber.

Parameters
fiberFiber port to show
pflagWhether or not to print to standard out
Returns
0

References TS_A24RegStruct::adr24, TS_A24RegStruct::blockStatus, TS_BLOCKSTATUS_NBLOCKS_NEEDACK0, and TS_BLOCKSTATUS_NBLOCKS_READY0.

◆ tsCurrentBlockFilled()

int tsCurrentBlockFilled ( unsigned short  npoll)

Poll the TS to determine status of current block, for specified number of times. Return immediately when block has been filed, or when timeout has occurred.

Parameters
npollNumber of times to poll TS, before timeout declared
Returns
OK if Block Is Filled, otherwise ERROR

References TS_A24RegStruct::nblocks, TS_NBLOCKS_EVENTS_IN_BLOCK_MASK, tsGetCurrentBlockLevel(), TSLOCK, and TSUNLOCK.

Referenced by tsDisableTriggerSource().

◆ tsGetBlockLimit()

unsigned int tsGetBlockLimit ( )

Returns the value that is currently programmed as the block limit.

Returns
Current Block Limit if successful, otherwise ERROR

References TS_A24RegStruct::blocklimit, TSLOCK, and TSUNLOCK.

◆ tsGetBlockLimitStatus()

int tsGetBlockLimitStatus ( )

Get the current status of the block limit.

Returns
1 if block limit has been reached, 0 if not, otherwise ERROR;

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

◆ tsGetBusyStatus()

◆ tsGetBusyTime()

unsigned int tsGetBusyTime ( )

Return the current "busy" time of the module.

Returns
The current live time in units of 7.68 us

References TS_A24RegStruct::busytime, TSLOCK, and TSUNLOCK.

◆ tsGetBusyTime_InputHigh()

unsigned int tsGetBusyTime_InputHigh ( )

Return the current "busy" time of the module.

Returns
The current live time in units of 7.68 us

References PartitionStruct::hel_busytime, TS_A24RegStruct::part1, TSLOCK, and TSUNLOCK.

◆ tsGetCrateID()

int tsGetCrateID ( int  port)

Get the crate ID of the selected port.

Parameters
port
  • 0 - Self
  • 1-2 - Fiber port 1-2
Returns
port Crate ID if successful, ERROR otherwise

References TS_A24RegStruct::hfbr_tiID, TS_A24RegStruct::master_tiID, TS_ID_CRATEID_MASK, TSLOCK, and TSUNLOCK.

◆ tsGetCurrentBlockLevel()

int tsGetCurrentBlockLevel ( )

Get the current block level.

Returns
Next Block Level if successful, ERROR otherwise

References TS_A24RegStruct::blocklevel, TS_BLOCKLEVEL_CURRENT_MASK, TS_BLOCKLEVEL_RECEIVED_MASK, tsBlockLevel, tsDisableBusError(), tsEnableBusError(), TSLOCK, tsNextBlockLevel, and TSUNLOCK.

Referenced by tsCurrentBlockFilled(), and tsStatus().

◆ tsGetDriverSupportedVersion()

int tsGetDriverSupportedVersion ( )

Return the Firmware Version that is Supported by the Library.

Returns
Firmware Version

References TS_SUPPORTED_FIRMWARE.

◆ tsGetEventCounter()

unsigned long long int tsGetEventCounter ( )

Returns the event counter (48 bit)

Returns
Number of accepted events if successful, otherwise ERROR

References TS_A24RegStruct::eventNumber_hi, TS_A24RegStruct::eventNumber_lo, TS_EVENTNUMBER_HI_MASK, TSLOCK, and TSUNLOCK.

Referenced by tsStatus().

◆ tsGetFirmwareVersion()

int tsGetFirmwareVersion ( )

Get the Firmware Version.

Returns
Firmware Version if successful, ERROR otherwise

References TS_A24RegStruct::JTAGFPGABase, TS_A24RegStruct::reset, TS_RESET_JTAG, TSLOCK, and TSUNLOCK.

Referenced by tsPartInit().

◆ tsGetFPDelay()

int tsGetFPDelay ( int  chan)

Get the input delay for teh specified front panel input (0-31)

Parameters
chanFront Panel Input Channel (0-31)
Returns
Channel delay (units of 4ns) if successful, otherwise ERROR

References TS_A24RegStruct::fpDelay, TS_FPDELAY_MASK, TSLOCK, and TSUNLOCK.

◆ tsGetInstantBlockLevelChange()

int tsGetInstantBlockLevelChange ( )

Get Status of instant blocklevel change when broadcast is received.

Returns
1 if enabled, 0 if disabled , ERROR otherwise

References TS_VMECONTROL_BLOCKLEVEL_UPDATE, TSLOCK, TSUNLOCK, and TS_A24RegStruct::vmeControl.

◆ tsGetIntCount()

unsigned int tsGetIntCount ( )

Return current readout count.

References tsIntCount.

◆ tsGetLiveTime()

unsigned int tsGetLiveTime ( )

Return the current "live" time of the module.

Returns
The current live time in units of 7.68 us

References TS_A24RegStruct::livetime, TSLOCK, and TSUNLOCK.

◆ tsGetLiveTime_InputHigh()

unsigned int tsGetLiveTime_InputHigh ( )

Return the current "live" time of the module.

Returns
The current live time in units of 7.68 us

References PartitionStruct::hel_livetime, TS_A24RegStruct::part1, TSLOCK, and TSUNLOCK.

◆ tsGetNextBlockLevel()

int tsGetNextBlockLevel ( )

Get the block level that will be updated on the end of the block readout.

Returns
Next Block Level if successful, ERROR otherwise

References TS_A24RegStruct::blocklevel, TS_BLOCKLEVEL_CURRENT_MASK, TS_BLOCKLEVEL_RECEIVED_MASK, tsBlockLevel, TSLOCK, tsNextBlockLevel, and TSUNLOCK.

Referenced by tsBroadcastNextBlockLevel().

◆ tsGetPortTrigSrcEnabled()

int tsGetPortTrigSrcEnabled ( int  port)

Get the trigger sources enabled bits of the selected port.

Parameters
port
  • 0 - Self
  • 1-2 - Fiber port 1-2
Returns
bitmask of rigger sources enabled if successful, otherwise ERROR bitmask
  • 0 - P0
  • 1 - Fiber 1
  • 2 - Loopback
  • 3 - TRG (FP)
  • 4 - VME
  • 5 - TS Inputs (FP)
  • 6 - TS (rev 2)
  • 7 - Internal Pulser

References TS_A24RegStruct::hfbr_tiID, TS_A24RegStruct::master_tiID, TS_ID_TRIGSRC_ENABLE_MASK, TSLOCK, and TSUNLOCK.

◆ tsGetPrescale()

int tsGetPrescale ( )

Get the current prescale factor.

Returns
Current prescale factor, otherwise ERROR.

References TS_A24RegStruct::trig1Prescale, TSLOCK, and TSUNLOCK.

◆ tsGetSerialNumber()

unsigned int tsGetSerialNumber ( char **  rSN)

Get the Module Serial Number.

Parameters
rSNPointer to string to pass Serial Number
Returns
SerialNumber if successful, ERROR otherwise

References TS_A24RegStruct::JTAGPROMBase, TS_A24RegStruct::reset, TS_RESET_JTAG, TSLOCK, and TSUNLOCK.

◆ tsGetSpecialEventType()

int tsGetSpecialEventType ( int  trigOpt)

Get the trigger type for the specified special trigger.

Parameters
trigOptTrigger Option 0: Software (default = 253) 1: Pulser (default = 254) 2: Multiple GTP or FP Hits (default = 250) 3: Combined GTP and FP Hits (default = 251)
Returns
Event Type if successful, otherwise ERROR

References TS_A24RegStruct::specialEvTypes, TS_SPECIALEVTYPES_GTP_AND_FP_MASK, TS_SPECIALEVTYPES_MULT_GTP_OR_FP_MASK, TS_SPECIALEVTYPES_PULSER_MASK, TS_SPECIALEVTYPES_VME_MASK, TSLOCK, and TSUNLOCK.

◆ tsGetTrigCoinWindow()

int tsGetTrigCoinWindow ( )

Get the trigger coincidence window.

Returns
Size of the coincidence window in units of 4ns if successful, otherwise ERROR

References TS_A24RegStruct::triggerWindow, TS_TRIGGERWINDOW_COINC_MASK, TSLOCK, and TSUNLOCK.

◆ tsGetTriggerHoldoff()

int tsGetTriggerHoldoff ( int  rule)

Get the value for a specified trigger rule.

Parameters
rulethe number of triggers within some time period.. e.g. rule=1: No more than ONE trigger within the specified time period
Returns
If successful, returns the value (in steps of 16ns) for the specified rule. ERROR, otherwise.

References TS_A24RegStruct::triggerRule, TS_TRIGGERRULE_RULE1_MASK, TS_TRIGGERRULE_RULE2_MASK, TS_TRIGGERRULE_RULE3_MASK, TS_TRIGGERRULE_RULE4_MASK, TSLOCK, and TSUNLOCK.

◆ tsGetTriggerHoldoffMin()

int tsGetTriggerHoldoffMin ( int  rule,
int  pflag 
)

Get the value for a specified trigger rule minimum busy.

Parameters
rulethe number of triggers within some time period.. e.g. rule=1: No more than ONE trigger within the specified time period
pflagif not 0, print the setting to standard out.
Returns
If successful, returns the value (in steps of 16ns for rule 2, 480ns otherwise) for the specified rule. ERROR, otherwise.

References TS_A24RegStruct::part1, PartitionStruct::triggerRuleMin, TS_TRIGGERRULEMIN_MIN2_EN, TS_TRIGGERRULEMIN_MIN2_MASK, TS_TRIGGERRULEMIN_MIN3_EN, TS_TRIGGERRULEMIN_MIN3_MASK, TS_TRIGGERRULEMIN_MIN4_EN, TS_TRIGGERRULEMIN_MIN4_MASK, TSLOCK, and TSUNLOCK.

◆ tsGetTriggerPrescaleMask()

unsigned int tsGetTriggerPrescaleMask ( int  type,
int  bank 
)

FIXME: This is not quite right.

References TS_A24RegStruct::fpInputPrescale, TS_A24RegStruct::GTPprescale, TSLOCK, and TSUNLOCK.

◆ tsGetTrigInhibitWindow()

int tsGetTrigInhibitWindow ( )

Get the trigger inhibit window.

Returns
Size of the inhibit window in units of 4ns if successful, otherwise ERROR

References TS_A24RegStruct::triggerWindow, TS_TRIGGERWINDOW_INHIBIT_MASK, TSLOCK, and TSUNLOCK.

◆ tsGetTrigSrcEnabledFiberMask()

int tsGetTrigSrcEnabledFiberMask ( )

Returns the mask of fiber channels that report a "connected" status from a TI has it's trigger source enabled.

Returns
Trigger Source Enabled Mask

References TS_A24RegStruct::hfbr_tiID, TS_ID_TRIGSRC_ENABLE_MASK, TSLOCK, and TSUNLOCK.

◆ tsGetTSIODrive()

int tsGetTSIODrive ( )

Return the Enable/Disable status the FPGA drive to the TSIO.

Returns
1 if enabled, 0 if disabled, otherwise ERROR

References TS_VMECONTROL_DRIVE_TSIO_EN, TSLOCK, TSUNLOCK, and TS_A24RegStruct::vmeControl.

◆ tsLive()

int tsLive ( int  sflag)

Calculate the live time (percentage) from the live and busy time scalers.

Parameters
sflagif > 0, then returns the integrated live time
Returns
live time as a 3 digit integer % (e.g. 987 = 98.7%)

References TS_A24RegStruct::busytime, TS_A24RegStruct::livetime, TS_A24RegStruct::reset, TS_RESET_LATCH_TIMERS, TSLOCK, and TSUNLOCK.

◆ tsPrintFPDelay()

int tsPrintFPDelay ( )

Print Front Panel Channel Delays to Standard Out.

Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::fpDelay, TS_FPDELAY_MASK, TSLOCK, and TSUNLOCK.

◆ tsPrintTriggerTable()

void tsPrintTriggerTable ( int  inputType,
int  subGroup,
int  showbits 
)

Print trigger table to standard out.

Parameters
inputTypeInput Type 0: GTP 1: FP
subGroupEach input type is grouped into 8 channels. 0: 1-8 1: 9-16 2: 17-24 3: 25-32
showbitsShow trigger bit pattern, instead of hex

◆ tsStatus()