Generate pulses with TP timer

javarin

Member
Join Date
May 2016
Location
Montevideo
Posts
3
Hi all,
I`m programming a Simatic S7 1200 1214C DC/DC/DC
I need to generate a pulse to operate a stepper motor in low frecuency using a normal output (Q) at 30Kz. (not using PTO). The reason is that i need to control so many motors)

What i am trying to do is generate pulses using a TP timer, but this timer activates only one time in a clycle.
Is there a way to make this timer restart automatically after PT arrives ?

Tank you very much !
Regards.
 
Welcome to the forum!

The first thing I'm going to ask you to clarify is...
javarin said:
using a normal output (Q) at 30Kz
...is your required frequency 30Hz, or 30kHz? I don't know many specs on the S7-1200 off the top of my head, but I'm going to go out on a limb and say I'm fairly sure you won't get 30kHz out of a digital output :)
 
Thank you for your welcome and for your answer !
This model of CPU really has 4 fast outputs for PTO at 100Kz and 2 more at 30Kz :
(sorry is in spanish)
Salidas de impulsos 2 Se han configurado un máximo de 4 para usar cualquier salida integrada o de
SB
• 100 kHz (de Qa.0 a Qa.3)
• 30 kHz (de Qa.4 a Qa.5)


But, as you ask, is not my required frequency, I don`t need that much.
I am more interesting in knowing how to generate low frequency pulses in the easiest way without using things like "Internal PTO (Pulse Train Output)" or "Motion Control".

Again, thank you very much.

(Sorry, I mean "KHz" when I wrote "Kz")
 
Last edited:
Huh, well there you go!

So you are after 30Hz (30 hertz), not 30kHz (30,000 hertz)? Your units that you specify are not correct - clearly English is not your first language, but never mind!

I haven't done a lot with Siemens PLC's, so I can't give you specific advice, but I can perhaps point you in the right direction generally.

Is the frequency that you wish to output always going to be 30Hz, or will it vary anywhere from 0-30Hz? If it's always the same, I would look at using a scheduled task. I'm not sure what they're called in Siemens world, but if you need to turn an output on, the off 30 times per second, you need a scheduled task that runs every 16.67ms (which equates to 60 times per second). The first time it runs, it turns on your output; the second time it runs, it turns off your output. And so on. It's just a basic flip flop at that point. Of course, that only works if your frequency will never vary. I'm also not sure what options you have for scheduled tasks with an S7-1200, but if it were me, that's where I would start looking.

Does that help at all?
 
You could maybe use OB30 (insert new block, organization block, cyclic interrupt) and set it to twice 30Hz (so 17ms roughly) and turn the output on one cycle and off the next. Your frequency will be a bit off though because of this, 29.4Hz

But i don't think it's possible without a drive in-between to run the stepper motors.
 
Last edited:
look at oscat.de for a nice library with functions also for S7 (yes it is english).
TP is not good for this at is resetting all the time and needs time to do that.
look for blink.
a better option is to use the internal timer and see if it is 33 (maybe still not precise enough.
If you need many steppers >5 i would like to introduce arduino stepper controller. cheap and easy to program and very fast.
 
As far as I know, the outputs can only be operated in high speed mode (30/100khz) with the built in functions (pwm/pto).

The best way I know of to create fast pulses from the 1200 is to use a cyclic OB (like ob30), as someone else had mentioned. However, I doubt this could get you over 500hz. I doubt the minimum cyclic scan is faster than 1ms, and you would need two for the whole pulse.
 
I appreciate very much all the help received , I will try to apply your advices. thank you very much to all.
I will post my experiences when applying .
Regards!
 

Similar Topics

I need a PLC that can generate 2500 square waves per second. We have a Compact Logix with a 1769-HSC card. I can generate 2500 pulses per second...
Replies
23
Views
7,185
Hi to everybody here! I'm a newbie in the Allen Bradley world, I've just come from Siemens S7-300 and though I'm getting well with RSLogix 5000 I...
Replies
14
Views
9,722
Hello Friends, I am looking for a way to take my PID Output( it is the result of my PI Algorithm in Real format) and generate a PWM Signal in...
Replies
16
Views
2,491
Does anyone know a way to dynamically generate a 2D barcode on a PanelView screen? An Activex Control maybe? If such a method is out there, it...
Replies
14
Views
2,977
Hi, I am trying to generate source file of OB1 including all dependent blocks. But i am getting a message which says-->>one or more blocks...
Replies
3
Views
1,251
Back
Top Bottom