LabVIEW布尔值的机械作用是什么

LabVIEW布尔值的机械作用是什么

布尔控件具有机械操作,这些操作控制使用鼠标激活如何影响控件的值。机械动作允许控制模仿某些物理执行器(例如电灯开关或紧急停止按钮)。

六种类型的机械动作是:

可以通过从前面板右键单击布尔值来更改布尔值的机械动作。

机械操作不仅会更改控件对用户输入的反应方式,还会影响从框图访问控件值的方式(如果设置为任何Latch 操作)。查看控件的属性时,更改是可见的。虽然可以只访问开关操作的布尔值,但锁存操作的类型从布尔值更改为变体。这样做的原因是,如果在框图上的多个位置读取闭锁行为,则会导致争用条件。这就是为什么只有控件返回实际的布尔值,而不是属性节点。

为了访问锁存类型控件的布尔值,必须使用事件结构。

Themechanical action not only changes how a control reacts to user input, it alsoaffects how control values can be access from the block diagram if set to anyof the Latch actions. The changes are visible when looking at the Valueproperty of the control. While it is possible to just access the Boolean valuefor switch actions, the type for latch actions changes from Boolean to Variant.The reason for this is, that the latching behavior would cause race-conditionsif it was read in multiple places on the block diagram. This is, why only thecontrol returns the actual Boolean value, but not the property node.

In orderto access the Boolean value for latch type controls, an event structure must beused.

布尔按钮和控件可以配置为具有六种不同类型的机械动作中的任何一种:按下时切换、释放时切换、释放前切换、按下时闩锁、释放时闩锁、释放前闩锁。这可以通过右键单击按钮并选择适当的机械动作来完成。有一个关于每个机械动作如何影响控件行为的小象形图,但只需将它们放在一个循环中,就可以更容易理解每个动作的工作原理。

Booleanbuttons and controls can be configured to have any of six different types ofmechanical action: Switch When Pressed, Switch When Released, Switch UntilRelease, Latch When Pressed, Latch When Release, Latch Until Release. This canbe done by right-clicking the button and selecting the proper MechanicalAction. There is a small pictogram on how each mechanical action affects thebehavior of the control, but it can be easier to understand how each actionworks by simply putting them in a loop.

This VIimplements each action and maps them to two buttons - one for a mouse click andone for a function key. By running the VI, you will be able to more easilyunderstand how each mechanical action works in a loop, and how changing theloop timing affects certain mechanical actions.

需要说明的是,上述的例程和文档,都是可以下载的,双击即可打开,其中压缩文件是可以采用粘贴复制的方式,拷贝到硬盘上。这不是图片,各位小伙伴看到后尝试一下,这个问题就不用加微信咨询了。有关LabVIEW编程、LabVIEW开发等相关项目,可联系们。附件中的资料这里无法上传,可去公司网站搜索下载。

LabVIEW程序,如下附件所示。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值