[?] simple piece of code not working (STL).

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Post Reply
stargazer
Posts: 7
Joined: Mon Dec 24, 2007 11:48 am
Location: Russia

[?] simple piece of code not working (STL).

Post by stargazer »

a simple check if the value DB50.Man_Speed_1 is in range (0-100).
doesn't actually work (in PLCSim for now).

Code: Select all

// 
// Check if entered value is above zero
// 
      L     DB50.Man_Speed_1    // should be above 0
      L     0.000000e+000
      >=R   
      JC    CH1
      L     0.000000e+000
      T     DB50.Man_Speed_1    // is set to 0 
CH1:  CLR   
//  
// Check if entered value is not more than 100
// 
      L     DB50.Man_Speed_1    // should be less than 100 or equal
      L     1.000000e+002
      <=R   
      JC    CH2
      L     1.000000e+002
      T     DB50.Man_Speed_1    // is set to 100
CH2:  CLR   
where did I go wrong?
graf_STEP7
Posts: 57
Joined: Tue Feb 13, 2007 5:41 pm
Location: Europe

Post by graf_STEP7 »

Hi

You Code are work.
if DBW --> DBD dw

Try this modify Code:

Code: Select all

// 
// Check if entered value is above zero 
// 

l 55.0
t md50

      L     md50   // should be above 0 
      L     0.000000e+000 
      >=R    
      JC    CH1 
      L     0.000000e+000 
      T     md50                     // is set to 0 
CH1:  CLR    
//  
// Check if entered value is not more than 100 
// 
      L     md50                     // should be less than 100 or equal 
      L     1.000000e+002 
      <=R    
      JC    CH2 
      L     1.000000e+002 
      T     md50                        // is set to 100 
CH2:  CLR
When this Code are work, test the Variable "DB50.Man_Speed_1".
Is it Posible, the result is Override your Variable fron an another Prozess.

Sorry for my English :oops:
sania
Site Admin
Posts: 1381
Joined: Sat Aug 13, 2005 6:15 am
Contact:

Post by sania »

see in russian http://plc.net.ru/viewtopic.php?p=15017#15017
P.S. in future don`t duble post :!:
Post Reply