FB_Play

FB_Play 1:

Playback function block

Syntax

Definition:

FUNCTION_BLOCK FB_Play
VAR_INPUT
    bPlay                : BOOL;
    sPath                : STRING;
    nConfigurationId     : UINT;
END_VAR
VAR_OUTPUT
    bBusy                : BOOL;
    bError               : BOOL;
    nErrorId             : ETcsSpeechCommandExitCode;
    nLastCommandExitCode : UINT;
    nPlaybackPosition    : ULINT;
    nPlaybackTotal       : ULINT;
END_VAR

FB_Play 2: Inputs

Name

Type

Description

bPlay

BOOL

Rising edge starts the playback.

sPath

STRING

File path to the audio file. 16 kHz sample rate, 16 bit sample size, 1 channel.

nConfigurationId

UINT

ConfigurationID to be used for audio output.

FB_Play 3: Outputs

Name

Type

Description

bBusy

BOOL

Function block is busy.

bError

BOOL

Function block is in error state.

nErrorId

ETcsSpeechCommandExitCode

ErrorId, which indicates the exact reason for the error.

nLastCommandExitCode

UINT

Return value of the last call.

nPlaybackPosition

ULINT

Current position of the speech output.

nPlaybackTotal

ULINT

Total length of the speech output.

FB_Play 4: Methods

Name

Description

SetAmsNetAddr

Method to specify a different AmsNetAdr for the TcSpeech service. Only needs to be called up once.

Required License

TC3 Speech