View Full Version : Pulse width modulation output on S7-313C
dfdgdsd
April 17th, 2007, 06:00 AM
Hi, is anyone familiar with the pulse width modulation output on the SIMATIC s7-300 series? I've set up the count module in HW Config, and want to use it to output a pulse with frequency between 0 and 2 000 Hz, but I'm not sure how to set up the SFB 49 Pulse block. A picture of the block is shown below. How do I set the block up to give a frequency between 0 and 2 000 Hz?
http://img135.imageshack.us/img135/4689/53016550ue4.png
Address 300 (hex) means address 752 as set in HW Config.
I'm using a CPU313C.
dchartier
April 17th, 2007, 08:13 AM
Hello dfdgdsd;
I have not used the FB"Pulse" myself, but the settings look standard (for Siemens, of course).
Look at this extract from the "CPU 31xC Technological functions" (same extract is available in the "Standard and System functions " manual):
http://www.plctalk.net/qanda/uploads/FB49_outputval.jpg
The maximum pulse value for a CPU313C digital channel is 2,5 kHz, so 2 kHz is 80% of the max. value. The parameter OUTP_VAL accepts data in 2 formats, eithe 0.0 to 1.0, or standard Siemens analog values, 0 to 27648. If you want your output to be 2 kHz, write a value of 0.8 or 22118 to OUTP_VAL (I have a feeling that the integer value of 22118 will pass better, since OUTP_VAL is registered as an INT).
Of copurse, you can setup a tag to modify the output frequency dynamically, simply write the value required to that tag.
Hope this helps,
Daniel Chartier
dfdgdsd
April 18th, 2007, 02:59 AM
Hi, thanks for the reply. I'm aware of the input value range required, but the problem is what values to use on the other inputs:
LADDR - W#16#300 (address 768, as configured in HW Config)
SW_EN - TRUE (?)
MAN_DO - TRUE (?)
SET_DO - ?
OUTP_VAL - INT between 0 and 27 648
JOB_REQ - ?
JOB_IQ - ?
JOB_VAL - ?
Any suggestions?
Here are extracts from help on the function block:
http://img243.imageshack.us/img243/3015/83485066dm3.png
http://img151.imageshack.us/img151/7743/92855484zx5.png
dchartier
April 19th, 2007, 06:58 AM
Hello dfdgdsd;
The followi ng link will take you to a Siemens FAQ on SFB49, with explanations and a link to an implementation example of the function block (look at the third search result).
http://support.automation.siemens.com/WW/llisapi.dll?query=SFB49&func=cslib.cssearch&content=skm%2Fmain.asp&lang=en&siteid=cseus&objaction=cssearch&searchinprim=0&nodeid0=4000024
Hope this helps,
Daniel Chartier
Note: anytime you have such issues with Siemens, a search on their support website will generally help out. The link I suggested was found on a search for "SFB49".
Hope you will find this useful,
D.C.
.