JLab Pipeline TI Library  3v6.1
Master Configuration

Functions

int tiClockResync ()
 Resync the 250 MHz Clock. More...
 
int tiSetBlockLevel (int blockLevel)
 Set the number of events per block. More...
 
int tiBroadcastNextBlockLevel (int blockLevel)
 Broadcast the next block level (to be changed at the end of the next sync event, or during a call to tiSyncReset(1). More...
 
int tiSoftTrig (int trigger, unsigned int nevents, unsigned int period_inc, int range)
 Set and enable the "software" trigger. More...
 
int tiSetRandomTrigger (int trigger, int setting)
 Set the parameters of the random internal trigger. More...
 
int tiDisableRandomTrigger ()
 Disable random trigger generation. More...
 
int tiSetTriggerLock (int enable)
 Set the the trigger lock mode. More...
 
int tiSetPrescale (int prescale)
 Set the prescale factor for the external trigger. More...
 
int tiSetInputPrescale (int input, int prescale)
 Set the prescale factor for the selected input. More...
 
void tiTrigLinkReset ()
 Reset the trigger link. More...
 
int tiSetSyncResetType (int type)
 Set type of SyncReset to send to TI Slaves. More...
 
void tiSyncReset (int blflag)
 Generate a Sync Reset signal. This signal is sent to the loopback and all configured TI Slaves. More...
 
void tiSyncResetResync ()
 Generate a Sync Reset Resync signal. This signal is sent to the loopback and all configured TI Slaves. This type of Sync Reset will NOT reset event numbers. More...
 
void tiClockReset ()
 Generate a Clock Reset signal. This signal is sent to the loopback and all configured TI Slaves. More...
 
int tiSetBlockLimit (unsigned int limit)
 Set the block number at which triggers will be disabled automatically. More...
 
int tiSetBlockBufferLevel (unsigned int level)
 Set the block buffer level for the number of blocks in the system that need to be read out. More...
 
int tiEnableTSInput (unsigned int inpMask)
 Enable/Disable trigger inputs labelled TS#1-6 on the Front Panel. More...
 
int tiDisableTSInput (unsigned int inpMask)
 Disable trigger inputs labelled TS#1-6 on the Front Panel. More...
 
int tiAddSlave (unsigned int fiber)
 Add and configurate a TI Slave for the TI Master. More...
 
int tiAddSlaveMask (unsigned int fibermask)
 Add and configure TI Slaves by using a mask for the TI-Master. More...
 
int tiSetTriggerHoldoff (int rule, unsigned int value, int timestep)
 Set the value for a specified trigger rule. More...
 
int tiSetTriggerHoldoffMin (int rule, unsigned int value)
 Set the value for the minimum time of specified trigger rule. More...
 
int tiTriggerTableConfig (unsigned int *itable)
 Configure trigger table to be loaded with a user provided array. More...
 
int tiGetTriggerTable (unsigned int *otable)
 Get the current trigger table stored in local memory (not necessarily on TI). More...
 
int tiTriggerTablePredefinedConfig (int mode)
 Configure trigger tabled to be loaded with a predefined trigger table (mapping TS inputs to trigger types). More...
 
int tiDefineEventType (int trigMask, int hwTrig, int evType)
 Define a specific trigger pattern as a hardware trigger (trig1/trig2/syncevent) and Event Type. More...
 
int tiDefinePulserEventType (int fixed_type, int random_type)
 Define the event type for the TI Master's fixed and random internal trigger. More...
 
int tiLoadTriggerTable (int mode)
 Load a predefined trigger table (mapping TS inputs to trigger types). More...
 
int tiSetTriggerWindow (int window_width)
 Set the window of the input trigger coincidence window. More...
 
int tiSetTriggerInhibitWindow (int window_width)
 Set the width of the input trigger inhibit window. More...
 
int tiSetTrig21Delay (int delay)
 Set the delay of Trig1 relative to Trig2 when trigger source is 11. More...
 
int tiSetTriggerLatchOnLevel (int enable)
 Set the trigger latch pattern readout in the data stream to include the Level of the input trigger OR the transition to Hi. More...
 
int tiLatchTimers ()
 Latch the Busy and Live Timers. More...
 
int tiSetUserSyncResetReceive (int enable)
 Enable/Disable operation of User SyncReset. More...
 
int tiSetSyncEventInterval (int blk_interval)
 Set the value of the syncronization event interval. More...
 
int tiEnableSyncResetRequest (unsigned int portMask, int self)
 Configure which ports (and self) to enable response of a SyncReset request. More...
 
void tiTriggerReadyReset ()
 Reset the registers that record the triggers enabled status of TI Slaves. More...
 
int tiResetMGT ()
 Reset the MGT. More...
 

Detailed Description

Function Documentation

◆ tiAddSlave()

int tiAddSlave ( unsigned int  fiber)

Add and configurate a TI Slave for the TI Master.

This routine should be used by the TI Master to configure HFBR porti and BUSY sources.

Parameters
fiberThe fiber port of the TI Master that is connected to the slave
See also
tiAddSlaveMask
Returns
OK if successful, otherwise ERROR

References TI_BUSY_HFBR1, tiEnableFiber(), tiMaster, tiSetBusySource(), and tiSlaveMask.

Referenced by tiAddSlaveMask().

◆ tiAddSlaveMask()

int tiAddSlaveMask ( unsigned int  fibermask)

Add and configure TI Slaves by using a mask for the TI-Master.

This routine should be used by the TI-Master to configure HFBR ports and BUSY sources.

Parameters
fibermaskThe fiber port mask of the TI-Master that is connected to the slaves
See also
tiAddSlave

References tiAddSlave().

◆ tiBroadcastNextBlockLevel()

int tiBroadcastNextBlockLevel ( int  blockLevel)

Broadcast the next block level (to be changed at the end of the next sync event, or during a call to tiSyncReset(1).

See also
tiSyncReset(1)
Parameters
blockLevelblock level to broadcats
Returns
OK if successful, ERROR otherwise

References TI_BLOCKLEVEL_MASK, TI_TRIGGERCOMMAND_SET_BLOCKLEVEL, TI_TRIGSRC_VME, tiGetNextBlockLevel(), TILOCK, tiMaster, TIUNLOCK, TI_A24RegStruct::triggerCommand, and TI_A24RegStruct::trigsrc.

Referenced by tiSetBlockLevel().

◆ tiClockReset()

void tiClockReset ( )

Generate a Clock Reset signal. This signal is sent to the loopback and all configured TI Slaves.

References TI_A24RegStruct::sync, TI_A24RegStruct::syncCommand, TI_SYNC_SOURCEMASK, TI_SYNCCOMMAND_CLK250_RESYNC, TILOCK, tiMaster, and TIUNLOCK.

◆ tiClockResync()

int tiClockResync ( )

Resync the 250 MHz Clock.

Returns
OK if successful, ERROR otherwise

References TI_A24RegStruct::syncCommand, TI_SYNCCOMMAND_AD9510_RESYNC, TILOCK, and TIUNLOCK.

◆ tiDefineEventType()

int tiDefineEventType ( int  trigMask,
int  hwTrig,
int  evType 
)

Define a specific trigger pattern as a hardware trigger (trig1/trig2/syncevent) and Event Type.

Parameters
trigMaskTrigger Pattern (must be less than 0x3F)
  • TS inputs defining the pattern. Starting bit: TS#1 = bit0
hwTrigHardware trigger type (must be less than 3) 0: no trigger 1: Trig1 (event trigger) 2: Trig2 (playback trigger) 3: SyncEvent
evTypeEvent Type (must be less than 255)
Returns
OK if successful, otherwise ERROR

◆ tiDefinePulserEventType()

int tiDefinePulserEventType ( int  fixed_type,
int  random_type 
)

Define the event type for the TI Master's fixed and random internal trigger.

Parameters
fixed_typeFixed Pulser Event Type
random_typePseudo Random Pulser Event Type
Returns
OK if successful, otherwise ERROR

References TI_A24RegStruct::pulserEvType, TILOCK, and TIUNLOCK.

◆ tiDisableRandomTrigger()

int tiDisableRandomTrigger ( )

Disable random trigger generation.

See also
tiSetRandomTrigger
Returns
OK if successful, ERROR otherwise.

References TI_A24RegStruct::randomPulser, TILOCK, and TIUNLOCK.

◆ tiDisableTSInput()

int tiDisableTSInput ( unsigned int  inpMask)

Disable trigger inputs labelled TS#1-6 on the Front Panel.

These inputs MUST be disabled if not connected.

Parameters
inpMask
  • 0: TS#1
  • 1: TS#2
  • 2: TS#3
  • 3: TS#4
  • 4: TS#5
  • 5: TS#6
Returns
OK if successful, otherwise ERROR

References TILOCK, TIUNLOCK, and TI_A24RegStruct::tsInput.

◆ tiEnableSyncResetRequest()

int tiEnableSyncResetRequest ( unsigned int  portMask,
int  self 
)

Configure which ports (and self) to enable response of a SyncReset request.

Parameters
portMaskMask of ports to enable (port 1 = bit 0)
self1 to enable self, 0 to disable
Returns
OK if successful, otherwise ERROR

References TI_A24RegStruct::rocEnable, TI_ROCENABLE_MASK, TILOCK, tiMaster, and TIUNLOCK.

◆ tiEnableTSInput()

int tiEnableTSInput ( unsigned int  inpMask)

Enable/Disable trigger inputs labelled TS#1-6 on the Front Panel.

These inputs MUST be disabled if not connected.

Parameters
inpMask
  • 0: TS#1
  • 1: TS#2
  • 2: TS#3
  • 3: TS#4
  • 4: TS#5
  • 5: TS#6
Returns
OK if successful, otherwise ERROR

References TILOCK, TIUNLOCK, and TI_A24RegStruct::tsInput.

◆ tiGetTriggerTable()

int tiGetTriggerTable ( unsigned int *  otable)

Get the current trigger table stored in local memory (not necessarily on TI).

Parameters
otableOutput Table (Array of 16 4byte words, user must allocate memory)
Returns
OK if successful, otherwise ERROR

◆ tiLatchTimers()

int tiLatchTimers ( )

Latch the Busy and Live Timers.

This routine should be called prior to a call to tiGetLiveTime and tiGetBusyTime

See also
tiGetLiveTime
tiGetBusyTime
Returns
OK if successful, otherwise ERROR

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

Referenced by tiStatus().

◆ tiLoadTriggerTable()

int tiLoadTriggerTable ( int  mode)

Load a predefined trigger table (mapping TS inputs to trigger types).

Parameters
mode
  • 0:
    • TS#1,2,3,4,5 generates Trigger1 (physics trigger),
    • TS#6 generates Trigger2 (playback trigger),
    • No SyncEvent;
  • 1:
    • TS#1,2,3 generates Trigger1 (physics trigger),
    • TS#4,5,6 generates Trigger2 (playback trigger).
    • If both Trigger1 and Trigger2, they are SyncEvent;
  • 2:
    • TS#1,2,3,4,5 generates Trigger1 (physics trigger),
    • TS#6 generates Trigger2 (playback trigger),
    • If both Trigger1 and Trigger2, generates SyncEvent;
  • 3:
    • TS#1,2,3,4,5,6 generates Trigger1 (physics trigger),
    • No Trigger2 (playback trigger),
    • No SyncEvent;
  • 4: User configured table
See also
tiDefineEventType, tiTriggerTablePredefinedConfig
Returns
OK if successful, otherwise ERROR

References TILOCK, tiTriggerTablePredefinedConfig(), and TI_A24RegStruct::trigTable.

◆ tiResetMGT()

int tiResetMGT ( )

Reset the MGT.

Returns
OK if successful, otherwise ERROR

References TI_A24RegStruct::reset, TI_RESET_MGT, TILOCK, tiMaster, and TIUNLOCK.

◆ tiSetBlockBufferLevel()

int tiSetBlockBufferLevel ( unsigned int  level)

Set the block buffer level for the number of blocks in the system that need to be read out.

If this buffer level is full, the TI will go BUSY. The BUSY is released as soon as the number of buffers in the system drops below this level.

Parameters
level
  • 0: No Buffer Limit - Pipeline mode
  • 1: One Block Limit - "ROC LOCK" mode
  • 2-65535: "Buffered" mode.
Returns
OK if successful, otherwise ERROR

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

◆ tiSetBlockLevel()

int tiSetBlockLevel ( int  blockLevel)

Set the number of events per block.

Parameters
blockLevelNumber of events per block
Returns
OK if successful, ERROR otherwise

References tiBroadcastNextBlockLevel().

◆ tiSetBlockLimit()

int tiSetBlockLimit ( unsigned int  limit)

Set the block number at which triggers will be disabled automatically.

Returns
OK if successful, otherwise ERROR

References TI_A24RegStruct::blocklimit, TILOCK, and TIUNLOCK.

◆ tiSetInputPrescale()

int tiSetInputPrescale ( int  input,
int  prescale 
)

Set the prescale factor for the selected input.

Parameters
inputSelected trigger input (1-6)
prescaleFactor for prescale. Max {prescale} available is 65535
Returns
OK if successful, otherwise ERROR.

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

◆ tiSetPrescale()

int tiSetPrescale ( int  prescale)

Set the prescale factor for the external trigger.

Parameters
prescaleFactor for prescale. Max {prescale} available is 65535
Returns
OK if successful, otherwise ERROR.

References TILOCK, TIUNLOCK, and TI_A24RegStruct::trig1Prescale.

◆ tiSetRandomTrigger()

int tiSetRandomTrigger ( int  trigger,
int  setting 
)

Set the parameters of the random internal trigger.

Parameters
trigger- Trigger Selection
  • 1: trig1
  • 2: trig2
setting- frequency prescale from 500MHz
See also
tiDisableRandomTrigger
Returns
OK if successful, ERROR otherwise.

References TI_A24RegStruct::randomPulser, TI_RANDOMPULSER_TRIG1_ENABLE, TI_RANDOMPULSER_TRIG1_RATE_MASK, TI_RANDOMPULSER_TRIG2_ENABLE, TILOCK, and TIUNLOCK.

◆ tiSetSyncEventInterval()

int tiSetSyncEventInterval ( int  blk_interval)

Set the value of the syncronization event interval.

Parameters
blk_intervalSync Event will occur in the last event of the set blk_interval (number of blocks)
Returns
OK if successful, otherwise ERROR

References TI_A24RegStruct::syncEventCtrl, TI_SYNCEVENTCTRL_NBLOCKS_MASK, TILOCK, tiMaster, and TIUNLOCK.

◆ tiSetSyncResetType()

int tiSetSyncResetType ( int  type)

Set type of SyncReset to send to TI Slaves.

Parameters
typeSync Reset Type
  • 0: User programmed width in each TI
  • !0: Fixed 4 microsecond width in each TI
Returns
OK if successful, otherwise ERROR

◆ tiSetTrig21Delay()

int tiSetTrig21Delay ( int  delay)

Set the delay of Trig1 relative to Trig2 when trigger source is 11.

Parameters
delayTrig1 delay after Trig2
  • Latency in steps of 4 nanoseconds with an offset of ~2.6 microseconds
Returns
OK if successful, otherwise ERROR

References TI_TRIGGERWINDOW_TRIG21_MASK, TILOCK, TIUNLOCK, and TI_A24RegStruct::triggerWindow.

◆ tiSetTriggerHoldoff()

int tiSetTriggerHoldoff ( int  rule,
unsigned int  value,
int  timestep 
)

Set 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
valuethe specified time period (in steps of timestep)
timestepTimestep that is dependent on the trigger rule selected
                            rule
     timestep    1       2       3       4
     --------  ------ ------- ------- --------
        0        16ns    16ns    32ns     64ns
        1       480ns   960ns  1920ns   3840ns
        2     15360ns 30720ns 61440ns 122880ns
*
Returns
OK if successful, otherwise ERROR.

References TI_TRIGGERRULE_RULE1_MASK, TI_TRIGGERRULE_RULE2_MASK, TI_TRIGGERRULE_RULE3_MASK, TI_TRIGGERRULE_RULE4_MASK, TI_VMECONTROL_SLOWER_TRIGGER_RULES, TILOCK, TIUNLOCK, TI_A24RegStruct::triggerRule, and TI_A24RegStruct::vmeControl.

◆ tiSetTriggerHoldoffMin()

int tiSetTriggerHoldoffMin ( int  rule,
unsigned int  value 
)

Set the value for the minimum time of 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
valuethe specified time period (in steps of timestep)
                      rule
                     2      3      4
                   ----- ------ ------
                    16ns  480ns  480ns 
*
Returns
OK if successful, otherwise ERROR.

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.

◆ tiSetTriggerInhibitWindow()

int tiSetTriggerInhibitWindow ( int  window_width)

Set the width of the input trigger inhibit window.

Parameters
window_widthWidth of the input inhibit window (units of 4ns)
Returns
OK if successful, otherwise ERROR

References TI_TRIGGERWINDOW_INHIBIT_MASK, TILOCK, TIUNLOCK, and TI_A24RegStruct::triggerWindow.

◆ tiSetTriggerLatchOnLevel()

int tiSetTriggerLatchOnLevel ( int  enable)

Set the trigger latch pattern readout in the data stream to include the Level of the input trigger OR the transition to Hi.

Parameters
enable1 to enable <1 to disable
Returns
OK if successful, otherwise ERROR

References TI_TRIGGERWINDOW_LEVEL_LATCH, TILOCK, TIUNLOCK, and TI_A24RegStruct::triggerWindow.

◆ tiSetTriggerLock()

int tiSetTriggerLock ( int  enable)

Set the the trigger lock mode.

Parameters
enableEnable flag 0: Disable !0: Enable
Returns
OK if successful, ERROR otherwise.

References TI_A24RegStruct::busy, TI_BUSY_TRIGGER_LOCK, TILOCK, tiMaster, and TIUNLOCK.

◆ tiSetTriggerWindow()

int tiSetTriggerWindow ( int  window_width)

Set the window of the input trigger coincidence window.

Parameters
window_widthWidth of the input coincidence window (units of 4ns)
Returns
OK if successful, otherwise ERROR

References TI_TRIGGERWINDOW_COINC_MASK, TILOCK, TIUNLOCK, and TI_A24RegStruct::triggerWindow.

◆ tiSetUserSyncResetReceive()

int tiSetUserSyncResetReceive ( int  enable)

Enable/Disable operation of User SyncReset.

See also
tiUserSyncReset
Parameters
enable
  • >0: Enable
  • 0: Disable
Returns
OK if successful, otherwise ERROR

References TI_A24RegStruct::sync, TI_SYNC_SOURCEMASK, TI_SYNC_USER_SYNCRESET_ENABLED, TILOCK, and TIUNLOCK.

◆ tiSoftTrig()

int tiSoftTrig ( int  trigger,
unsigned int  nevents,
unsigned int  period_inc,
int  range 
)

Set and enable the "software" trigger.

Parameters
triggertrigger type 1 or 2 (playback trigger)
neventsinteger number of events to trigger
period_incperiod multiplier, depends on range (0-0x7FFF)
range
  • 0: small period range (min: 120ns, increments of 120ns)
  • 1: large period range (min: 120ns, increments of 245.7us)
Returns
OK if successful, ERROR otherwise

References TI_A24RegStruct::fixedPulser1, TI_A24RegStruct::fixedPulser2, TI_FIXEDPULSER1_NTRIGGERS_MASK, TI_FIXEDPULSER1_PERIOD_MASK, TILOCK, and TIUNLOCK.

◆ tiSyncReset()

void tiSyncReset ( int  blflag)

Generate a Sync Reset signal. This signal is sent to the loopback and all configured TI Slaves.

Parameters
blflagOption to change block level, after SyncReset issued
  • 0: Do not change block level
  • >0: Broadcast block level to all connected slaves (including self) BlockLevel broadcasted will be set to library value (Set with tiSetBlockLevel)

References TI_A24RegStruct::syncCommand, and TILOCK.

◆ tiSyncResetResync()

void tiSyncResetResync ( )

Generate a Sync Reset Resync signal. This signal is sent to the loopback and all configured TI Slaves. This type of Sync Reset will NOT reset event numbers.

References TI_A24RegStruct::syncCommand, and TILOCK.

◆ tiTriggerReadyReset()

void tiTriggerReadyReset ( )

◆ tiTriggerTableConfig()

int tiTriggerTableConfig ( unsigned int *  itable)

Configure trigger table to be loaded with a user provided array.

Parameters
itableInput Table (Array of 16 4byte words)
Returns
OK if successful, otherwise ERROR

◆ tiTriggerTablePredefinedConfig()

int tiTriggerTablePredefinedConfig ( int  mode)

Configure trigger tabled to be loaded with a predefined trigger table (mapping TS inputs to trigger types).

Parameters
mode
  • 0:
    • TS#1,2,3,4,5 generates Trigger1 (physics trigger),
    • TS#6 generates Trigger2 (playback trigger),
    • No SyncEvent;
  • 1:
    • TS#1,2,3 generates Trigger1 (physics trigger),
    • TS#4,5,6 generates Trigger2 (playback trigger).
    • If both Trigger1 and Trigger2, they are SyncEvent;
  • 2:
    • TS#1,2,3,4,5 generates Trigger1 (physics trigger),
    • TS#6 generates Trigger2 (playback trigger),
    • If both Trigger1 and Trigger2, generates SyncEvent;
  • 3:
    • TS#1,2,3,4,5,6 generates Trigger1 (physics trigger),
    • No Trigger2 (playback trigger),
    • No SyncEvent;
Returns
OK if successful, otherwise ERROR

Referenced by tiLoadTriggerTable().

◆ tiTrigLinkReset()

void tiTrigLinkReset ( )