在wincc中建立一个i/o域,要显示13位数字,第一个变量tag-1从plc取来5位(69312),第二个变量tag-2从plc取来4位(3456),第三个变量tag-3从plc取来4位(7890),现在想在i/o域显示(6931234567890)如何实现,
解答:文章源自公式库网-https://www.gongshiku.com/html/201908/wincczhong-bianliangzifuchuanruhehebianliangzifuchuanlianjie-yijiejuewenti.html
方法一:用VBS脚本,在I/O域的输出属性里写脚本文章源自公式库网-https://www.gongshiku.com/html/201908/wincczhong-bianliangzifuchuanruhehebianliangzifuchuanlianjie-yijiejuewenti.html
Item.OutputValue = HMIRuntime.Tags("Tag1").Read & HMIRuntime.Tags("Tag2").Read & HMIRuntime.Tags("Tag3").Read文章源自公式库网-https://www.gongshiku.com/html/201908/wincczhong-bianliangzifuchuanruhehebianliangzifuchuanlianjie-yijiejuewenti.html
方法二:文章源自公式库网-https://www.gongshiku.com/html/201908/wincczhong-bianliangzifuchuanruhehebianliangzifuchuanlianjie-yijiejuewenti.html
如果只是显示,而不是用于最终的运算。最简单的方法是把三个标签对应的显示值摆放在一起,背景透明,距离适当,给人一种是一个数值的感觉就可以了。
否则要使用循环移位指令。文章源自公式库网-https://www.gongshiku.com/html/201908/wincczhong-bianliangzifuchuanruhehebianliangzifuchuanlianjie-yijiejuewenti.html
文章源自公式库网-https://www.gongshiku.com/html/201908/wincczhong-bianliangzifuchuanruhehebianliangzifuchuanlianjie-yijiejuewenti.html