haoayou 发表于 2024-7-10 18:16:53

初始Codesys与ST-1.3.4Codesys的trace示波器跟踪功能

<p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;">Codesys平台支持trace跟踪功能,trace实际上就抓数据,显示波形的用途。我们在调试的时候,可以使用波形来协助我们分析程序逻辑,分析设备运行状态。</p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p><img src="/upload/image/20230917/1694911094770218.png" alt="" class="wp-image-3545" style="height: auto; vertical-align: middle; border: 0px; margin: 0px auto; display: block;"/>添加trace</p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;">首先鼠标放到application上面,然后右击弹出如图上选择框。选择添加对象,然后选择跟踪。这里跟踪需要说明的是名称需要是英文的,不然会报错。</p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p><img src="/upload/image/20230917/1694911094872014.png" alt="" class="wp-image-3546" style="height: auto; vertical-align: middle; border: 0px; margin: 0px auto; display: block;"/>添加trace</p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;">写好名称后,点击确定。</p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p><img src="/upload/image/20230917/1694911095876376.png" alt="" class="wp-image-3547" style="height: auto; vertical-align: middle; border: 0px; margin: 0px auto; display: block;"/>添加配置</p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;">咱们这里需要先配置一下trace,配置到Maintask任务下,这个配置的意思就是trace跟踪中数据更新的时间按照配置的任务的扫描周期运行,每个扫描周期更新一次采样数据。</p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;">配置完成之后,我们还需要为这个跟踪添加监控的数据变量,这里要求-必须是英文的!否则会报错。</p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; text-wrap: wrap;">有了仿真以及trace抓曲线的功能之后,我们就可以很方便的调试程序了。即使我们没有硬件设施,我们也能学习ST编程相关的知识。下一个示例程序中,我们将给大家分享trace波形分析以及仿真的具体用法,敬请期待!</p><p><br/></p>
页: [1]
查看完整版本: 初始Codesys与ST-1.3.4Codesys的trace示波器跟踪功能