Hi, I have written something is STL.
In STL I'm a little beginner, so maybe, u guys can give some tips how to simplify my code or write it in an other way for some reason...
It's a positioning system.
When a certain pump starts, it has to regulate to a memorised position. When stopping the pump, 30s later, there must be a memorisation and then the system goes to neutral. That's all.
NW1:
Here I scale a measurement in 0 to 20mA Real Value. The sensor can give up to 24mA, so everything above 20mA is overflow.
NW2:
30s after stopping the pump, memorise the position and start (SET) regulation to neutral point (nw 3)
NW3:
regulation to neutral point
NW4:
regulation to memorised position when pump starts
here is the code:
In STL I'm a little beginner, so maybe, u guys can give some tips how to simplify my code or write it in an other way for some reason...
It's a positioning system.
When a certain pump starts, it has to regulate to a memorised position. When stopping the pump, 30s later, there must be a memorisation and then the system goes to neutral. That's all.
NW1:
Here I scale a measurement in 0 to 20mA Real Value. The sensor can give up to 24mA, so everything above 20mA is overflow.
NW2:
30s after stopping the pump, memorise the position and start (SET) regulation to neutral point (nw 3)
NW3:
regulation to neutral point
NW4:
regulation to memorised position when pump starts
here is the code:
NW1:
L #Turck
ITD
DTR
T #Turck_R
L 2.764800e+004
>R
= #I_Overflow
JCN OK
L 2.764800e+004
T #Turck_R
OK: L #Turck_R
L 2.764800e+004
/R
L 2.000000e+001
*R
T #Turck_mA
T #Actual_mA
NW2:
A #Pump
L S5T#30S
SF #Shuttimer
LC #Shuttimer
T #Shuttime_30s
A #Shuttimer
FN #Membit_1
S #Memorise
S #Regel_Neutraal
R #Mahlo_Enable
A #Memorise
JCN END1
L #Turck_mA
T #MEMORY
T #Memorised_mA
R #Memorise
END1: NOP 0
NW3:
A #Regel_Neutraal
JCN END2
L #Turck_mA
L #Neutral_mA
-R
L 1.000000e+001
*R
RND
DTR
L 1.000000e+001
/R
T #error_1_10e
L #error_1_10e
L 5.000000e-001
>R
= #L
L #error_1_10e
L -5.000000e-001
<R
= #R
AN #L
AN #R
R #Regel_Neutraal
END2: NOP 0
NW4:
A #Pump
FP #Membit_2
S #Regel_Memory
A #Regel_Memory
JCN END3
L #Turck_mA
L #MEMORY
-R
L 1.000000e+001
*R
RND
DTR
L 1.000000e+001
/R
T #error_1_10e
L #error_1_10e
L 5.000000e-001
>R
= #L
L #error_1_10e
L -5.000000e-001
<R
= #R
AN #L
AN #R
R #Regel_Memory
S #Mahlo_Enable
END3: NOP 0