Siemens Sirius 3RW44 Soft Starter Function Block for Step 7

Siemens Sirius 3RW44

Since I couldn't locate any examples to control a Siemens Sirius 3RW44 soft starter via Profibus DP in an S7-300 system using Step 7 — without PCS 7 or Soft Starter ES software — I decided to write my own reusable function block. Since others may be running into the same problem, I decided to post the code here (project archive is attached to this post). The starter has 16 inputs and 16 outputs that can be addressed with basic load and transfer statements and provide a simple means of controlling the starter. But communication over a fieldbus is far more advanced.

First of all, I recommend downloading the SIRIUS 3RW44 System Manual (see the links section at the end of this article). If you can't find it search Siemens support for the part number of your starter.

Disclaimer

This is quite a lengthy post. If you're not comfortable with STL and indirect addressing then this may not be for you.

This code worked for me in my project but it may not work for you.

Don't take my word for anything, it is your equipment (and your life) at risk. I whipped this up quickly so test thoroughly and use at your own risk.

This project was created in Step 7 v5.5 for use with starter model 3RW4427-1BC35 and Profibus module model 3RW4900-0KC00. It also works with TIA Portal v11 and newer.

Down to business: Sirius 3RW44 function block

A fieldbus module enables the retrieval of a treasure trove of operational and diagnostic data. It is worthwhile reading the SIRIUS 3RW44 System Manual, chapter 8 PROFIBUS DP Communication Module and then pick and choose the bits of my code to accomplish your objective. A link to a sample project is at the end of this post.

All data requested from the starter is stored in an instance DB that utilizes a user defined data type (UDT) for the datasets. Even if you decide to roll your own code you can still use these UDT's in your own FB's or DB's since the data structure from the datasets is fixed.

The actual FB call from your program looks like this:

      CALL  "Siemens_Sirius_3RW44_v11" , "Sirius iDB"
       I_Start      :="Start"           // Motor start permissive
       I_MotorCCW   :="Reverse"         // Reverse rotation requested
       I_MotorSlow  :="Jog"             // Slow rotation requested
       I_FaultReset :="FAULT RESET"     // Alarm reset request
       I_PI_ADDR    :=260               // Peripheral input address for device
       I_PQ_ADDR    :=260               // Peripheral output address for device
       I_ParmSet    :="ParmSetNbr"      // Desired parameter set (1..3)
       I_Parm_DB    :=60                // DB number for parameter exchange
       O_Ready      :="StarterReady"    // Soft starter indicates ready to start
       O_Running    :="Running"         // Motor running
       O_Ramping    :="Ramping"         // Motor ramping up
       O_Stopping   :="Stopping"        // Motor stopping
       O_U_line_avg :="LineVoltage"     // Actual average line voltage [Vac]
       O_I_line_avg :="LineCurrent"     // Actual average line current [A]
       O_I_phase_pct:="Load"            // Actual motor load [%]
       O_F_out      :="OutputFrequency" // Actual output frequency [Hz]
       O_Asymmetry  :="Asymmetry"       // Actual current imbalance [%]
       O_T_heatsink :="TE heatsink"     // Actual heat sink temperature [C]
       O_Power      :="OutputPower"     // Actual motor power [Hp]
       IO_RampDone  :="Ramp Done"       // Set once when ramping up completed
       IO_Warning   :="Warning"         // Soft starter active warning
       IO_Fault     :="ALARM"           // Soft starter active fault
       IO_DataFault :="Data fault"      // Soft starter comms fault
       IO_ParmRead  :="Starter parm READ"    // Request a parameter READ
       IO_ParmWrite :="Starter parm WRITE"    // Request a parameter WRITE
       IO_Status    :="Status"          // Fault status from FB

Since the comments are pretty much self-explanatory, I will proceed to break down the actual FB. Some networks may be skipped but these are, again, self explanatory (like some rudimentary error checking of parameters such as PI and PQ addresses, etc).

The FB inputs I_PI_ADDR and I_PQ_ADDR need to match the start of the inputs and outputs as defined in the hardware configuration of your project.

We will read the inputs, request several datasets, and write the outputs. I started with the code to allow reading and writing of the starter configuration data but in actuality I have found I didn't need it for the job. Should you decide to use that function you need to do some thorough testing first.

Network 1: Initial error trapping

This network handles some common issues such as invalid parameter numbers, PI/PQ addresses, etc. In my particular instance, I regard an address of 0 as invalid. Even though it is a perfectly valid address, I made the assumption during commissioning that the address was not specified in the calling code mistakenly. Adapt it to suit your needs.

The FB returns a status code that could assist in determining the cause of errors during commissioning but it is not intended to be the perfect solution.

Network 2: Read device peripheral inputs

Here we read the 16 inputs from the starter. #I_PI_ADDR is a user supplied input and should correspond to the address specified in the hardware configuration.

// Map the 16 peripheral input bits from the
// soft starter to the instance DB
      TAR1  #T_AR1                      // Store address register 1
      L     #I_PI_ADDR                  // Convert PI address to pointer
      ITD
      SLD   3
      LAR1                              // Load address register with address to PI
      L     PIW [AR1,P#0.0]             // Load accu1 with 16 bits of peripheral inputs
      LAR1  P##PI                       // Load address register with address to instance DB
      T     DIW [AR1,P#0.0]             // Copy accu1 to instance DB
      LAR1  #T_AR1                      // Restore address register 1

We will also copy the address integer to word format as expected by the SFC calls:

// Convert PI and PQ addresses to word format for SFCs
      L     #I_PI_ADDR                  // Peripheral input address
      T     #T_PI_AddrWord              // ...copy to word format
      L     #I_PQ_ADDR                  // Peripheral output address
      T     #T_PQ_AddrWord              // ...copy to word format

Network 3: Read data set 92 (device diagnostics)

The first dataset I read is 92, which returns 30 bytes of soft starter diagnostics data. (Details can be found in chapter 8.12.9.) We request this dataset continuously by forcing the request for SFC59 "RD_REC" and we check the return value of this SFC to catch communication errors (0x8000 and up).

The IOID needs to be B#16#54 to indicate we are reading from the peripheral inputs. The parameter value RECNUM should be B#16#5C for dataset 92.

// Common RET_VAL values:
//   0x7000 : First call with REQ=0, BUSY=0, no data xfer active.
//   0x7001 : First call with REQ=1, BUSY=1, no data xfer active.
//   0x7002 : Interim call (REQ irrelevant), data xfer active, BUSY=1.
//   0x80** : Error code.

// Request dataset 92, read device diagnostic data
      SET                               // Cyclically request data for now
      =     #DS92_Rq
      CALL  "RD_REC"
       REQ    :=#DS92_Rq                // Request
       IOID   :=B#16#54                 // B#16#54 = Peripheral input
       LADDR  :=#T_PI_AddrWord          // PLC CPU station address as configured in h'ware config
       RECNUM :=B#16#5C                 // Dataset requested: 92 = 0x5C
       RET_VAL:=#DS92_RetVal            // Return value
       BUSY   :=#DS92_Busy              // Busy state
       RECORD :=#DS92                   // Pointer to storage

// Error trapping
      L     #DS92_RetVal
      AW    W#16#8000                   // 0x80** are SFC errors
      L     W#16#8000
      ==I
      JCN   _03a
      L     2092                        // 2000=read, dataset=92
      T     #IO_Status
_03a: NOP   0

Network 4: Read data set 94 (measured values)

Details are described in chapter 8.12.11. Data set 94 returns 64 bytes of useful values such as phase currents and voltages, current asymmetry, and various internal temperatures. The current returned by the 16 input bits is very low resolution, this data is much more accurate.

Again, make sure the IOID corresponds to B#16#54 because we are reading from peripheral inputs, and set RECNUM to B#16#5E to request data set 94.

// Common RET_VAL values:
//   0x7000 : First call with REQ=0, BUSY=0, no data xfer active.
//   0x7001 : First call with REQ=1, BUSY=1, no data xfer active.
//   0x7002 : Interim call (REQ irrelevant), data xfer active, BUSY=1.
//   0x80** : Error code.

// Request dataset 94, read measured values
      SET                               // Cyclically request data for now
      =     #DS94_Rq
      CALL  "RD_REC"
       REQ    :=#DS94_Rq                // Request
       IOID   :=B#16#54                 // B#16#54 = Peripheral input
       LADDR  :=#T_PI_AddrWord          // PLC CPU station address as configured in h'ware config
       RECNUM :=B#16#5E                 // Dataset requested: 94 = 0x5E
       RET_VAL:=#DS94_RetVal            // Return value
       BUSY   :=#DS94_Busy              // Busy state
       RECORD :=#DS94                   // Pointer to storage

// Error trapping
      L     #DS94_RetVal
      AW    W#16#8000                   // 0x80** are SFC errors
      L     W#16#8000
      ==I
      JCN   _04a
      L     2094                        // 2000=read, dataset=94
      T     #IO_Status
_04a: NOP   0

Network 5: Write function block outputs

Next, we make some of the data available to the calling program. For my application I found it important to detect the phase of the starting/stopping process. I also return some common data such as average phase current and voltage, etc. Change to suit your needs.

// Ready status
      A     #PI.Ready                   // Ready status from peripheral input
      A     #DS92.Ready                 // Ready status from profibus
      =     #O_Ready                    // --Return soft starter ready state

// Running status
      A(
      O     #DS92.MotorCW               // Profibus reports running clockwise
      O     #DS92.MotorCCW              // Profibus reporting running counter clockwise
      )
      =     #O_Running                  // --Return motor running status

// Indicate ramping
      A     #DS92.Starting              // Profibus reports ramp up
      =     #O_Ramping                  // --Return ramp up status

// Indicate stopping
      A     #DS92.Stopping              // Profibus reports ramp down
      =     #O_Stopping                 // --Return ramp down status

// Indicate ramp up has completed
      A(
      O     #DS92.MotorCW               // Running CW or CCW
      O     #DS92.MotorCCW
      )
      AN    #DS92.Stopping              // Not ramping up
      AN    #DS92.Starting              // Not ramping down
      S     #IO_RampDone                // --Update up-to-speed status (up-to-speed)

      O     #DS92.Stopping              // Ramping down
      O     #DS92.Starting              // Ramping up
      O
      AN    #DS92.MotorCW               // Not running
      AN    #DS92.MotorCCW
      R     #IO_RampDone                // --Update up-to-speed status (ramping)

// Average line phase voltage
      L     #DS94.U_L1L2
      L     #DS94.U_L2L3
      +I
      L     #DS94.U_L1L3
      +I
      ITD
      DTR
      L     3.000000e+001               // Average: U * 1/3 * 1/10 for 1 implied decimal
      /R
      RND
      T     #O_U_line_avg               // --Return average line phase to phase voltage [V]

// Average line phase current
      L     #DS94.I_L1
      L     #DS94.I_L2
      +D
      L     #DS94.I_L3
      +D
      DTR
      L     3.000000e+002               // Average: I * 1/3 * 1/100 for 2 implied decimals
      /R
      RND
      T     #O_I_line_avg               // --Return average line phase current [A]

// Average phase current as %
      L     #DS94.L1_Amps
      L     #DS94.L2_Amps
      +I
      L     #DS94.L3_Amps
      +I                                // Sum all values
      ITD
      DTR
      L     3.125000e+000               // Unit is [3.125%]
      *R
      L     3.000000e+000               // Average
      /R
      RND
      T     #O_I_phase_pct              // --Return motor load [%]

// Output frequency
      L     #DS94.FreqOut               // Output frequency [0.5Hz]
      L     2
      /I
      T     #O_F_out                    // --Return output frequency [Hz]
// ..return negative frequency for CCW rotation
      A     #I_MotorCCW
      JCN   _05a
//      L     #O_F_out
//      L     -1
//      *I
//      T     #O_F_out                    // --Negative output frequency [Hz]

// Current asymmetry
_05a: L     #DS94.Asymmetry
      T     #O_Asymmetry                // --Return current asymmetry [%]

// Heatsink temperature
      L     #DS94.T_heatsink
      T     #O_T_heatsink               // --Return heatsink temperature [deg C]

// Output power
      L     #DS94.P_out                 // Output power [0.1 W]
      DTR
      L     7.460000e+003
      /R
      RND
      T     #O_Power                    // --Return output power [Hp]

If you desire to return a negative frequency when rotating counter clockwise, then uncomment the code for that.

Network 6: Write warning and fault status

Adjust the code to suit your particular needs. I return the most common faults and warnings. Warnings will be displayed on the HMI but will not interrupt operation, and alarms will be displaye, recorded in the alarms history, and will interrupt operation.

I found that the starter's check for main voltage presence is very sensitive to small power fluctuations.

The alarm and warning flags are copied to a separate area in the data block for review until manually reset.

The code is so uncomplicated, just see the source code.

Network 7: Prepare the peripheral outputs for writing

The next two networks prepare and write the peripheral outputs to the starter. This includes start permissives for clockwise/counter clockwise, alarm reset, and parameter set selection.

The way I utilize the parameter sets is as follows. Parameter set 1 is copied to parameter set 2 with a different start mode. Instead of soft starting (starting mode is "voltage ramp + current limiting", I allow a direct start (starting mode is "direct on line"). This would allow starting after a plug under heavy load. Selection of the parameter set is done outside this function block, see the code at the end of this post.

// Start command for clockwise operation
// This must be mutually exclusive with counter clockwise operation
      A     #I_Start                    // Start command
      AN    #IO_Fault                   // No fault
      AN    #I_MotorCCW                 // CW rotation desired
      AN    #PQ.MotorCCW                // Not already activating CCW
      =     #PQ.MotorCW                 // --start command for motor forward

// Start command for counter clockwise operation
// This must be mutually exclusive with clockwise operation
      A     #I_Start                    // Start command
      AN    #IO_Fault                   // No fault
      A     #I_MotorCCW                 // CCW rotation desired
      AN    #PQ.MotorCW                 // Not already activating CW
      =     #PQ.MotorCCW                // --start command for motor reverse

// Spare
      CLR
      =     #PQ.Spare1                  // --spare

// Reset faults
      A     #I_FaultReset               // Bit must be cleared outside this FB
      =     #PQ.TripReset               // --trip reset

// Emergency start
      CLR
      =     #PQ.EmerStart               // --emergency start

// Spare
      CLR
      =     #PQ.Spare2                  // --spare

// Slow speed
      A     #I_MotorSlow
      =     #PQ.SlowSpeed               // --slow speed

// Spare
      CLR
      =     #PQ.Spare3                  // --spare

// Output 1
      CLR
      =     #PQ.Output1                 // --output 1

// Output 2
      CLR
      =     #PQ.Output2                 // --output 2

// Determine parameter set to be used
// (The parameter set request can change during run but
// the Sirius soft starter will not actually change
// until ramp down has been completed.)
      CLR                               // Default to set 1, pattern 00
      =     #PQ.ParmSet0                // --parameter set, bit 0
      CLR
      =     #PQ.ParmSet1                // --parameter set, bit 1

      L     #I_ParmSet                  // Check if parameter set 2 desired
      L     2
      ==I
      JCN   _06a
      SET                               // Set to 2, pattern 01
      =     #PQ.ParmSet0
      CLR
      =     #PQ.ParmSet1

_06a: L     #I_ParmSet
      L     3
      ==I
      JCN   _06b
      SET                               // Set to 3, pattern 10
      =     #PQ.ParmSet0
      CLR
      =     #PQ.ParmSet1

// Spare
_06b: CLR
      =     #PQ.Spare4                  // --spare
      =     #PQ.Spare5                  // --spare
      =     #PQ.Spare6                  // --spare

// Disable quick stop
      SET
      =     #PQ.DisQckStop              // --disable quick stop

Network 8: Write the peripheral outputs

Here we actually write the peripheral outputs to the starter.

// Map the instance DB to the 16 peripheral output bits for the soft starter
      TAR1  #T_AR1                      // Store address register 1
      TAR2  #T_AR2                      // Store address register 2
      L     #I_PQ_ADDR                  // Convert PQ address to pointer
      ITD
      SLD   3
      LAR1                              // Store in address register 2
      LAR2  P##PQ                       // Load address register 1 with address from instance DB
      L     DIW [AR2,P#0.0]             // Load accumulator with 16 bits from instance DB
      T     PQW [AR1,P#0.0]             // Copy 16 bits to peripheral output address
      LAR1  #T_AR1                      // Restore address register 1
      LAR2  #T_AR2                      // Restore address register 2

Networks 9-13: Reading/writing technology parameters 2 and 3

Networks 9 through 13 allow for reading and writing of technology parameters #2 and #3. If you do not require reading from or writing to parameter sets, then you may as well move the associated inputs/outputs to the static area in this FB or remove the code and inputs/outputs altogether.

The data set number depends on the parameter set requested:

Technology parameters 2 and 3
Tech parameters 2
Data set#
Tech parameters 3
Data set#
Sirius parameter set#

131 132 1

141 142 2

151 152 3

So when working with tech parameter set #1 we would use data sets #131 and #132, and for parameter set #2 we would use data sets #141 and #142.

Select parameter set

Parameter sets can only be changed while the soft starter is not running, so additional code would be required to test for this. Any attempt to change parameter sets on the fly will result in an error from the Sirius starter. My code that handles this takes a request in the form of a bit from the HMI called "DirectStart" and determines the data set 1 or 2.

// Do not change datasets while running
      A     "Running"                   // Skip all if running
      JC    _22a
// ..here, motor is not yet running, default to dataset 1
      L     1                           // Default to dataset 1
      T     "ParmSetNbr"
      A     "DirectStart"               // Except when direct start requested
      JCN   _22a
// ..here, a direct start is requested so load dataset 2
      L     2                           // ..then load dataset 2
      T     "ParmSetNbr"

// As soon as motor is running, clear the request
// Also prevents request from being made while running
_22a: A     "Running"
      R     "DirectStart"

Contactor / motor starter protector

If your configuration involves a contactor and/or overload, then code for this needs to be added. It is not part of this function block.

Links

Manual SIRIUS 3RW44 Soft Starters, edition 10/2010
Order number 3ZX1012-0RW44-1AC1
http://support.automation.siemens.com/WW...

FAQ: 3RW44 Soft Starters: GSD file for 3RW4900-0KC00 Profibus communications module
http://support.automation.siemens.com/WW...

FAQ: 3RW44 Soft Starters: Functions of the 3RW4900-0KC00 Profibus communications module
http://support.automation.siemens.com/WW...

Comments

Hi, the link to the Block library is not working.

That's the drawback of attempting to provide external links; nothing on the Internet seems to remain the same.

I'll search for the correct link. Thanks for bringing it to my attention.

Looks like the article was pulled. I removed the link.

OK apologies, I just realized that the file attachment was not visible for anonymous users (hence I didn't find out about it until now). I rectified that.

Hi.
Very nice post. But i still have a question. How can i get "configuration map from this soft starter (3rw44). Where can i find it ?
Becouse i need to upload full configuration for example to DB, change some data and download again to device (whithout using SOFT STARTER ES) . It is possible?
Best regards DD.

Networks 9-13 are dealing with reading/writing parameter sets directly from/to the starter, see chapter 8 of the manual. There are several steps during the commissioning phase that can't be done remotely, such as configuring the station address. What particular parts of the configuration are you referring to?

As for the first part of your question, you can find the drive's menu structure in chapter 5, Commissioning, of the manual.

Can I just extract the power output data and place it into a data block ? If so how is this done ?

Just request the data set you're interested in and store it in a db. I would create that db using one of the udt's that I included or you can manually create the db (just make sure the db is sufficiently large to hold the data).

You would probably want to request data set 94, measured values.

It's just easier to simply skip the sfc calls for all the other data sets. (Or execute those conditionally.)

Fantastic informative article
if you are looking to buy or replace a soft starter we supply, install and commission soft starters, ac drives and variable frequency drives Lancashire wide.

Thank you for the compliment but I removed your corporate advertising.

Thank you for the Profibus Sirius 3RW44 function block. I've used with S7-400 and it worked very well. The application was made in CFC language.

Thanks for the feedback, glad you found it useful.

What is the direct start ?

What is the meaning of direct start ?

1) you pull direct contactor ------> softstarter not run
or
2) After voltage ramping you pull contactor--------------> softstarter run

I needed the motor to be able to start directly, without soft starting. So I programmed two parameter sets on the starter: (1) for regular operation with sift starting and (2) for direct starting.

In set (2) I programmed the starter to perform a direct start.

For most applications this is probably not required.

Via the PLC I the send the desired parameter set number: 1 for regular operation and 2 for the direct start option.

You have to be careful with contactors by the way, as the starter needs to see a load or it can fault.

Thanks for the info, block works smoothly. (Y)