Project

General

Profile

Bug #3370

lua脚本setaval写入时间戳时,会不起作用

Added by shixun yan 8 months ago. Updated 8 months ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Start date:
03/21/2024
Due date:
% Done:

0%

Estimated time:

Description

AInow=os.time()
dac.setaval("OZZZEMCS_SDFX002_C01",AInow)
setaval第二个参数如果是大于7位有效数字的值,会写入失败.
代码里面第二参数为float型,如果想支持写入10位的时间戳,需要升级为双精度浮点型.

History

#1

Updated by yufeng wu 8 months ago

  • Status changed from New to Feedback

时间戳一般为1970-1-1 00:00:00开始的绝对秒,超出单精度4字节的范围
临时解决方法,可以考虑时间戳绝对秒减去2024-1-1 00:00:00 offset减小相对时间戳秒的值
界面js脚本+scada的lua脚本本分,软件暂时先不修改!

Also available in: Atom PDF