西门子 S7-300 PLC模拟量转换.pdf
S7-300/400TipAnalogScalingTipNo.1
SIMATIC
S7-300/400Tips
GroupTopic
1ScalingAnalogValues
Overview
AnalogInputsandOutputsinanS7PLCarerepresentedinthePLCasa16-bitinteger.Over
thenominalspanoftheanaloginputoroutput,thevalueofthisintegerwillrangebetween-
27648and+27648.However,itiseasiertousetheanalogvaluesiftheyarescaledtothe
sameunitsandrangesastheprocessbeingcontrolled.Thisapplicationstipdescribes
methodsforscalinganalogvaluestoandfromengineeringunits.
ProgramDescription
Theprogramforscalinganalogvaluesconsistsof2function(FC)blocks.Theseblocksare
optimizedforunipolar(0..27648)analogvalues,butwillalsoworkwithbipolaranalogs.Both
blocksareshownintwodifferentlanguages:LADandSTL.
FC100convertsanintegerinanominal0..27648rangetoafloatingpointnumberinthe
specifiedengineeringunits.
FC101convertsafloatingpointnumberinthespecifiedengineeringunitstoanintegerin
0..27648range.
Copyright1996bySIEMENSpage1/7Scaling.doc
Status:11/96Version1.0
SIMATICS7-300/400customershavefreeuseoftheapplicationtips.ThesetipsareonlyageneralapproachtousingtheS7-300/400withvarious
applications.Yourspecificapplicationmaybedifferent.ItisyourresponsibilitytousetheSIMATICS7-300/400properlyinyourapplications.
S7-300/400TipAnalogScalingTip