help for s7-300

tulip

Member
Join Date
Oct 2005
Location
ist
Posts
236
I want to write a program block that İf I input a value on screen ( between 1%-100% )plc output must like this.That is;input value is 1% than plc output must be 1% on-99% off,İf input value is 7% than plc output must be 7% on-93% off etc.( This is seems PWM ,but I dont know.)I think need two parameters for this block.First; pulse width (be % ),second is period.Is there any experience for this? Thanks in advance.
 
Source code for FB as follows:

Code:
FUNCTION_BLOCK FB 1
TITLE =
VERSION : 0.1

VAR_INPUT
  rPerCentageOnTime : REAL ; 
  tPeriod : TIME ; 
END_VAR
VAR_OUTPUT
  bPWMQ : BOOL ; 
END_VAR
VAR
  sfb4Timer : sfb4; 
  bQ : BOOL ; 
END_VAR
BEGIN
NETWORK
TITLE =Period generator
      AN    #bQ; 
      =     L      0.0; 
      BLD   103; 
      CALL #sfb4Timer (
           IN                       := L      0.0,
           PT                       := #tPeriod,
           Q                        := #bQ);
      NOP   0; 
NETWORK
TITLE =
      L     #tPeriod; 
      DTR   ; 
      L     #rPerCentageOnTime; 
      *R    ; 
      L     1.000000e+002; 
      /R    ; 
      L     #sfb4Timer.ET; 
      DTR   ; 
      TAK   ; 
      <=R   ; 
      =     #bPWMQ; 
END_FUNCTION_BLOCK
 
or you could use FC106 (Unscale) with the High and Low limits set to 100 and 0. The input value would need to be Floating Point though.
 
I think that what you want is a standard Siemens block FB43 PulsGen. You can find it in the standard library under PID control Blocks.

The code that LD provided will doubtless work but the Siemens block is a bit more clever. If you have multiple instances of FB43 it can automatically synchronise the time periods with a PID controller to even out power demand from whatever is being controlled. I've used this on multiple heating controllers so that they don't all switch on at the same time causing a spike in current demand.

Nick
 

Similar Topics

Hello, I have a die punch machine with servo motor for material feeding. I'm using Kinetix 5300 to control the feeding system. Every recipe have...
Replies
0
Views
552
Hi to all, Our company does not usually use Siemens PLCs, but have a press with one in it. We are trying to change the IP address in our Simatic...
Replies
2
Views
1,090
Currently tinkering with a home project for a wood router lift machine using some second hand parts from a redundant timber mill. The servo is a...
Replies
3
Views
2,462
Hi, Expect: we have SIEMENS PLC S7-300: CPU 313C (6ES7313-5BG04-0AB0). we don't have any software to upload its program. we just want to upload...
Replies
23
Views
7,914
I have a siemens 317-2 and an old GOT1000 (GT1675M - V) I am trying to get the darn things communication and having no luck. I have followed the...
Replies
12
Views
2,265
Back
Top Bottom