JLab Pipeline TI Library  3v6.1
Status

Modules

 Master Status
 

Functions

void tiStatus (int pflag)
 Print some status information of the TI to standard out. More...
 
int tiGetSlavePort ()
 Returns the port of which the TI Slave has been configured (or will be) More...
 
void tiSlaveStatus (int pflag)
 Print a summary of all fiber port connections to potential TI Slaves. More...
 
int tiGetFirmwareVersion ()
 Get the Firmware Version. More...
 
unsigned int tiGetSerialNumber (char **rSN)
 Get the Module Serial Number. More...
 
int tiGetCrateID (int port)
 Get the crate ID of the selected port. More...
 
int tiGetPortTrigSrcEnabled (int port)
 Get the trigger sources enabled bits of the selected port. More...
 
int tiGetSlaveBlocklevel (int port)
 Get the blocklevel of the TI-Slave on the selected port. More...
 
int tiGetNextBlockLevel ()
 Get the block level that will be updated on the end of the block readout. More...
 
int tiGetCurrentBlockLevel ()
 Get the current block level. More...
 
int tiGetInstantBlockLevelChange ()
 Get Status of instant blocklevel change when broadcast is received. More...
 
int tiGetPrescale ()
 Get the current prescale factor. More...
 
int tiGetInputPrescale (int input)
 Get the current prescale factor for the selected input. More...
 
int tiGetPromptTriggerWidth ()
 Get the width of the prompt trigger from OT#2. More...
 
unsigned long long int tiGetEventCounter ()
 Returns the event counter (48 bit) More...
 
unsigned int tiGetBlockLimit ()
 Returns the value that is currently programmed as the block limit. More...
 
int tiGetBlockLimitStatus ()
 Get the current status of the block limit. More...
 
int tiGetClockSource ()
 Get the current clock source. More...
 
int tiGetTriggerHoldoff (int rule)
 Get the value for a specified trigger rule. More...
 
int tiGetTriggerHoldoffMin (int rule, int pflag)
 Get the value for a specified trigger rule minimum busy. More...
 
unsigned int tiGetLiveTime ()
 Return the current "live" time of the module. More...
 
unsigned int tiGetBusyTime ()
 Return the current "busy" time of the module. More...
 
int tiLive (int sflag)
 Calculate the live time (percentage) from the live and busy time scalers. More...
 
unsigned int tiGetTSscaler (int input, int latch)
 Get the current counter for the specified TS Input. More...
 
unsigned int tiBlockStatus (int fiber, int pflag)
 Show block Status of specified fiber. More...
 
int tiGetFiberLatencyMeasurement ()
 Return measured fiber length. More...
 
int tiGetLastSyncCodes (int pflag)
 Return last SyncCommand received. More...
 
int tiGetSyncHistoryBufferStatus (int pflag)
 Get the status of the SyncCommand History Buffer. More...
 
void tiPrintSyncHistory ()
 Print to standard out the history buffer of Sync Commands received. More...
 
int tiGetTSInputDelay (int chan)
 Get the input delay for the specified front panel TSinput (1-6) More...
 
int tiPrintTSInputDelay ()
 Print Front Panel TSinput Delays to Standard Out. More...
 
unsigned int tiGetGTPBufferLength (int pflag)
 Return value of buffer length from GTP. More...
 
unsigned int tiGetSWAStatus (int reg)
 Return the value from the SWa fast link register. More...
 
unsigned int tiGetSWBStatus (int reg)
 Return the value from the SWB fast link register. More...
 
int tiGetGeoAddress ()
 Return geographic address as provided from a VME-64X crate. More...
 
unsigned int tiGetIntCount ()
 Return current readout count. More...
 
unsigned int tiGetAckCount ()
 Return current acknowledge count. More...
 
int tiGetSWBBusy (int pflag)
 Return status of Busy from SWB. More...
 
unsigned int tiGetBusyCounter (int busysrc)
 Return BUSY counter for specified Busy Source. More...
 
int tiPrintBusyCounters ()
 Print the BUSY counters for all busy sources. More...
 

Detailed Description

Function Documentation

◆ tiBlockStatus()

unsigned int tiBlockStatus ( 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 TI_A24RegStruct::adr24, TI_A24RegStruct::blockStatus, TI_BLOCKSTATUS_NBLOCKS_NEEDACK0, and TI_BLOCKSTATUS_NBLOCKS_READY0.

◆ tiGetAckCount()

unsigned int tiGetAckCount ( )

Return current acknowledge count.

References tiAckCount, TILOCK, and TIUNLOCK.

◆ tiGetBlockLimit()

unsigned int tiGetBlockLimit ( )

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

Returns
Current Block Limit if successful, otherwise ERROR

References TI_A24RegStruct::blocklimit, TILOCK, and TIUNLOCK.

◆ tiGetBlockLimitStatus()

int tiGetBlockLimitStatus ( )

Get the current status of the block limit.

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

References TI_A24RegStruct::blockBuffer, TI_BLOCKBUFFER_BUSY_ON_BLOCKLIMIT, TILOCK, and TIUNLOCK.

◆ tiGetBusyCounter()

unsigned int tiGetBusyCounter ( int  busysrc)

Return BUSY counter for specified Busy Source.

Parameters
busysrc
  • 0: SWA
  • 1: SWB
  • 2: P2
  • 3: FP-FTDC
  • 4: FP-FADC
  • 5: FP
  • 6: Unused
  • 7: Loopack
  • 8-15: Fiber 1-8
Returns
  • Busy counter for specified busy source

References TI_A24RegStruct::busy_scaler1, TI_A24RegStruct::busy_scaler2, TILOCK, and TIUNLOCK.

◆ tiGetBusyTime()

unsigned int tiGetBusyTime ( )

Return the current "busy" time of the module.

Returns
The current live time in units of 7.68 us

References TI_A24RegStruct::busytime, TILOCK, and TIUNLOCK.

◆ tiGetClockSource()

int tiGetClockSource ( )

Get the current clock source.

Returns
Current Clock Source

References TI_A24RegStruct::clock, TILOCK, and TIUNLOCK.

◆ tiGetCrateID()

int tiGetCrateID ( int  port)

Get the crate ID of the selected port.

Parameters
port
  • 0 - Self
  • 1-8 - Fiber port 1-8 (If Master)
Returns
port Crate ID if successful, ERROR otherwise

References TI_A24RegStruct::hfbr_tiID, TI_A24RegStruct::master_tiID, TI_ID_CRATEID_MASK, TILOCK, and TIUNLOCK.

◆ tiGetCurrentBlockLevel()

int tiGetCurrentBlockLevel ( )

Get the current block level.

Returns
Next Block Level if successful, ERROR otherwise

References TI_A24RegStruct::blocklevel, TI_BLOCKLEVEL_CURRENT_MASK, TI_BLOCKLEVEL_RECEIVED_MASK, tiBlockLevel, tiDisableBusError(), tiEnableBusError(), TILOCK, tiNextBlockLevel, and TIUNLOCK.

Referenced by tiStatus().

◆ tiGetEventCounter()

unsigned long long int tiGetEventCounter ( )

Returns the event counter (48 bit)

Returns
Number of accepted events if successful, otherwise ERROR

References TI_A24RegStruct::eventNumber_hi, TI_A24RegStruct::eventNumber_lo, TI_EVENTNUMBER_HI_MASK, TILOCK, and TIUNLOCK.

Referenced by tiStatus().

◆ tiGetFiberLatencyMeasurement()

int tiGetFiberLatencyMeasurement ( )

Return measured fiber length.

Returns
Value of measured fiber length

◆ tiGetFirmwareVersion()

int tiGetFirmwareVersion ( )

Get the Firmware Version.

Returns
Firmware Version if successful, ERROR otherwise

References TI_A24RegStruct::JTAGFPGABase, TI_A24RegStruct::reset, TI_RESET_JTAG, TILOCK, and TIUNLOCK.

◆ tiGetGeoAddress()

int tiGetGeoAddress ( )

Return geographic address as provided from a VME-64X crate.

Returns
Geographic Address if successful, otherwise ERROR. 0 would indicate that the TI is not in a VME-64X crate.

References TI_A24RegStruct::adr24, TI_ADR24_GEOADDR_MASK, TILOCK, and TIUNLOCK.

◆ tiGetGTPBufferLength()

unsigned int tiGetGTPBufferLength ( int  pflag)

Return value of buffer length from GTP.

Returns
value of buffer length from GTP

References TI_A24RegStruct::GTPtriggerBufferLength, TILOCK, and TIUNLOCK.

◆ tiGetInputPrescale()

int tiGetInputPrescale ( int  input)

Get the current prescale factor for the selected input.

Parameters
inputSelected trigger input (1-6)
Returns
Current prescale factor, otherwise ERROR.

References TI_A24RegStruct::inputPrescale, TI_INPUTPRESCALE_FP_MASK, TILOCK, and TIUNLOCK.

◆ tiGetInstantBlockLevelChange()

int tiGetInstantBlockLevelChange ( )

Get Status of instant blocklevel change when broadcast is received.

Returns
1 if enabled, 0 if disabled , ERROR otherwise

References TI_VMECONTROL_BLOCKLEVEL_UPDATE, TILOCK, TIUNLOCK, and TI_A24RegStruct::vmeControl.

◆ tiGetIntCount()

unsigned int tiGetIntCount ( )

Return current readout count.

References tiIntCount, TILOCK, and TIUNLOCK.

◆ tiGetLastSyncCodes()

int tiGetLastSyncCodes ( int  pflag)

Return last SyncCommand received.

Parameters
->0: print to standard out
Returns
Last SyncCommand received

References TI_A24RegStruct::sync, TI_SYNC_HFBR1_CODE_MASK, TI_SYNC_LOOPBACK_CODE_MASK, TILOCK, tiMaster, and TIUNLOCK.

◆ tiGetLiveTime()

unsigned int tiGetLiveTime ( )

Return the current "live" time of the module.

Returns
The current live time in units of 7.68 us

References TI_A24RegStruct::livetime, TILOCK, and TIUNLOCK.

◆ tiGetNextBlockLevel()

int tiGetNextBlockLevel ( )

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

Returns
Next Block Level if successful, ERROR otherwise

References TI_A24RegStruct::blocklevel, TI_BLOCKLEVEL_CURRENT_MASK, TI_BLOCKLEVEL_RECEIVED_MASK, tiBlockLevel, TILOCK, tiNextBlockLevel, and TIUNLOCK.

Referenced by tiBroadcastNextBlockLevel().

◆ tiGetPortTrigSrcEnabled()

int tiGetPortTrigSrcEnabled ( int  port)

Get the trigger sources enabled bits of the selected port.

Parameters
port
  • 0 - Self
  • 1-8 - Fiber port 1-8 (If Master)
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 TI_A24RegStruct::hfbr_tiID, TI_A24RegStruct::master_tiID, TI_ID_TRIGSRC_ENABLE_MASK, TILOCK, and TIUNLOCK.

◆ tiGetPrescale()

int tiGetPrescale ( )

Get the current prescale factor.

Returns
Current prescale factor, otherwise ERROR.

References TILOCK, TIUNLOCK, and TI_A24RegStruct::trig1Prescale.

◆ tiGetPromptTriggerWidth()

int tiGetPromptTriggerWidth ( )

Get the width of the prompt trigger from OT#2.

This routine is only functional for Firmware type=2 (modTI)

Returns
Output width set to (return value + 2) * 4ns, if successful. Otherwise ERROR

References TI_A24RegStruct::eventNumber_hi, TI_PROMPT_TRIG_WIDTH_MASK, TILOCK, and TIUNLOCK.

◆ tiGetSerialNumber()

unsigned int tiGetSerialNumber ( char **  rSN)

Get the Module Serial Number.

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

References TI_A24RegStruct::JTAGPROMBase, TI_A24RegStruct::reset, TI_RESET_JTAG, TILOCK, and TIUNLOCK.

◆ tiGetSlaveBlocklevel()

int tiGetSlaveBlocklevel ( int  port)

Get the blocklevel of the TI-Slave on the selected port.

Parameters
port
  • 1-8 - Fiber port 1-8
Returns
port blocklevel if successful, ERROR otherwise

References TI_A24RegStruct::hfbr_tiID, TI_ID_BLOCKLEVEL_MASK, TILOCK, and TIUNLOCK.

◆ tiGetSlavePort()

int tiGetSlavePort ( )

Returns the port of which the TI Slave has been configured (or will be)

Returns
  • 1 - Port 1
  • 5 - Port 5

◆ tiGetSWAStatus()

unsigned int tiGetSWAStatus ( int  reg)

Return the value from the SWa fast link register.

Parameters
regRegister to request
Returns
Value at specified register

References TI_A24RegStruct::SWA_status, TILOCK, and TIUNLOCK.

◆ tiGetSWBBusy()

int tiGetSWBBusy ( int  pflag)

Return status of Busy from SWB.

Parameters
pflag
  • >0: Print to standard out
Returns
  • 1: Busy
  • 0: Not Busy
  • -1: Error

References TI_A24RegStruct::busy, TI_BUSY_SWB, TILOCK, and TIUNLOCK.

◆ tiGetSWBStatus()

unsigned int tiGetSWBStatus ( int  reg)

Return the value from the SWB fast link register.

Parameters
regRegister to request
Returns
Value at specified register

References TI_A24RegStruct::SWB_status, TILOCK, and TIUNLOCK.

◆ tiGetSyncHistoryBufferStatus()

int tiGetSyncHistoryBufferStatus ( int  pflag)

Get the status of the SyncCommand History Buffer.

Parameters
pflag
  • >0: Print to standard out
Returns
  • 0: Empty
  • 1: Half Full
  • 2: Full

References TI_A24RegStruct::sync, TI_SYNC_HISTORY_FIFO_EMPTY, TI_SYNC_HISTORY_FIFO_FULL, TI_SYNC_HISTORY_FIFO_HALF_FULL, TI_SYNC_HISTORY_FIFO_MASK, TILOCK, and TIUNLOCK.

◆ tiGetTriggerHoldoff()

int tiGetTriggerHoldoff ( 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 TI_TRIGGERRULE_RULE1_MASK, TI_TRIGGERRULE_RULE2_MASK, TI_TRIGGERRULE_RULE3_MASK, TI_TRIGGERRULE_RULE4_MASK, TILOCK, TIUNLOCK, and TI_A24RegStruct::triggerRule.

◆ tiGetTriggerHoldoffMin()

int tiGetTriggerHoldoffMin ( 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 TI_TRIGGERRULEMIN_MIN2_EN, TI_TRIGGERRULEMIN_MIN2_MASK, TI_TRIGGERRULEMIN_MIN3_EN, TI_TRIGGERRULEMIN_MIN3_MASK, TI_TRIGGERRULEMIN_MIN4_EN, TI_TRIGGERRULEMIN_MIN4_MASK, TILOCK, TIUNLOCK, and TI_A24RegStruct::triggerRuleMin.

◆ tiGetTSInputDelay()

int tiGetTSInputDelay ( int  chan)

Get the input delay for the specified front panel TSinput (1-6)

Parameters
chanFront Panel TSInput Channel (1-6)
Returns
Channel delay (units of 4ns) if successful, otherwise ERROR

References TI_A24RegStruct::fpDelay, TI_FPDELAY_MASK, TILOCK, and TIUNLOCK.

◆ tiGetTSscaler()

unsigned int tiGetTSscaler ( int  input,
int  latch 
)

Get the current counter for the specified TS Input.

Parameters
input
  • 1-6 : TS Input (1-6)
latch
  • 0: Do not latch before readout
  • 1: Latch before readout
  • 2: Latch and reset before readout
Returns
Specified counter value

References TI_A24RegStruct::reset, TI_RESET_SCALERS_LATCH, TI_RESET_SCALERS_RESET, TILOCK, TIUNLOCK, and TI_A24RegStruct::ts_scaler.

◆ tiLive()

int tiLive ( 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 TI_A24RegStruct::busytime, TI_A24RegStruct::livetime, TI_A24RegStruct::reset, TI_RESET_SCALERS_LATCH, TILOCK, and TIUNLOCK.

◆ tiPrintBusyCounters()

int tiPrintBusyCounters ( )

Print the BUSY counters for all busy sources.

Returns
  • OK if successful, otherwise ERROR;

References TI_A24RegStruct::busy_scaler1, TI_A24RegStruct::busy_scaler2, TILOCK, and TIUNLOCK.

◆ tiPrintSyncHistory()

◆ tiPrintTSInputDelay()

int tiPrintTSInputDelay ( )

Print Front Panel TSinput Delays to Standard Out.

Returns
OK if successful, otherwise ERROR

References TI_A24RegStruct::fpDelay, TI_FPDELAY_MASK, TILOCK, and TIUNLOCK.

◆ tiSlaveStatus()

◆ tiStatus()

void tiStatus ( int  pflag)

Print some status information of the TI to standard out.

Parameters
pflagif pflag>0, print out raw registers

References TI_A24RegStruct::adr24, TI_A24RegStruct::adr32, TI_A24RegStruct::blockBuffer, TI_A24RegStruct::blocklevel, TI_A24RegStruct::blocklimit, TI_A24RegStruct::blockStatus, TI_A24RegStruct::boardID, TI_A24RegStruct::busy, TI_A24RegStruct::busytime, TI_A24RegStruct::clock, TI_A24RegStruct::fiber, TI_A24RegStruct::fiberSyncDelay, TI_A24RegStruct::GTPStatusA, TI_A24RegStruct::GTPStatusB, TI_A24RegStruct::GTPtriggerBufferLength, TI_A24RegStruct::inputCounter, TI_A24RegStruct::intsetup, TI_A24RegStruct::livetime, TI_A24RegStruct::nblocks, TI_A24RegStruct::output, TI_A24RegStruct::reset, TI_A24RegStruct::rocEnable, TI_A24RegStruct::sync, TI_A24RegStruct::syncEventCtrl, TI_BLOCKBUFFER_BLOCKS_READY_MASK, TI_BLOCKBUFFER_BUFFERLEVEL_MASK, TI_BLOCKBUFFER_BUSY_ON_BLOCKLIMIT, TI_BLOCKSTATUS_NBLOCKS_NEEDACK0, TI_BLOCKSTATUS_NBLOCKS_NEEDACK1, TI_BLOCKSTATUS_NBLOCKS_READY0, TI_BLOCKSTATUS_NBLOCKS_READY1, TI_BUSY_FP, TI_BUSY_FP_FADC, TI_BUSY_FP_FTDC, TI_BUSY_HFBR1, TI_BUSY_HFBR2, TI_BUSY_HFBR3, TI_BUSY_HFBR4, TI_BUSY_HFBR5, TI_BUSY_HFBR6, TI_BUSY_HFBR7, TI_BUSY_HFBR8, TI_BUSY_LOOPBACK, TI_BUSY_MONITOR_FP, TI_BUSY_MONITOR_FP_FADC, TI_BUSY_MONITOR_FP_FTDC, TI_BUSY_MONITOR_HFBR1, TI_BUSY_MONITOR_HFBR2, TI_BUSY_MONITOR_HFBR3, TI_BUSY_MONITOR_HFBR4, TI_BUSY_MONITOR_HFBR5, TI_BUSY_MONITOR_HFBR6, TI_BUSY_MONITOR_HFBR7, TI_BUSY_MONITOR_HFBR8, TI_BUSY_MONITOR_LOOPBACK, TI_BUSY_MONITOR_P2, TI_BUSY_MONITOR_SWA, TI_BUSY_MONITOR_SWB, TI_BUSY_MONITOR_TRIG_LOST, TI_BUSY_P2, TI_BUSY_SOURCEMASK, TI_BUSY_SWA, TI_BUSY_SWB, TI_BUSY_TRIGGER_LOCK, TI_CLOCK_FP, TI_CLOCK_HFBR1, TI_CLOCK_HFBR5, TI_CLOCK_INTERNAL, TI_CLOCK_MASK, TI_FIBER_CONNECTED_TI, TI_FIBER_TRIGSRC_ENABLED_TI, TI_INTSETUP_ENABLE, TI_INTSETUP_LEVEL_MASK, TI_INTSETUP_VECTOR_MASK, TI_NBLOCKS_COUNT_MASK, TI_RESET_SCALERS_LATCH, TI_ROCENABLE_SYNCRESET_REQUEST_ENABLE_MASK, TI_SYNC_FP, TI_SYNC_HFBR1, TI_SYNC_HFBR5, TI_SYNC_LOOPBACK, TI_SYNC_P0, TI_SYNC_SOURCEMASK, TI_SYNC_USER_SYNCRESET_ENABLED, TI_SYNCEVENTCTRL_NBLOCKS_MASK, TI_TRIGSRC_FPTRG, TI_TRIGSRC_HFBR1, TI_TRIGSRC_HFBR5, TI_TRIGSRC_LOOPBACK, TI_TRIGSRC_P0, TI_TRIGSRC_PART_1, TI_TRIGSRC_PART_2, TI_TRIGSRC_PART_3, TI_TRIGSRC_PART_4, TI_TRIGSRC_PULSER, TI_TRIGSRC_SOURCEMASK, TI_TRIGSRC_TSINPUTS, TI_TRIGSRC_TSREV2, TI_TRIGSRC_VME, TI_TSINPUT_MASK, TI_VMECONTROL_A32, TI_VMECONTROL_BERR, tiA24Offset, tiA32Offset, tiAckCount, tiBlockLevel, tiGetCurrentBlockLevel(), tiGetEventCounter(), tiIntCount, tiLatchTimers(), TILOCK, tiMaster, tiNextBlockLevel, TIpd, tiPrintTriggerHoldoff(), tiSlaveMask, tiSyncResetRequestStatus(), tiTriggerSource, TIUNLOCK, TI_A24RegStruct::trig1Prescale, TI_A24RegStruct::trigDelay, TI_A24RegStruct::trigsrc, TI_A24RegStruct::tsInput, and TI_A24RegStruct::vmeControl.