当前位置:网站首页>Realize the conversion between analog quantity value and engineering quantity value in STEP7_ Old bear passing by_ Sina blog

Realize the conversion between analog quantity value and engineering quantity value in STEP7_ Old bear passing by_ Sina blog

2022-06-25 23:53:00 wenroudelang8888

      stay step7 Realize the conversion between analog quantity value and engineering quantity value

Parameter interpretation :
1. Users can use the FC105 Convert the integer value of analog quantity input template into engineering quantity value . about FC105 The input of / The output parameters are explained as follows :

Parameters type data type Storage area describe
EN Input BOOLI, Q, M, D, L

Signal status “1”, Activate the block .

ENO Output BOOLI, Q, M, D, L

When the block execution is error free , Output signal status “1”.

IN Input INTI, Q, M, D, L, constant Integer input value to be converted
HI_LIM Input REALI, Q, M, D, L, constant High limit of physical units
LO_LIM Input REALI, Q, M, D, L, constant Lower limit of physical units
BIPOLAR Input BOOLI, Q, M, D, L, constant Signal status “1” Indicates bipolar input value .
Signal status “0” Indicates a unipolar input value
OUT Output REAL  I, Q, M, D, L Quantity results after conversion
RET_VAL Output WORDQ, M, D, L When there is no error in the operation , Output value W#16#0000.

FC105 Using parameter

Parameter transformation relation :
OUT = [((FLOAT (IN) – K1)/ (K2–K1)) * (HI_LIM–LO_LIM)] + LO_LIM

Be careful
If the user uses the input / The output type is bipolar ( Such as ±10V,±5V etc. ),BIPOLAR The parameter should be given as TRUE, here K1=-27648,K2=27648, otherwise K1=0,K2=27648.

for example : Assume that the sensor connected to the analog quantity module is 0-20mA type , The measuring object is temperature , When the temperature is 0℃ Current at 0 mA, When the temperature is 100℃ Current at 20 mA. At this time, the corresponding value obtained by the analog input module 0 mA Corresponding to 0,20 mA Corresponding to 27648. If the current value is 10 mA, Then the input value obtained by the analog quantity module is 13824, If the user wishes to be in CPU To get a final actual temperature value , You can call FC105, Assign the value of the analog input module to the parameter IN, The upper limit of quantities is given as 100.0, The lower limit value is given as 0.0, That is, output parameters OUT Get the actual temperature value 50℃.

1.jpg

2. Users can use the FC106 Convert the engineering quantity value to the value required by the analog quantity output template . about FC106 The input of / The output parameters are explained as follows :

Parameters type data type Storage area describe
EN Input BOOLI, Q, M, D, L

Signal status “1”, Activate the block .

ENO Output BOOLI, Q, M, D, L   

When the block execution is error free , Output signal status “1”.

IN Input INTI, Q, M, D, L, constant Given value of quantities
HI_LIM Input REALI, Q, M, D, L, constant High limit of physical units
LO_LIM Input REALI, Q, M, D, L, constant Lower limit of physical units
BIPOLAR Input BOOLI, Q, M, D, L, constant Signal status “1” Indicates bipolar input value .
Signal status “0” Indicates a unipolar input value
OUT Output REAL  I, Q, M, D, L Quantity results after conversion
RET_VAL Output WORDQ, M, D, L When there is no error in the operation , Output value W#16#0000.


FC1056 Using parameter


Parameter transformation relation :
OUT = [ ((IN–LO_LIM)/(HI_LIM–LO_LIM)) * (K2–K1) ] + K1
Be careful : If the user uses the input / The output type is bipolar ( Such as ±10V etc. ),BIPOLAR The parameter should be given as TRUE, here K1=-27648,K2=27648, otherwise K1=0,K2=27648.


for example : Assume that the output of the analog output module is set to 0-20mA type , The actuator to which it is connected is a regulating valve . When the current is 0 mA The valve opening is 0%, When the current is 20 mA The valve opening is 100%. If the user wants the valve opening to be 50%, You can call FC106, Assign the opening given value to the parameter IN, The upper limit of quantities is given as 100.0, The lower limit value is given as 0.0, Assign the address of the analog output module to the parameter OUT, here OUT Values for 13824, The output current value of the analog output module can be 10 mA, That is, the valve opening is 50%.

2.JPG

 

原网站

版权声明
本文为[wenroudelang8888]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206252107003145.html