wincc的时间提取问题

WINCC中有个时间函数是now(),可以提取系统时间,可以精确到秒,但是现在我想让提取到得时间精确到毫秒,请问有什么别的函数没有,或者有什么好的方法?

最佳答案

可以用Timer函数实现:
 Sub OnLButtonDown(ByVal Item, ByVal Flags, ByVal x, ByVal y)                  
 Dim szTime
 szTime = FormatDateTime(Now(),vbLongTime)
 Dim iMillSec,szMillSec
 iMillSec = Fix((Timer()-Fix(Timer()))*1000)
 szMillSec = Left(CStr(iMillSec)&"000",3)
 HMIRuntime.Trace szTime & "." & szMillSec & vbCrLf
 End Sub

提问者对于答案的评价:
谢谢

原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc271800.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2019年6月11日
下一篇 2019年6月11日

相关推荐