DTGetNTPSync

 Function Block - Read the NTP synchronization enable state.

This function block is specific for PCMM2G only.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

FALSE, TRUE

N/A

No default

If TRUE, request to read the synchronization enable state.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

FALSE, TRUE

N/A

If TRUE, the command completed successfully.

Error

BOOL

FALSE, TRUE

N/A

If TRUE, an error has occurred.

ErrorID

DINT

No range

N/A

Indicates the error if the Error output is set to TRUE.

Error Codes

  • 23 = Internal error.
    See the controller log for details.
  • 15000 = Controller type does not support this function block.

SynchEn

BOOL

FALSE, TRUE

N/A

The present NTP synchronization state.

  • TRUE = synchronization enabled.
  • FALSE = synchronization disabled.

Remarks

None

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

// read the NTP synchronization state
Inst_DTGetNTPSync( bGetNTPSync );
if Inst_DTGetNTPSync.Done then
   bGetNTPSync := false;

   if NOT Inst_DTGetNTPSync.Error then
      bNTPSyncEnable := Inst_DTGetNTPSync.SynchEn;
   else
      ErrorID := Inst_DTGetNTPSync.ErrorID;
   end_if;
end_if;

See Also