Scanbox tower (aka as the PizzaBox) has 4 external TTL Event inputs on the top row of the SMA connector matrix, outlined in light blue in the picture below.
These inputs should be 5V TTL signals.
Either the rising, falling or both edges of the signal can be time stamped. This is determined by the value of the imask configuration variable, which you can think of as an 8-bit word:
sbconfig.imask = bin2dec('00001101'); % event mask
We will name mask0 the lowest significant bit of this word and mask7 the highest signficant bit. If N is even, then maskN = 1 implies you want to time stamp the rising phase of the k/2 event input. If N is odd, then maskK = 1 implies you want to time stamp the falling edge of the (k-1)/2 event input.
So, for the example above, we are sampling both the rising and falling edges of EVENT1 but only the rising edge of EVENT0.
Events are polled once per scanning line. Thus, the minimum pulse width has to be at least 1/8khz or 125us, but we recommend using 0.5msec or longer.
One or more events can occur in one line. The event_id variable will be a number that has a bit set to one for each of the events that occurred.
So, given the imask value above, an event_id of 1 means a rising edge on EVENT0; an event_idof 4 means a rising edge on EVENT1; and an event_id of 9 means a falling edge on EVENT1 simultaneous with a rising edge in EVENT0.