Please enable JavaScript to view this site.

Waijung 2 User Guide

How this block appears in a Simulink model?

sntp_block_1

What can be configured?

sntp

Configuration Parameter

Selectable Option/Value

Description

SNTP Server name

 

Enter the SNTP server name

Get data from inputs

 

To get data from a input port

Time Zone

 

Enter the time zone

Enable sync interval

Check-Uncheck

Time refresh period by connecting to the NTP

Sync interval

 

Enter the time interval (seconds, minutes, hours and days)

Enable sync interval event through ISR port

Check-Uncheck

After time syncing by connecting to the NTP if there is any more things to do using this you can achieve this

Output status

 

Output status of the configured parameters

Port Name

Port Type

Date Type

Description

Trigger

Scalar

Any data type

Expected values True or False(1 or 0), This block only active when this pin becomes True(1)

When to use this block?

Simple Network Time Protocol (SNTP) block can be used to get the time from any SNTP server.

Limitations

This block need to have a WIFI_block to communicate with the server.

Demo

Demo file : esp32_system_time_demo.slx

sntp_block_3

Inside of the if action subsystem.

sntp_block_4

Description

This demo use SNTP_block to update the ESP32 local time with the server. There it need to be connect to the WIFI first from the WIFI_block. Once it connect SNTP will synchronize the time with the server. Then System_time_block will get the internal time from the esp and give the output to a String_processing_block. It will process the string and print it for the user.

What should be happening?

Firstly it will connect to the server by using the WIFI block. When the WIFI connection is established it will update the local time. Please check the Serial Monitor for the more info (baud rate : 115200). It will log the current time there.

sntp_block_5

Copyright 2024 Aimagin Co.,Ltd. Rev.1454