I am trying to check if a function is called every 2 miliseconds by way of a script. For this I need to read the value of a timer but I get the error 'memory access not allowed' when I try to read it(Data.Long(D:0xF00001010)). This is may code:
GLOBAL &calledFunction &result &difftime &start &end
&calledFunction = "func1"
Go
BREAK.SET &calledFunction /Program
WAIT !STATE.RUN() 5.0s
IF (STATE.RUN())
(
&result = "failed"
)
ELSE
(
&start = Data.Long(D:0xF00001010)
Go
WAIT !STATE.RUN() 5.0s
IF (STATE.RUN())
(
&result = "failed"
)
ELSE
(
&end = Data.Long(D:0xF00001010)
&difftime = &start - &end
IF (&difftime == 2ms)
(
&result = "passed"
)
ELSE
(
&result = "failed"
)
)
)
break.Delete
break
ENDDO
Is there any way I can access the timer's value or maybe another solution to check if the function is called periodically? I tried using the runtime functions but the accuracy is not so good.