当前位置:网站首页>Beifu PLC obtains system time, local time, current time zone and system time zone conversion through program
Beifu PLC obtains system time, local time, current time zone and system time zone conversion through program
2022-06-26 13:15:00 【Dusk and starry sky】
This article explains TwinCAT To get the local 、 System time and current time zone , And explain how the current time is converted into a string type .
- Operation process
1.1. Get system time
1.1.1. GETSYSTEMTIME
Use to GETSYSTEMTIME Function block , What you get here is Greenwich mean time . Use this block to read the operating system timestamp . The time stamp is a 64 Bit integer value , Accuracy of 100ns, Every time PLC Will be updated when called . Among other purposes , It can also be used for timing tasks or time measurement . One unit is equivalent to 100 nanosecond . The reason for implementing this service as a block rather than a function , The reason is simple , Because you have to return two values , According to the definition , This is a function that cannot be completed .
1.1.2. The system time is converted to a string String
Need to use FILETIME_TO_SYSTEMTIME and SYSTEMTIME_TO_STRING


1.2. Get local time
1.2.1. NT_GetTime
This function block is used to obtain the local time , Time obtained in TIMESTRUCT Data structure output :
边栏推荐
- Detailed explanation of C const: definition and use of C constant
- 享元模式(Flyweight)
- Electron official docs series: Distribution
- Electron official docs series: Examples
- J - Wooden Sticks poj 1065
- 偶言佳句,孤芳自赏
- Fire warning is completed within 10 seconds, and Baidu AI Cloud helps Kunming Guandu build a new benchmark of smart city
- HDU 3555 Bomb
- Processing function translate (mousex, mousey) learning
- IDC report: the AI cloud market share of Baidu AI Cloud ranks first for six consecutive times
猜你喜欢

Power Designer - Custom Comment button

Chapter 01_ Installation and use of MySQL under Linux

5月产品升级观察站

Adapter mode

Arcpy - - utilisation de la fonction insertlayer (): ajout de calques dans un document de carte

IDC report: the AI cloud market share of Baidu AI Cloud ranks first for six consecutive times

Bridge mode

倍福TwinCAT通过Emergency Scan快速检测物理连接和EtherCAT网络

适配器模式(Adapter)

MySQL数据库常见故障——遗忘数据库密码
随机推荐
. Net Maui performance improvement
8、【STM32】定时器(TIM)——中断、PWM、输入捕获实验(一文精通定时器)
倍福NC轴状态转移图解析
Electron official docs series: References
Basic principle and application routine of Beifu PLC rotary cutting
Guacamole installation
Accumulation of interview questions
UVA10341 solve it 二分
倍福TwinCAT3 NCI在NC轴界面中的基本配置和测试
Electron official docs series: Distribution
倍福TwinCAT3实现CSV、TXT文件读写操作
橋接模式(Bridge)
Detailed explanation of C const: definition and use of C constant
Opencv high speed download
倍福CX5130换卡对已有的授权文件转移操作
Electron official docs series: Best Practices
scrapy——爬取漫画自定义存储路径下载到本地
Uva5009 error curves three points
Processing polyhedron change
E - Apple Catching