How we started production, or my experience in developing software for Siemens Simatic PLCs

I would like to tell about my experience in commissioning and development of industrial software. When reading the article, please take into account that the matter happened almost two years ago, and a lot has changed since then.

So, in the early spring of 2014, I went up to the third floor of the concrete mixing unit of one plant. I had two Wiggert planetary concrete mixers at my disposal, a Kubat address line for two monorails, and a completely bombed workshop below where concrete had to be delivered. In perspective.

What was the tricky plan? We had to start from scratch the production of hollow core flooring in one span of the workshop and wall panels in another.

Here is a sectional view of a hollow flooring:

image
Photo from echo.co.za

So, to test a concrete mixer, you need to put somewhere successfully (or not so) produced concrete. The option with ten jamshuts was not considered, therefore it is necessary to connect the address feed (AP). The mechanical part of the AP includes a pair of specially trained shuttles (cues), rolling on a monorail, and a concrete distributor, controlled in semi-automatic mode:



We begin to taste the documentation on Kubat: the electrical part consists of a central control cabinet for 314-2DP, two ET200S stations (shuttles) and CPU 313-2DP IFM (distributor), communicating via Powercom (analog of Siemens PowerRail, i.e. RS-485 for 220 / 380V trolleys).



Oops, and here is the first rake: there are no software sources and is not expected. Okay, open the controller passwords with a special utility. With the distributor, everything is more or less normal, but the central rack is decompiled into kernel porridge on STL, because most of the program is written in SFC, it is not clear which version.

Okay, no question. To begin with, I send installers to run communications along monorails, connect power and install sensors, at this time I look at the circuit:



So, the Nord inverter, controlled by Profibus. In our case, it is used to power the movement and rotation drives. Download the documentation, light up the control registers and write the code:

FUNCTION_BLOCK nord_control
VAR_INPUT
    cmd:INT;    //0 - fast stop
                //1 - smooth stop
                //2 - run to setpoint
                //3 - get info;
    setpoint:REAL;
    hw_addr:INT;    
END_VAR
VAR_OUTPUT
    state:TNordInfo;
END_VAR
VAR_TEMP
    // Temporary Variables
    d: ARRAY [0..5] OF WORD;
    setpoint1:REAL;
END_VAR
VAR
    t:INT;
    c: WORD;
    s: WORD; 
    cw AT c: TNord_CW;
    sw AT s: TNOrd_SW;
    st:WORD;       
END_VAR
    s:=IW[hw_addr]; //256 257 state word *
    state.sw:=sw;
    state.act_value1:=INT_TO_REAL(WORD_TO_INT(IW[hw_addr+2]))*50/16384;//258 259
    state.act_value2:=INT_TO_REAL(WORD_TO_INT(IW[hw_addr+4]))*50/16384;//260 261
    state.act_value3:=INT_TO_REAL(WORD_TO_INT(IW[hw_addr+6]))*50/16384;//262 263 
    state.w0:=IW[hw_addr+8];//264 265
    state.w1:=IW[hw_addr+10];//266 267
    // Statement Section
    CASE cmd OF
    0:  c:=0;
        cw.ack_err:=TRUE;   //SWITCH OFF;
        cw.enable_op:=FALSE;
        cw.on1:=FALSE;        
        cw.on2:=FALSE;
        cw.on3:=FALSE;
        cw.enable_op:=FALSE;            
        cw.enable_ramp:=FALSE;
        cw.unfreeze_ramp:=FALSE;
        cw.en_setpoint:=FALSE;            
        cw.pzd_valid:=FALSE;
        setpoint1:=0;
        t:=0;
    1:  cw.on1:=FALSE;
    2:  setpoint1:=setpoint;
        CASE t OF //run to setpoint
        0:  IF (sw.start_disabled=TRUE) THEN //wait for mains voltage
                t:=1;
            END_IF;
        1:  cw.on2:=TRUE;  //switch to standby
            cw.on3:=TRUE;
            cw.enable_op:=TRUE;            
            cw.enable_ramp:=TRUE;
            cw.unfreeze_ramp:=TRUE;
            cw.en_setpoint:=TRUE;            
            cw.pzd_valid:=TRUE;
            cw.ack_err:=FALSE;        
            IF (sw.ready=TRUE) AND //Wait for standby
               (sw.no_off2=TRUE) AND
               (sw.no_off2=TRUE) THEN //change to no_off3
                t:=2;
            END_IF;          
        2:  cw.on1:=TRUE;
            t:=3;
        END_CASE;        
    END_CASE;
    IF cmd<3 THEN   //Write data
        QW[hw_addr]:=c;
        st:=INT_TO_WORD(REAL_TO_INT((setpoint1*16384.0/50.0)));
        QW[hw_addr+2]:=INT_TO_WORD(REAL_TO_INT((setpoint1*16384.0/50.0)));       
    END_IF;
END_FUNCTION_BLOCK

Oh, it seems the shuttle has gone, but, it seems, some joyful cries are heard from below. With swearing screams, the installers are trying to escape along the crane tracks from the rushing five-ton piece of iron. Emergencyly turn off the power and take a break to count the personnel.
It would be nice to have at least some visualization. OK, make a small projection for the touch panel.



Within a couple of weeks I finish the rest of the program (there should be a picture about an owl) so that it would be possible to deliver concrete ... which is not there yet.

In the meantime, concreting of thermostatic stands ends below and the Echo line can be re-opened. Everything is simple here. Or almost simple. The cars have stood in the rain and pigeon feces since 2008, the trolley and slip-former, after refueling and cleaning, begin to work normally, but the saw throws a full screen of errors and says that it won’t go anywhere.



Good comrades from Deutschland are eager to help, but only for several tens of thousands of euros. Rubles do not accept.
Well, download the program from the controller, try to understand what it needs. Everything looks as if two positioning axes are jammed. In principle, this is not surprising: the power modules in two inverters have completely burned out. Well, we order the new Emerson Unidrive and, in order not to waste time, we return to the BSU for the sekas with planetary concrete mixers.

One Wiggert is already mounted, connected and, it seems, even tested. However, as always, the devil is in the details (well, this, of course, except for the extremely curved air connection and electrical wiring).



Inert dosage is good, fun, with an accuracy of 500 kilograms. I regulate the sensors for opening the dispensers, set the amount of additional load, the error decreases to 2-10 kg.

In a couple of weeks, chastotniks arrive. We put them in the cabinet, carry out the transfer of settings (yes, there are still SM-Applications Plus modules with their programs) and axis referencing.



Profit! You can start to produce products. Of course, if you first choose the composition of concrete.

In general, it ended with a happy end and the line has been working successfully to this day.

Also popular now: