JLab VME Pipeline TI Library  3v11.3
JLab VME Pipeline TI library
 All Classes Functions Variables Groups
Functions
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.
 
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 tiResetEB ()
 Generate a Sync signal to reset only event buffers. This signal is sent to the loopback and all configured TI Slaves.
 
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.
 
void tiClockReset ()
 Generate a Clock Reset signal. This signal is sent to the loopback and all configured TI Slaves.
 
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 tiResetSlaveConfig ()
 Reset the configuration of TI Slaves on the TI-Master. More...
 
int tiAddSlave (unsigned int fiber)
 Add and configurate a TI Slave for the TI Master. More...
 
int tiRemoveSlave (unsigned int fiber)
 Remove a TI Slave. 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.
 
void tiTriggerLinkErrorReset ()
 Reset the registers that record bit errors recorded on the trigger link.
 
int tiResetMGT ()
 Reset the MGT. More...
 

Detailed Description

Function Documentation

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
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
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
int tiClockResync ( )

Resync the 250 MHz Clock.

Returns
OK if successful, ERROR otherwise
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
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
int tiDisableRandomTrigger ( )

Disable random trigger generation.

See Also
tiSetRandomTrigger
Returns
OK if successful, ERROR otherwise.
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
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
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
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
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
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
int tiRemoveSlave ( unsigned int  fiber)

Remove a TI Slave.

Parameters
fiberThe fiber port of the TI master to remove.
Returns
OK if successful, ERROR otherwise
int tiResetMGT ( )

Reset the MGT.

Returns
OK if successful, otherwise ERROR
int tiResetSlaveConfig ( )

Reset the configuration of TI Slaves on the TI-Master.

This routine removes all slaves and resets the fiber port busys.
Returns
OK if successful, ERROR otherwise
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
int tiSetBlockLevel ( int  blockLevel)

Set the number of events per block.

Parameters
blockLevelNumber of events per block
Returns
OK if successful, ERROR otherwise
int tiSetBlockLimit ( unsigned int  limit)

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

Returns
OK if successful, otherwise ERROR
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.
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.
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.
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
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
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
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.
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.
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
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
int tiSetTriggerLock ( int  enable)

Set the the trigger lock mode.

Parameters
enableEnable flag 0: Disable !0: Enable
Returns
OK if successful, ERROR otherwise.
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
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
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
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)
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
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