catman®Professional: How to set up a stop trigger functionality for Spider8?
The amplifier Spider8 has no stop trigger functionality. If needed, this functionality can be simulated by software.
Find a modification of the catModule "Periodic Measurement" below.
First, modify the setting dialog in the online page to set the channel, trigger level and mode (rising or falling edge). The start trigger can be
set by the normal trigger dialog.
Then modify the script of the catModul "U_Pshot" (periodic measurement):
1.) Main:
- Changed MyOLFile to the modified OPG
- Define variables (GLOBAL .....)
2.) Sub "ReadSettings":
- Read the new boxes and combo
- Turn the sign when mode is "falling edge"
REM ////// Read StopTrigger settings\\\\\\\\
REM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopTriggerChannel = Textbox_Channel.Value
StopTriggerLimit = Textbox_Limit.Value
StopTriggerMode = Combo_Mode.Text
REM *** Turn sign, when Falling edge ***
STRCMP StopTriggerMode "Falling edge" Result
IF Result = 1
StopTriggerLimit = - StopTriggerLimit
ENDIF
3.) Changes in Sub "ReadData" around line 118:
Read the maximum or minimum of the last readblock (depending on mode)
- Turn the sign when mode is "falling edge"
- Extend the if-clause for stop measurement (compare max/min with trigger level and check the direction)
- Store "Last value" to detect the direction (falling edge or rising edge)
- Stop if trigger event is true
REM ////// Stop Trigger and Stop inquiry \\\\\\\\
REM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
REM *** Get value for triggering depending on mode ***
STRCMP StopTriggerMode "Rising edge" Result
IF Result = 1
StopTriggerValue = C[StopTriggerChannel].Max
ELSE
StopTriggerValue = C[StopTriggerChannel].Min
StopTriggerValue = - StopTriggerValue
ENDIF
REM *** At measurement start create value for "last value" ***
IF Counter = ReadBlock
StopTriggerValue = StopTriggerValue_Last
ENDIF
REM * Update realtime indicator and increase Counter
UPDATE -r
Counter=Counter+ReadBlock
REM *** conditions for "stop measurement" ***
IF Counter > NofSamples -1 OR gEvent = ABORT_READ OR gEvent = STOP OR (StopTriggerValue > StopTriggerLimit AND
StopTriggerValue_Last < StopTriggerLimit)
MTimer.Delete
BREAK
ELSE
REM ** Set "last value" **
StopTriggerValue_Last = StopTriggerValue
ENDIF
The only problem is, the system runs much slower, because it has to examine each value. That's the big disadvantage of software
triggers. It runs with catman 3.1.


