当前位置:网站首页>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 :
边栏推荐
- Biff TwinCAT can quickly detect the physical connection and EtherCAT network through emergency scan
- IDC报告:百度智能云AI Cloud市场份额连续六次第一
- SQL assigns the field value of data table B to a column in data table a
- C# 结构体:定义、示例
- QT . Establishment and use of pri
- System tasks (display / print class) in Verilog - $display, $write, $strobe, $monitor
- MySQL数据库讲解(五)
- UVa11582 [快速幂]Colossal Fibonacci Numbers!
- 5月产品升级观察站
- B - Bridging signals
猜你喜欢
随机推荐
Processing polyhedron change
Map value
Explain C language 10 in detail (C language series)
C - Common Subsequence
UVA5009 Error Curves三分
map 取值
What are the common categories of software testing?
Oplg: new generation cloud native observable best practices
Dark horse notes - Common APIs
Learning Processing Zoog
HDU 5860
I - Dollar Dayz
Electron official docs series: Best Practices
偶言佳句,孤芳自赏
Arcpy——InsertLayer()函數的使用:摻入圖層到地圖文檔裏
Processing random generation line animation
5月产品升级观察站
Explain C language 11 in detail (C language series)
C语言:练习题二
倍福将EtherCAT模块分到多个同步单元运行--Sync Units的使用








