FB_ALY_SignalGenerator_1Ch
Signal Generator 1Ch can be used to generate various signal curves. The signal type, the frequency, the amplitude and the offset can be set individually.
Syntax
Definition:
FUNCTION_BLOCK FB_ALY_SignalGenerator_1Ch
VAR_OUTPUT
ipResultMessage: Tc3_EventLogger.I_TcMessage;
bError: BOOL;
bNewResult: BOOL;
bConfigured: BOOL;
fSignal: LREAL;
END_VAR
Outputs
Name | Type | Description |
---|---|---|
ipResultMessage | Contains more detailed information on the current return value. This special interface pointer is internally secured so that it is always valid/assigned. | |
bError | BOOL | This output is |
bNewResult | BOOL | When a new result has been calculated, the output is |
bConfigured | BOOL | Displays |
fSignal | LREAL | Output of the configured signal |
Methods
Name | Definition location | Description |
---|---|---|
Call() | Local | Method for calculating the outputs for a specific configuration. |
Configure() | Local | General configuration of the algorithm with its parameterized conditions. |
Reset() | Local | Resets all internal states or the calculations performed so far. |
Sample
VAR
fbSignalGenerator : FB_ALY_SignalGenerator_1Ch;
eFunctionType : E_ALY_FunctionType := E_ALY_FunctionType.Sine;
fSampleRate : LREAL := 1000.0;
fFrequency : LREAL := 50.0;
fAmplitude : LREAL := 100.0;
fOffset : LREAL := 0.0;
bConfigure : BOOL := TRUE;
END_VAR
// Configure algorithm
IF bConfigure THEN
bConfigure := FALSE;
fbSignalGenerator.Configure(eFunctionType, fSampleRate, fFrequency, fAmplitude, fOffset);
END_IF
// Call algorithm
fbSignalGenerator.Call();
Requirements
Development environment | Target platform | Plc libraries to include |
---|---|---|
TwinCAT v3.1.4024.0 | PC or CX (x64, x86) | Tc3_Analytics |