• Home
  • User Manual
  • Tutorials
  • API
  • Updates
Search Results for

    Show / Hide Table of Contents
    • Welcome to twin
    • Getting Started
      • Install and uninstall twin
      • Install and uninstall a licence
      • Start twin
    • Simulation Component Library
      • Automation
        • ScriptComponent
        • Sequence
      • BitManipulator
        • BitsToBytesConverter
        • BytesToBitsConverter
        • EndiannessChanger
      • BooleanOperations
        • BooleanFunction
        • Invert
        • InputSwitch
      • ControlPanel
        • ControlPanel
      • Conveyor
        • Conveyor
        • VacuumConveyor
      • Debug
        • Counter
      • DataManipulator
        • DataReader
        • DataTypeConverter
        • DataWriter
      • FMU
        • FMU
      • Gripper
        • KinematicGripper
        • ObjectCoupler
        • VacuumGripper
      • HardwareConnector
        • PLCConnector
        • RobotControllerConnector
      • Math
        • Function
        • Gain
        • LinearFunction
        • LowPassFilter
        • NumberComparer
        • Sum
      • Motor
        • FCControlledMotor
        • ServoMotor
      • Movers
        • BoolToSignedDirection
        • DynamicCylinder
        • DynamicRotationMover
        • DynamicTranslationMover
        • KinematicCylinder
        • KinematicPathMover
        • KinematicRotationMover
        • KinematicTranslationMover
      • ObjectManipulator
        • Colorizer
        • Object3DCutter
        • VisibilityChanger
      • Sensors
        • AngleLimitSwitch
        • CollisionObserver
        • DistanceSensor
        • DynamicObjectDetector
        • LightBarrier
        • PositionLimitSwitch
        • PositionTracker
      • Sinks
        • FileLogger
        • CollisionSink
        • RaySink
      • Sources
        • BoolConstant
        • BoxSource
        • DoubleConstant
        • Object3DFileSource
        • Object3DSource
        • RandomBoolean
        • RandomNumber
        • SinusGenerator
        • SphereSource
        • StringConstant
      • Timers
        • IntervalTrigger
        • TOF
        • TON
    • Collision Detection
      • What is essential for collision detection?
      • Where can I find the mesh simplifiers?
      • Which mesh simplification methods are available?
    • Video Guides
      • Install twin
      • How to handle twin
      • Organize projects
      • Import CAD files
      • Handle 3D objects
      • Organize simulation components
      • Activate physics in your simulation
      • Simulate conveyor systems
      • Simulate cylinders
      • Simulate axis systems and portals
      • Simulate sensors
      • Simulate grippers
      • Create program sequences
      • Connect to PLCs
      • Simulate robots
      • Model complex mechanical motion systems
      • Debug and analyse signals in twin
      • Best practices for maintenance efficient project development
      • FAQ

    Function

    This simulation component outputs the result of any given Function, with an arbitrary number of inputs and variables.

    Function

    When to use

    Use this simulation component when you want to define a function whose variables can be assigned using an arbitrary number of inputs.

    How to use

    Add this simulation component from the simulation component library.
    Define the desired number of inputs to use as variables, choose when the function should be evaluated, and then define the function.

    Parameters

    InputFunction

    Specifies the function to be calculated.
    Supports functions from the System.Math library.

    Examples:

    Sqrt(x1)
    Sin(x1)
    ...
    

    EvaluateOn

    Determines when to evaluate the given Function.

    Value Description
    After Input Changed The function is evaluated, when an arbitrary input changes it's value.
    Before Simulation Step The function is evaluated right before the simulation steps forward in time.
    After Simulation Step The function is evaluated right after the simulation has stepped forward in time.

    NumberInputs

    Indicates the number of variables available for use in your Function.

    Inputs

    Inputs are created dynamically according to the defined number of inputs.

    InputFunction

    Indicates the function you want to calculate.

    Outputs

    Result

    Outputs the result of the given Function.

    Example

    In this example, we have two inputs:

    • x1 = 4
    • x2 = 3.5

    The input function is:

    Sqrt(Max(x1, x2))
    

    This function calculates the square root of the larger of the two input values. Since x1 (4) is greater than x2 (3.5), the calculation becomes:

    Sqrt(4) = 2
    

    The function is evaluated after any input changes, because EvaluateOn is set to After Input Changed.

    At this point, the Result is 2.

    Function Example Properties

    In this article
    Back to top Copyright © Eberle Automatische Systeme GmbH & Co KG