Technical Forum

SIMATIC S7-1200

S7-1200 und PWM

Thread Starter: rooney839   Started: 9/8/2011 7:16 PM   Replies: 15

« Previous thread Next thread »
12» Page 1 of 2 (16 items)
  9/8/2011, 7:16 PM
Joined 9/8/2011
Last visit: 3/11/2014
Posts: 11
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Pegaia schrieb:

Hi,

Here there is some tips about the use of PWM in S7-1200.

To configure a PWM do you need:
1 – Configure the properties of the PWM in the CPU properties (Device Configuration). Important properties:

1 a – Time Base: that is the unit scale used in the property 1c.

1 b – Pulse width format: define the pulse width scale in the user program. For example: if you choice 100, the user set point should stay between 0-100. if you choice 1000, the user set point should stay between 0-1000. And so on. (if you use S7-analogic format, the set point should stay between 0-27648).

1c – Cycle time: corresponds to the ON time + OFF time of each cycle.

1d – Initial Pulse width: initial value of the setpoint to the PWM (when there is a start of the CPU).

2 – You need to call a block (CTRL_PWM) in OB1, give the PWM name and an enable signal.


Behavior:

While the PWM is not enabled by the CTRL_PWM, the digital output works like a normal digital output.

Once the PWM is enabled, the output is dived by the PWM. Note however that the monitoring of the digital output, follow the digital logic.


Sample program:

The follow sample program is very simple. There is just the device configuration settings and a CTRL_PWM call. In the watch table, you can modify the digital output, and enable / disable the PWM to see how they works.
 

I
have done everything as described. I even have your program adapted to my hardware. But unfortunately I get an error message in status 80D0. can you help me?
Thanks

Attachment: PWM.zip  (238 Downloads)



=== Bearbeitet von Blue Moderator @ 08.09.2011 21:30 [GMT ] ===


=== Bearbeitet von Blue Moderator @ 08.09.2011 21:28 [GMT ] ===
splitted from https://www.automation.siemens.com/WW/forum/guests/PostShow.aspx?PageIndex=1&PostID=255396&Language=en&onlyInternet=False#top and renamed


Top
  4/25/2012, 9:48 PM
Joined 3/30/2011
Last visit: 10/2/2012
Posts: 10
Rating:
Rated: Excellent [4.5 out of 5 / rated 2 time(s)]. (2) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 

Hi rooney,

Can you verify that you are referencing the correct PWM at the PWM input of the CTRL_PWM function?  This should be the hardware id of the pulse generator you are using. 

Top
  10/18/2012, 6:36 PM
Joined 8/14/2012
Last visit: 10/31/2012
Posts: 1
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
I am having the same issue as Rooney, and I have verified that I am using the correct PWM (PWM1) and that I am supplying that as the input to the CTRL_PWM function. I see no output at Q0.0 and I get the same 80D0 code on the STATUS output. 

This error code does not appear in the system manual except in the context of high-speed counters, where it is the error code for the counter not being enabled. Just for the sake of trying it, I enabled HSC1 and tried again, with the same result.

Any guesses at what this means or how I can address the problem?
Top
  10/18/2012, 7:47 PM
Joined 7/7/2010
Last visit: 4/23/2014
Posts: 2651
Rating:
Rated: Outstanding [3.93 out of 5 / rated 289 time(s)]. (289) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
bryophyte wrote:
I am having the same issue as Rooney, and I have verified that I am using the correct PWM (PWM1) and that I am supplying that as the input to the CTRL_PWM function. I see no output at Q0.0 and I get the same 80D0 code on the STATUS output. 

This error code does not appear in the system manual except in the context of high-speed counters, where it is the error code for the counter not being enabled. Just for the sake of trying it, I enabled HSC1 and tried again, with the same result.

Any guesses at what this means or how I can address the problem?

Maybe a screenshot of the ctrl_PWM block would help.  Did you type or select from the drop-down list the pwm hardware id?

Helpful? Rate it.
Solved? Post it.
Top
  1/22/2013, 12:32 AM
Joined 12/30/2012
Last visit: 12/30/2013
Posts: 15
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
No one knows what the error 80D0 means??


Attachment: screen.jpg  (80 Downloads)

S7-1200 1214 CPU DC/DC/REL

Top
  1/22/2013, 10:41 AM
Joined 7/24/2008
Last visit: 4/23/2014
Posts: 2404
Rating:
Rated: Excellent [4.34 out of 5 / rated 410 time(s)]. (410) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi,

what is your sw version?
what is your CPU firmware version?
Do you have alread tried to:
1 - Reset the CPU to factory settings
2 - Compile HW; donwload HW
3 - Compile software (all), download software (all)?

Denilson Pegaia
Siemens Industry Sector
- Technical Support & Hotline -
Hotline – Atenção ao Cliente / Customer Care
Tel.: +55 11 3833-4040
E-Mail: atencao.cliente.ac.br@siemens.com
Top
  1/22/2013, 3:22 PM
Joined 7/7/2010
Last visit: 4/23/2014
Posts: 2651
Rating:
Rated: Outstanding [3.93 out of 5 / rated 289 time(s)]. (289) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Martil wrote:
No one knows what the error 80D0 means??


The relay output PLCs do not allow PWM control of the outputs. Only DC outputs allow PWM control.

Helpful? Rate it.
Solved? Post it.
Top
  4/2/2013, 8:34 PM
Joined 2/16/2011
Last visit: 4/17/2014
Posts: 223
Rating:
Rated: Excellent [4.13 out of 5 / rated 16 time(s)]. (16) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi,


But I've got a 80D0 error too.

I'm using 1214C dc/dc/dc with firmware 3.0
TIA Portal V11 SP2 update 4

Does it have a solution? There are posts since 8/01/12 and no one solution.

All the best.

Gabriel de Oliveira
It Works? Rate It.
Top
  4/2/2013, 8:44 PM
Joined 7/7/2010
Last visit: 4/23/2014
Posts: 2651
Rating:
Rated: Outstanding [3.93 out of 5 / rated 289 time(s)]. (289) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Gabriel de Oliveira wrote:
Hi,


But I've got a 80D0 error too.

I'm using 1214C dc/dc/dc with firmware 3.0
TIA Portal V11 SP2 update 4

Does it have a solution? There are posts since 8/01/12 and no one solution.

All the best.

There is a FW 3.0.2 available for the newer PLCs.  Perhaps that new FW will correct the problem?

Is the control variable datatype word, int, uint, or something else?

Helpful? Rate it.
Solved? Post it.
Top
  4/2/2013, 8:55 PM
Joined 2/16/2011
Last visit: 4/17/2014
Posts: 223
Rating:
Rated: Excellent [4.13 out of 5 / rated 16 time(s)]. (16) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Huggy

I'm using Word type.
Time base Microsconds
Pulse duration format Hundredths
cycle time 100us
initial pulse duration 10 hundredths

All the best

Gabriel de Oliveira
It Works? Rate It.
Top
12» Page 1 of 2 (16 items)
Actions