当前位置:网站首页>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%.

边栏推荐
猜你喜欢

Blob

后序线索二叉树

Use Baidu map API to set an overlay (infowindow) in the map to customize the window content

Wireshark对IMAP抓包分析

YUV444、YUV422、YUV420、YUV420P、YUV420SP、YV12、YU12、NV12、NV21

debezium

Linking MySQL database with visual studio2015 under win10

平衡二叉树AVL

Leetcode-1528- rearrange string - hash table - string

手工制作 pl-2303hx 的USB转TTL电平串口的电路_过路老熊_新浪博客
随机推荐
YUV444、YUV422、YUV420、YUV420P、YUV420SP、YV12、YU12、NV12、NV21
STEP7主站与远程I/O组网_过路老熊_新浪博客
Stream in PHP socket communication_ Understanding of select method
Spark日志分析
c_ uart_ interface_ Example and offboard modes
The role of iomanip header file in actual combat
ValueError: color kwarg must have one color per data set. 9 data sets and 1 colors were provided解决
sqlServer2008中float类型数据与datetime类型数据互转
Gradle的环境安装与配置
Static keyword explanation
How to generate get/set methods in idea
IDEA中如何生成get/set方法
Linking MySQL database with visual studio2015 under win10
在win10下使用visual studio2015链接mysql数据库
Record a simple question with ideas at the moment of brushing leetcode - Sword finger offer 09 Implementing queues with two stacks
php中使用google protobuf协议环境配置
7.常用指令(下)v-on,v-bind,v-model的常见操作
中序线索二叉树
Can I upload pictures without deploying the server?
Apache doris1.0 cluster setup, load balancing and parameter tuning