返回列表 发布新帖

TC系列HMI如何将变频器累计运行时间清零?

167 0
发表于 2024-7-10 18:16:53 | 查看全部 阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
<p><br/></p><p><br/></p><p><img src="/upload/article/20221229/1672290683851177.png" title="1672290683851177.png" alt="1672290675979765.png"/></p><p>1、由于变频器内部累计运行时间关系到变频器是否在质保内,因此变频器内部累计运行时间不可清零,但是客户想要累计运行时间可进行清零操作,便于设备厂家对设备进行管理,故HMI所显示累计时间需要在HMI内部通过宏程序处理。如上图所示,界面左上角按钮为清零按钮,指示灯为清零动作指示。</p><p><br/></p><p><br/></p><p>2、宏程序:累计时间清零宏程序见下图,变量“leijijishi”为变频器累计运行时间地址,变量“xianshizhi”为HMI最终显示的累计时间,变量“qingling”为清零按钮,变量“LED”为清零动作指示。<br/></p><p><img src="/upload/article/20221229/1672290662262291.png" style="" title="1672290662262291.png"/></p><p><br/></p><p><br/></p><p>3、宏程序调用:如下图所示,选择公共窗口-窗口属性-定时器,进行宏程序调用,触发条件选择窗口打开时触发,定时器功能勾选执行宏指令,并选择“jishuqingling”宏程序。</p><p><img src="/upload/article/20221229/1672291588255762.png" title="1672291588255762.png" alt="通用宏程序调用.png"/><img src="/upload/article/20221229/1672291608838080.png" title="1672291608838080.png" alt="通用宏程序调用1.png"/></p><p><br/></p><p><br/></p><p>4、清零按钮:如下图所示,清零按钮分别在按下和弹起时执行动作,同时为了防止非厂家管理人员误操作,并对清零按钮进行延时5S的设置。</p><p><img src="/upload/article/20221229/1672291882895934.png" title="1672291882895934.png" alt="清零按钮.png"/><img src="/upload/article/20221229/1672292027800600.png" title="1672292027800600.png" alt="清零按钮延时.png"/></p><p><br/></p><p><br/></p><p>5、指示灯:如下图,进行清零动作指示,考虑到界面美观,没有清零动作时,指示灯隐藏。</p><p><img src="/upload/article/20221229/1672292105720739.png" title="1672292105720739.png" alt="指示灯.png"/><img src="/upload/article/20221229/1672292114429609.png" title="1672292114429609.png" alt="指示灯隐藏.png"/></p><p><br/></p><p><br/></p><p>6、累计时间:如下图,累计时间地址更改为RW20006。</p><p><img src="/upload/article/20221229/1672292281934047.png" title="1672292281934047.png" alt="累计运行时间.png"/></p><p><br/></p><p><br/></p><p>7、程序代码:</p><p><span style="color: #008000; ">#include &lt;macro.h&gt;</span><br/><br/><span style="color: #0000ff; font-weight: bold; ">int</span> <span style="color: #191970; font-weight: bold; ">MacroMain</span><span style="color: #006400; ">()</span><br/><span style="color: #006400; ">{</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000; ">// Here to add macro code.</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000; ">unsigned</span> <span style="color: #ff0000; ">short</span> A <span style="color: #006400; ">=</span> <span style="color: #191970; font-weight: bold; ">GetWord</span><span style="color: #006400; ">(</span>@leijijishi@<span style="color: #006400; ">,</span><span style="color: #00008b; ">0</span><span style="color: #006400; ">);</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000; ">unsigned</span> <span style="color: #ff0000; ">short</span> B <span style="color: #006400; ">=</span> <span style="color: #191970; font-weight: bold; ">GetWord</span><span style="color: #006400; ">(</span>@huancunzhi@<span style="color: #006400; ">,</span><span style="color: #00008b; ">0</span><span style="color: #006400; ">);</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000; ">unsigned</span> <span style="color: #ff0000; ">short</span> C <span style="color: #006400; ">;</span><span style="color: #008000; ">///= GetWord(@baochizhi@,0);</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000; ">//unsigned short D = GetWord(@xianshizhi@,0);</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000; ">unsigned</span> <span style="color: #ff0000; ">short</span> D<span style="color: #006400; ">;</span><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000; ">bool</span> QL <span style="color: #006400; ">=</span> <span style="color: #191970; font-weight: bold; ">GetBit</span><span style="color: #006400; ">(</span>@qingling@<span style="color: #006400; ">,</span><span style="color: #00008b; ">0</span><span style="color: #006400; ">);</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000; ">bool</span> LED<span style="color: #006400; ">;</span><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;D <span style="color: #006400; ">=</span> A <span style="color: #006400; ">-</span> B<span style="color: #006400; ">;</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;C <span style="color: #006400; ">=</span> D<span style="color: #006400; ">;</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff; font-weight: bold; ">if</span> <span style="color: #006400; ">(</span>QL <span style="color: #006400; ">==</span> <span style="color: #00008b; ">1</span><span style="color: #006400; ">)</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006400; ">{</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B <span style="color: #006400; ">=</span> B <span style="color: #006400; ">+</span> C<span style="color: #006400; ">;</span>&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #191970; font-weight: bold; ">SetBit</span><span style="color: #006400; ">(</span>@LED@<span style="color: #006400; ">,</span><span style="color: #00008b; ">0</span><span style="color: #006400; ">,</span><span style="color: #00008b; ">1</span><span style="color: #006400; ">);</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006400; ">}</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff; font-weight: bold; ">else</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006400; ">{</span>&nbsp;&nbsp;&nbsp;&nbsp;</p><p><span style="color: #191970; font-weight: bold; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SetBit</span><span style="color: #006400; ">(</span>@LED@<span style="color: #006400; ">,</span><span style="color: #00008b; ">0</span><span style="color: #006400; ">,</span><span style="color: #00008b; ">0</span><span style="color: #006400; ">);</span></p><p><span style="color: #006400; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #191970; font-weight: bold; ">SetWord</span><span style="color: #006400; ">(</span>@huancunzhi@<span style="color: #006400; ">,</span><span style="color: #00008b; ">0</span><span style="color: #006400; ">,</span>B<span style="color: #006400; ">);</span>&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #191970; font-weight: bold; ">SetWord</span><span style="color: #006400; ">(</span>@baochizhi@<span style="color: #006400; ">,</span><span style="color: #00008b; ">0</span><span style="color: #006400; ">,</span>C<span style="color: #006400; ">);</span>&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #191970; font-weight: bold; ">SetWord</span><span style="color: #006400; ">(</span>@xianshizhi@<span style="color: #006400; ">,</span><span style="color: #00008b; ">0</span><span style="color: #006400; ">,</span>D<span style="color: #006400; ">);</span>&nbsp; &nbsp;&nbsp;</p><p><br/></p><p>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000080; ">return</span> <span style="color: #00008b; ">0</span><span style="color: #006400; ">;</span><br/><span style="color: #006400; ">}</span></p><p><br/></p><p><br/></p><p><br/></p><p><br/></p><p><br/></p><p><br/></p>

回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright © 2001-2024 英威腾技术论坛 版权所有 All Rights Reserved. 粤ICP备07504406号
关灯 在本版发帖
扫一扫添加微信客服
返回顶部
快速回复 返回顶部 返回列表