en-us_products:mp_studio:device_clock
Differences
This shows you the differences between two versions of the page.
| en-us_products:mp_studio:device_clock [2026/11/05 12:39] – created - external edit 127.0.0.1 | en-us_products:mp_studio:device_clock [2026/11/12 20:37] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== MP STUDIO 2 · Device | + | ====== MP STUDIO 2 · PLC Clock (RTC) ====== |
| - | The device | + | The PLC clock has the PLC write the date and time of an external DS3231 clock module connected to it into 16 words of the D area every 0.1 seconds, so that the ladder can read them directly (V1.2.0 and later). It also provides a window for setting the clock to the PC time, and an internal clock with which the PLC keeps time by itself when there is no clock module. |
| - | The device | + | The PLC has no built-in clock module, so connect a DS3231 module (I²C address 0x68) to the I²C terminals of the PLC. Check the connection pins on each product's page. The module shares |
| ===== Turning It On ===== | ===== Turning It On ===== | ||
| - | - Select **Setting | + | - Select **Settings |
| - | - Turn on **Use device | + | - Turn on **Use PLC clock (RTC)**. |
| - Enter a D area address in **Start address** (default '' | - Enter a D area address in **Start address** (default '' | ||
| - | - Click **OK**, then download the program. After the download, the device | + | - Click **OK**, then download the program. After the download, the PLC updates the time every 0.1 seconds. |
| {{ : | {{ : | ||
| - | The bottom of the window shows the flash and RAM this feature uses and its processing time (about 0.4 ms every 0.1 seconds). When it is off, the compiled program does not change by a single byte. Click **Add Names to Symbol Table** to add the names '' | + | The bottom of the window shows the flash and RAM this feature uses and its processing time (about 0.4 ms every 0.1 seconds). When it is off, the compiled program does not change by a single byte. Click **Add names to the symbol table** to add the names '' |
| ===== Layout of the 16 Words ===== | ===== Layout of the 16 Words ===== | ||
| Line 20: | Line 20: | ||
| Values are stored as decimal numbers. The tables below are for a start address of '' | Values are stored as decimal numbers. The tables below are for a start address of '' | ||
| - | ^ Address ^ Read (written by the device | + | ^ Address ^ Read (written by the PLC every 0.1 s) ^ Range ^ |
| | '' | | '' | ||
| | '' | | '' | ||
| Line 28: | Line 28: | ||
| | '' | | '' | ||
| | '' | | '' | ||
| - | | '' | + | | '' |
| ^ Address ^ Set (written by PC, HMI or ladder) ^ Description ^ | ^ Address ^ Set (written by PC, HMI or ladder) ^ Description ^ | ||
| Line 34: | Line 34: | ||
| | '' | | '' | ||
| - | To set the time from the ladder or an HMI, write the values | + | To set the time from the ladder or an HMI, write the new time values to '' |
| ===== Setting the Clock to the PC Time ===== | ===== Setting the Clock to the PC Time ===== | ||
| - | - Start monitoring ('' | + | - Download the program with the PLC clock turned on, then start monitoring |
| - | - Select **Run → Set Device | + | - Select **Run → Set PLC Clock…**. |
| - | - Click **Set to PC Time**. | + | - Click **Set to PC time**. |
| - | {{ : | + | {{ : |
| - | The window shows the PC time, the device | + | The window shows the PC time, the PLC time and the difference between them ("In sync (±1 s)", "PLC N behind" |
| - | * You can set the clock only when the device | + | * You can set the clock only when the PLC clock is turned on, monitoring or simulation is running, and the program on the PLC is confirmed to be the same as this project. If these conditions are not met, the button is disabled and the reason is shown in one line. |
| - | * Whether the program on the device is the same is confirmed from the record of downloading this program to that port (COM or IP) with MP STUDIO 2 on this PC. If it cannot be confirmed, download and then turn monitoring on again. | + | * Whether the program on the PLC matches this project |
| - | * If there is no clock module, the internal clock of the device | + | * If there is no clock module, the internal clock of the PLC is set, and you are told that the time is lost when the power is turned off. |
| * The S1 port does not accept value writes, so the clock cannot be set through it. Connect through the download port. | * The S1 port does not accept value writes, so the clock cannot be set through it. Connect through the download port. | ||
| ===== Check When Monitoring Starts ===== | ===== Check When Monitoring Starts ===== | ||
| - | When you turn on monitoring of a real device | + | When you turn on monitoring of a real PLC and the PLC time differs from the PC by 5 seconds or more, you are asked once, with a question such as " |
| ===== When There Is No Clock Module (Internal Clock) ===== | ===== When There Is No Clock Module (Internal Clock) ===== | ||
| - | * If the module is missing, is removed or cannot be read, the status becomes 1, and the device | + | * If the module is missing, is removed or cannot be read, the status becomes 1, and the PLC counts the time by itself and keeps updating it. The scan does not stop. |
| * If the power is turned on without a module, the clock counts from 2000-01-01 00:00:00. The time is lost when the power is turned off. | * If the power is turned on without a module, the clock counts from 2000-01-01 00:00:00. The time is lost when the power is turned off. | ||
| * When the module is plugged back in, the clock follows the module' | * When the module is plugged back in, the clock follows the module' | ||
| - | * The internal clock is less accurate than the module (about -2.3 seconds a day on one device). | + | * The internal clock is less accurate than the module (about -2.3 seconds a day on one PLC). |
| ===== Simulation ===== | ===== Simulation ===== | ||
| Line 69: | Line 69: | ||
| * If the 16-word block overlaps a retentive (EEPROM) D range, the program can be neither compiled nor downloaded, because the time words change constantly and would quickly shorten the life of the EEPROM. Move the block outside the retentive range or shrink the range ([[: | * If the 16-word block overlaps a retentive (EEPROM) D range, the program can be neither compiled nor downloaded, because the time words change constantly and would quickly shorten the life of the EEPROM. Move the block outside the retentive range or shrink the range ([[: | ||
| - | * If the ladder writes to the read words ('' | + | * If the ladder writes to the read words ('' |
| * The clock module uses the SDA pin, so that pin cannot be used as a counter or encoder input. | * The clock module uses the SDA pin, so that pin cannot be used as a counter or encoder input. | ||
| - | * A project file ('' | + | * A project file ('' |
| ===== Related Pages ===== | ===== Related Pages ===== | ||
en-us_products/mp_studio/device_clock.1793849997.txt.gz · Last modified: by 127.0.0.1
