I'm not got at STL and I have a little problem.
I want to create FB generating edges for PLC memory clock timer. On FB inputs you just have to assign the integer value for memory clock address and byte number where do you want to have the edge from memory clock.
Problem is with creating coil from edge.
When I detect the timer state using stat memory called "edge" the "mc" bit (in example bit 0.5) is transfer to "mce" and "mce" bit acts like "mc" - like a normal memory clock bit.
When I assign M memory bit to detect edge, everything works correctly - bit 5 on "mce" is an edge signal.
Can somebody tell me where the problem is?
Oh...in addition when I use the stat memory to detect this edge I recive "Area length error when writing".
VAR_INPUT
mc : INT ;
mce : INT ;
END_VAR
VAR
edge : BOOL ;
END_VAR
Diagnostic buffer:
I want to create FB generating edges for PLC memory clock timer. On FB inputs you just have to assign the integer value for memory clock address and byte number where do you want to have the edge from memory clock.
Problem is with creating coil from edge.
When I detect the timer state using stat memory called "edge" the "mc" bit (in example bit 0.5) is transfer to "mce" and "mce" bit acts like "mc" - like a normal memory clock bit.
When I assign M memory bit to detect edge, everything works correctly - bit 5 on "mce" is an edge signal.
Can somebody tell me where the problem is?
Oh...in addition when I use the stat memory to detect this edge I recive "Area length error when writing".
VAR_INPUT
mc : INT ;
mce : INT ;
END_VAR
VAR
edge : BOOL ;
END_VAR
Code:
L #mc // in my case 5
SLW 3
LAR1
L #mce // in my case 265
SLW 3
LAR2
A M [AR1,P#0.5] //m5.5 address
FP M 266.0 //in this case everything works
// FP #edge //in this case I recive are legnth error when writing
= M [AR2,P#0.5]
Diagnostic buffer:
Code:
Event 1 of 10: Event ID 16# 2523
Area length error when writing
Instance DB, bit access, Access address: 269
FB number: 3
Module address: 22
Requested OB: Programming error OB (OB121)
Priority class: 1
Internal error, Incoming event
10:00:24.601 AM 04/30/2017
(Coding: 16# 2523 0179 8E05 010D 0003 0016)