当前位置:网站首页>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 | BOOL | I, Q, M, D, L | Signal status “1”, Activate the block . |
| ENO | Output | BOOL | I, Q, M, D, L | When the block execution is error free , Output signal status “1”. |
| IN | Input | INT | I, Q, M, D, L, constant | Integer input value to be converted |
| HI_LIM | Input | REAL | I, Q, M, D, L, constant | High limit of physical units |
| LO_LIM | Input | REAL | I, Q, M, D, L, constant | Lower limit of physical units |
| BIPOLAR | Input | BOOL | I, 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 | WORD | Q, 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℃.

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 | BOOL | I, Q, M, D, L | Signal status “1”, Activate the block . |
| ENO | Output | BOOL | I, Q, M, D, L | When the block execution is error free , Output signal status “1”. |
| IN | Input | INT | I, Q, M, D, L, constant | Given value of quantities |
| HI_LIM | Input | REAL | I, Q, M, D, L, constant | High limit of physical units |
| LO_LIM | Input | REAL | I, Q, M, D, L, constant | Lower limit of physical units |
| BIPOLAR | Input | BOOL | I, 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 | WORD | Q, 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%.

边栏推荐
猜你喜欢
随机推荐
How to generate get/set methods in idea
final和static
keil编译运行错误,缺少error:#5:#includecore_cm3.h_过路老熊_新浪博客
The package name of the manifest file in the library project and the app project are not the same
JS中的原型链面试题--Foo和 getName
权限设计=功能权限+数据权限
Blob
Let's talk about string today
格式化编号,不够位数的补0,例如1:0001,25:0025
idea Kotlin版本升级
7.常用指令(下)v-on,v-bind,v-model的常见操作
常用的几款富文本编辑器
后序线索二叉树
SSM整合学习笔记(主要是思路)
Static keyword explanation
搜索旋转数组II[抽象二分练习]
The role of iomanip header file in actual combat
Raspberry pie sends hotspot for remote login
社交网络可视化第三方库igraph的安装
中序线索二叉树









