FunTest Documentation
  • What is FunTest?
  • Product Tour
    • Navigation
    • Create your first project
    • Connecting Test Equipment
    • Creating Test Sequence
    • Executing Test Sequence
    • Test Reporting
  • Creating Test Sequence
    • Test File Overview
      • TEST Sequence Tab
    • FunTest Commands
      • Operator Interface
      • Sequence Flow
      • Digital I/O
      • Test Result Export
      • Printing
      • Other Commands
    • Calling Device Plugin
    • Test Point Control
    • Using Spreadsheet Formulas
    • Variables
    • Interrupt Events
    • Online Debugging
  • FunTEST Plugins
    • Plugin Overview
  • Test Station
    • Test Station Setting
  • Other
    • Run FunTEST Externally
  • How To's
    • How To's
Powered by GitBook
On this page
  • #catchio (Wait for a specified IO device input)
  • Examples
  • Return Value
  • Command Overview
  • #oninput (External input interrupt)
  • Examples
  • Return Value
  • Command Overview
  • Controlling and Reading I/Os from IO Column
  • Commands available:

Was this helpful?

  1. Creating Test Sequence
  2. FunTest Commands

Digital I/O

This section describes how can you use digital I/Os in your test sequence

PreviousSequence FlowNextTest Result Export

Last updated 1 year ago

Was this helpful?

#catchio (Wait for a specified IO device input)

Repetitively send the command to read inputs of IO mapping device and block executing the program until matches the expected value. When #oninput event occurs, the #catchio will break.

Examples

Command
Parameter

#catchio

cmd="r:0:2:4";accept="1:1:1"

Read inputs 0, 2 and 4 every 10ms and block program executing until all inputs become logical 1.

Command
Parameter

#catchio

cmd="r:0:1";accept="1:1":accept="0:0"

Almost the same as Example 1, but more states of inputs are accepted

Command
Parameter

#catchio

cmd="r:fixture";accept="0";interval=200

This requires the "fixture" pin alias to be defined. Read the "fixture" input every 200ms and wait until it becomes a logical 0.

Command
Parameter

#catchio

cmd="r:active";accept="1";interval=100;timeout=5000

This requires the "active" pin alias to be defined. Read the "active" input every 100ms and wait until it becomes a logical 1 for a maximum of 5 seconds. If the "active" input will not change to a log. 1 until timeout is reached, the return status will be set to one and return value to "0" (because of no change).

Command
Parameter

#catchio

cmd="r:in0:in1:break";accept="1:0:0";accept="?:?:1"

Wild-card example. This accepts the exact combination of 1:0:0 or any combination with "break" input is active.

Return Value

Last state of inputs in colon-separated format, i.e. "0:1:1". Returns BREAK when paused while debugging or #oninput event.

Command Overview

Command
Parameter
#catchio

cmd=[string];accept=[string]{;accept2=[string];...;acceptN=[string]} {;timeout=[number]}{;interval=[number]}{set-cnt=[number]}

Parameter Description

Parameter
Type
Options

cmd

[string]

Command of funTEST IO mapping device to read specified inputs. Alias or input numbers can be used, separated by a colon ":".

accept

[string]

Return string sequence of IO command to be accepted. The #catchio command blocks executing the program until one of these string will match the return value. Since funTEST version 1.0.1912.410 the accept argument support wild-cards (? for any one charater and * for any number of charaters).

timeout

[number]

Time limit in [ms] to wait to pass all accept strings. If the timeout is reached, the #catchio command return status will be one and current state of inputs will be returned. Default: (no timeout)

interval

[number]

Interval in [ms] between executing of IO commands. Default: 10 [ms]

set-cnt

[number]

Needed count of internal iteration before "accept filter" will be accepted. Interval between iteration is depended on interval parameter Default: 1

#oninput (External input interrupt)

This command controls external input interrupt. Functionality requires IO mapping to be configured with used inputs enabled. When interrupt is configured, funTEST checks for change of specified input. If there is a transition on input of configured interrupt, the funTEST will go to a specified label or call a specified function. More than one interrupt can be set. Each interrupt is identified by its input pin number or alias. Interrupts are bounded to thread from which they were configured. If specific thread finishes, all bounded interrupts to this thread are cleared.

Examples

Command
Parameter

#oninput

goto:start:pin=fixture-closed:change=tohigh

This example requires a defined label "start" and input pin with "fixture-closed" alias. If pin value raises from low to high, funTEST will go to on the label "start".

Command
Parameter

#oninput

call:stop:pin=force-stop:change=tolow

This example requires a defined function block "stop" and input pin with "force-stop" alias. If pin value falls from high to low, funTEST will call the "stop" function block.

Command
Parameter

#oninput

none/disable

Disable configured interrupts of caller's thread. If this command is executed in the main thread, all interrupts are disabled (including all another running threads).

Command
Parameter

#oninput

stop:force-stop

Disable interrupt for the "force-stop" input.

Return Value

No return value.

Command Overview

Command
Parameter
#oninput

<command>:<label>:pin=[string/number]:change=[enum]{:single=[bool]}

Parameter Description

Parameter
Type
Options

command

[enum]

What should be done if error or fail has occurred. It can be on of these option: • goto - go to line with a specified label, no return • call - asynchronously call specified function block, there is no blocking of running program

label

[string]

Target label to go to or name of function block to call. Function block must ends with #return command.

pin

[string] or [number]

Input pin number or alias that can cause an extern interrupt. It must be defined in teststation's IO mapping.

change

[enum]

Specify a pin level transition. It can be: tohigh - a transition from low to high tolow - a transition from high to low

single

[bool]

Single-shot option. If true, the configured interrupt is automatically disabled when first occur.

Controlling and Reading I/Os from IO Column

You can also read and control digital I/Os in a dedicated column IO.

Commands available:

Command
Parameter
Return Value
Example

*rst Clear all outputs (without applying outputs) and clear current segment setting.

No parameters

No return value

s: <out> Set specified output(s) to ON state. The command reflect current segment settings.

out [int] or [string] Pin number or pin alias of output

No return value

s:3:7:gnd:vcc Set outputs with numbers 3 and 7 and all outputs with aliases "gnd" and "vcc" in currently active segment (s).

c:<out> Set specified output(s) to OFF state (clear). The command reflect current segment settings.

out [int] or [string] Pin number or pin alias of output

No return value

c:3:7:gnd:vcc Clears outputs with numbers 3 and 7 and all outputs with aliases "gnd" and "vcc" in currently active segment(s).

r:<in> Read state of specified inputs(s). The command reflect current segment settings.

in [int] or [string] Pin number or pin alias of input

1 = ON 0 = OFF

r:state Read all inputs with alias "state" in currently active segment(s).

IO mapping system accepts more commands in a chain at once.