SYS_RINGCOUNTER_10us_RESOLUTION_ns

PLC状态信息

数据类型

DINT

名称

环形计数器分辨率

PLC从属10,24ms10,67ms类型环形计数器的分辨率,以纳秒为单位。

使用条件编译确保为每个PLC类型计算精确时间值:

实例
#if (IsSystemVariableSupported('sys_iRingCounter_10usXX')) #then
    if (NOT bIsInitialized) then
        bIsInitialized:=TRUE;
        iRingCounter_Old:=sys_iRingCounter_10usXX;
    else
        iRingCounter_New:=sys_iRingCounter_10usXX;
        iRingCounterDiff:=iRingCounter_New-iRingCounter_Old;        
        diScanTime_ns:=INT_TO_DINT(iRingCounterDiff)*SYS_RINGCOUNTER_10us_RESOLUTION_ns;
        iRingCounter_Old:=iRingCounter_New;
    end_if;
#end_if;

最后更新日期: 2020-02-20此页面上的反馈松下热线