Another STL simplification

userxyz

Member
Join Date
May 2002
Location
any
Posts
2,768
How would you write this...

What I do is length/speed = time in ms, to be used for SFB4


L "speed m/min deel 1"
ITD
DTR
L 1.000000e+001
/R
T #Speed_Real
L 2.900000e+000
>R
JC CAL1
L 0.000000e+000
JC Nul1
CAL1: L 1.500000e+001
L #Speed_Real
/R
L 6.000000e+004
*R
Nul1: RND
T "B_S_MEM".Starttijd // Starttijd in ms
 
seems to me length(in mm)/m per min = time (mS)

so something travelling at 2m per min over 1 metre would take 1000/2 = 500mS.

Code:
L "speed m/min deel 1" 
L 0
<=I
JC TIME // If not greater than zero, make time zero
 
L "length" //presuming this is fixed in Floating Point (REAL)
L "speed m/min deel 1"
ITD
DTR // Convert speed to REAL
/R
RND
TIME: T "B_S_MEM".Starttijd // Starttijd in ms
 
hi

L "speed m/min deel 1" // speed from 0 to 30m/min
ITD
DTR
L 1.000000e+001 // the value is 0 to 300, but should be 0 to 30 m/min

/R
T #Speed_Real // speed in real value

L 2.900000e+000 // 3m/min is the minimum speed of the machine

>R
JC CAL1
L 0.000000e+000 // send 0 if less then 2.9m/min
JC Nul1
CAL1: L 1.500000e+001 // 15 meters distance to make
L #Speed_Real
/R
L 6.000000e+004 // x 60 x 1000 = ms instead of minuts

*R
Nul1: RND // round actual value in accu 1
T "B_S_MEM".Starttijd
 
Code:
L "speed m/min deel 1" 
L 30
<I
L 0
JC TIME // If not greater than 3, make time zero
 
L "length" //presuming this is fixed in Floating Point (REAL)
L "speed m/min deel 1"
ITD
DTR // Convert speed to REAL
/R
L 1.000000e+001 // the value is 0 to 300, but should be 0 to 30 m/min
*R
RND
TIME: T "B_S_MEM".Starttijd // Starttijd in ms
 

Similar Topics

Hi, I'm still trying to translate ladder into statement list as I am trying to get better at understanding and writing STL. I asked a question...
Replies
10
Views
4,050
Hi, The hardware is: Click Plc model # CO-O1DD1-O HMI model # S3ML-R magnetic-inductive flow meter model # FMM100-1001. I will set the flow meter...
Replies
4
Views
163
So I had an odd request from a customer for the above. I have written the logic and tested it all in one PLC with only using 7 outputs and 7...
Replies
15
Views
428
Hello I need to message read the entire 16 channel raw analog inputs from a 1769-L33ER Compact Logic controller to another 1769-L33ER Compact...
Replies
8
Views
249
I am noticing a problem where i am using MOV instruction and writing literal text into source and String datatype in destination. It works fines...
Replies
6
Views
491
Back
Top Bottom