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

边栏推荐
- 格式化编号,不够位数的补0,例如1:0001,25:0025
- The InputStream stream has been closed, but the file or folder cannot be deleted, indicating that it is occupied by the JVM
- 对伪类的理解
- Alipay payment interface sandbox environment test and integration into an SSM e-commerce project
- 我的博客今天2岁167天了,我领取了先锋博主徽章_过路老熊_新浪博客
- 剑指 Offer 48. 最长不含重复字符的子字符串
- Binary, hexadecimal, big end and small end
- Mutual conversion of float type data and datetime type data in sqlserver2008
- 谈一谈生产环境中swoole协程创建数量控制机制
- Wireshark对IMAP抓包分析
猜你喜欢

Leetcode-1528- rearrange string - hash table - string

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

兆欧表电压档位选择_过路老熊_新浪博客

Architecture part -- the use of UMI framework and DVA

ValueError: color kwarg must have one color per data set. 9 data sets and 1 colors were provided解决

猕猴桃酵素的功效_过路老熊_新浪博客

今天说说String相关知识点

实例:用C#.NET手把手教你做微信公众号开发(21)--使用微信支付线上收款:H5方式

在win10下使用visual studio2015链接mysql数据库

MySQL version upgrade + data migration
随机推荐
懒人教你用猕猴桃一月饱减16斤_过路老熊_新浪博客
Compiling protobuf protocol files using makefile in PHP
请问可以不部署服务端实现图片上传吗?
中序线索二叉树
idea 查看单元测试覆盖率
Linking MySQL database with visual studio2015 under win10
JS中的原型链面试题--Foo和 getName
平衡二叉树AVL
Record a simple question with ideas at the moment of brushing leetcode - Sword finger offer 09 Implementing queues with two stacks
搜索旋转数组II[抽象二分练习]
C# IO Stream 流(一)基础概念_基本定义
Gradle的环境安装与配置
proxy
C ++ 引用与指针总结
Line height for small use
Static keyword explanation
keil编译运行错误,缺少error:#5:#includecore_cm3.h_过路老熊_新浪博客
Virtual and pure virtual destructors and their implementation in c++
4个要点,助力产品管好项目
Megacli常用命令整理