InOut: Generate Function with Customizable Inputs
InOut: Generate Function with Customizable Inputs
This table describes the input and output variables used to generate different functions.
| Scope | Name | Type | Initial | Comment | |---|---|---|---|---| | | Input | MODE | GEN_MODE | | Types available:
- 'TRIANGLE': Triangular from -AMPLITUDE to +AMPLITUDE
- 'TRIANGLE_POS': Triangular from 0 to +AMPLITUDE
- 'SAWTOOTH_RISE': Sawtooth increasing from -AMPLITUDE to +AMPLITUDE
- 'SAWTOOTH_FALL': Sawtooth decreasing from +AMPLITUDE to -AMPLITUDE
- 'RECTANGLE': Rectangular switching from -AMPLITUDE to +AMPLITUDE
- 'SINE': Sine
- 'COSINE': Cosine | | Input | BASE | BOOL | | FALSE: Period referring to call (CYCLES) TRUE: Period referring to time (PERIOD) | | Input | PERIOD | TIME | TIME#1s0ms | Period time, only relevant if BASE = TRUE | | Input | CYCLES | INT | 1000 | Number of calls per period, only relevant if BASE = FALSE | | Input | AMPLITUDE | INT | | Amplitude of the function to be generated | | Input | RESET | BOOL | | TRUE: Sets OUT to zero | | Output | OUT | INT | | Generated function value |
Understanding the Variables and Their Impact
Here's a breakdown of how each input variable affects the generated function's output:
- MODE: Determines the type of function to generate. Choose from 'TRIANGLE', 'TRIANGLE_POS', 'SAWTOOTH_RISE', 'SAWTOOTH_FALL', 'RECTANGLE', 'SINE', or 'COSINE'.
- BASE: Defines how the period is calculated. If FALSE, the period is based on the number of calls (CYCLES). If TRUE, the period is based on time (PERIOD).
- PERIOD: Specifies the period time (only relevant when BASE = TRUE).
- CYCLES: Determines the number of calls per period (only relevant when BASE = FALSE).
- AMPLITUDE: Controls the amplitude (maximum value) of the generated function.
- RESET: When set to TRUE, the output value (OUT) will be reset to zero.
- OUT: Represents the output value of the generated function based on the input parameters.
Example:
If you set MODE = 'TRIANGLE', AMPLITUDE = 10, CYCLES = 100, and BASE = FALSE, the OUT value will fluctuate between -10 and 10, with 100 calls occurring within each period. Setting RESET = TRUE will reset the OUT value to zero.
By adjusting these input variables, you can create a wide range of functions with customized characteristics. Experiment with different settings to explore the possibilities.
原文地址: https://www.cveoy.top/t/topic/jl0x 著作权归作者所有。请勿转载和采集!