Siemens S7-200 Micro PLC control


Thread Starter

Dave Cooke

Dear Listees,

Does anyone have any experience of programming the little S7-200 micro PLC?

I just need to get the little critter to issue a 4 second pulse periodically, with the period being determined by the state of two of the inputs (binary selection), the whole business being inhibited by the state of a third input.

Sounds easy enough (I hope!)


By way of clarification, if I might paraphrase:

Two inputs (one of 4) select the cycle time (or alternatively, depending on the program, the "off" time) of this device.

4 seconds of this cycle the output is on, the remainder off.

A third input enables/disables the device.

If the third input disables the output pulse before 4 seconds "on" has elapsed, does it complete its 4 second pulse or drop immediately?

Are the cycle rate selection inputs likely to change while the device is enabled?

Is there any expected synchronization between the enable and the start of the first pulse?

Michael Griffin

Yes this should be rather easy with an S7-200. You would first need to determine the timing resolution you require. The S7-200 timers have
different time bases depending upon which ones you use. That is, unlike an S5 which lets you specify a time base for each timer, the time base of the S7-200 is determined by which timer you use.
Next, the repeat period timer could have its preset as a variable in a 'V' or 'M' word. The binary inputs could control four MOVE instructions which move the fixed presents into this 'V' or 'M' word. Some other suitable
method could be used depending upon what the presets are.
The rest should be simple ladder logic. Immediate I/O can be used if required.
Something to look out for though is if you are having one of the timers re-trigger itself (i.e. the timer enabled by its own normally closed contact), then read the section in the manual on timers very carefully. Certain timers require special treatment for this situation.

The S7-200 also has a PWM output function. I am not sure from your description if this would suit your application better. To quote from some S7-200 literature:
"The PWM function provides a fixed cycle time with a variable duty cycle output. The cycle time and the pulse width can be specified in either microsecond or millisecond increments. The cycle time has a range either from 250 to 65,535 microseconds or from 2 to 65,535 milliseconds. The pulse width timer has a range either from 0 to 65,535 microseconds or from 0 to
65,535 milliseconds. When the pulse width is equal to the cycle time, the duty is 100 percent and the output is turned on continuously. When the pulse width is zero, the duty cycle is 0 percent and the output is turned off. If a cycle time of less than two time units is specified, the cycle time defaults to two time units."

This method should be more precise than using ordinary timers, but it requires you to use specific outputs. It may or may not be suitable
depending upon exactly what it is you want to do. I don't know if it is available on all versions of the S7-200. Your manual should give you more

As a final note, you mentioned the "S7-200", but this is in fact an entire product line with a number of versions. Siemens is already into its second generation product with this series, and the new S7-22x have a number
of hardware and firmware improvements over the older S7-21x series which they replace.
I am currently working on a project using an S7-224 in an automated machine. It controls an RF system, conveyor with pallet stops, a pick and
place, an indexing mechanism, and a welder. An OP-7 provides an operator interface. I am finding it very easy to use, so I think your application
should be no problem for you. If there is anything else you need, please ask again with more details.

Michael Griffin
London, Ont. Canada
[email protected]

Rodrigo Pinto

I made some programs for the S7-214 and its very simple, you have to use the software S7Microwin for the programing (Ladder Logic, and AWL), and the use of it is very easy, also the manual of the CPU teach you about the Software Interface,
and there's one CD of program resources called S7-200 Tip's and Tricks, who can give you some ideas. If you know PLC programing of other brand you will not have problems! :).


Doug McQueen ESI Electric Supply Inc.

several ways to do this- the micro dos or micro win, which ever you have. You could use a 100msec timer and set for 4 secs, or a smo(special mem bit) sec or msec. pulse a counter. which ever the case set a bit at the end of the time that will block the timer or counter that just timed or counted out. of course all based on your logic. when all 3 are true set a bit m or q then at the end of the time peroid reset this or no set bit situation, as long as the 3 are true then time out 4sec in this case all 3 would need to remain true long enough for the the timer/counter to run its 4 second course. mannnnnnny ways to do this.
have a blast regards McQueen