如何知道正在传递哪种数据类型

发布于 2025-01-16 08:52:12 字数 295 浏览 1 评论 0原文

我的框图中有一个Select 函数。对于 True 和 False 语句,我传递两种数据类型。 True 语句是前面板数字指示器的Digital Reference 数据类型,False 语句是前面仪表板的knob Reference 数据类型面板也是如此。我不确定在 Select 函数的中间入口点放置什么,因为它需要有一个 True Boolean。理想情况下,我只需连接另一个“数字参考”数据类型,在这种情况下它将返回数字指示器,但“选择”函数仅接收布尔值作为输入。

I have a Select function in my block diagram. For the True and False statements I am passing two data types. The True statement is a is a Digital Reference data type to a numerical indicator in the front panel, and the False statement is a knob Reference data type to a gauge in the front panel as well. I am not sure what to put in the middle entry point for the Select function since it needs to have a True Boolean. Ideally I would just connect another Digital Reference data type and it would return the digital indicator in that case but the Select function only receives a boolean as an input.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

汐鸠 2025-01-23 08:52:12

理想情况下,我只需连接另一个数字参考数据类型,在这种情况下它将返回数字指示器

什么情况下?您还没有定义任何情况。 :-)

Select 节点在两个不同的之间进行选择。当您将数字参考连接到一个输入并将旋钮参考连接到另一个输入时,输出将是这两个控件之一的控制参考。您必须连接 Bool 才能选择要在下游操作的控件。

您说您想将另一个数字参考连接到中间端子,但这只是对控件的参考。它没有定义选择。也许您想读取其他控件的 Value 属性并对该值执行某些操作?如果是这样,这就是您的代码,您可以在其中进行任何您想要的测试,而不是“等于零”节点。

输入图片此处描述

Ideally I would just connect another Digital Reference data type and it would return the digital indicator in that case

In what case? You haven't defined any case. :-)

The Select node picks between two different values. When you wire the digital reference to one input and the knob reference to the other input, the output will be a control reference to one of those two controls. You have to wire a Bool in order to pick which control you're going to operate on downstream.

You say you want to wire another Digital Reference to the middle terminal, but that's just a reference to a control. It doesn't define a choice. Perhaps you want to read the Value property of that other control and do something on the value? If so, this is your code, where you put whatever test you want instead of the Equal Zero node.

enter image description here

太阳公公是暖光 2025-01-23 08:52:12

选择函数需要选择器输入中的布尔值。其他两个输入根据您连接的内容而变化。
因此,在您的场景中:

  • 输出类型是旋钮参考和数字参考之间最底层的常见类别。它应该是一个数字引用。

  • 选择器输入必须是布尔类型。您无法连接任何引用或任何其他数据类型。因此,连接布尔控件或使用 srm 建议的方法。

Select function requires a boolean in the selector input. The other two inputs changes according to what you connect.
So, in your scenario:

  • Output type is the most lower common class between knob reference and numeric reference. It should be a Numeric reference.

  • the selector input must be a boolean type. You cannot connect any reference or any other data type. So, connect a boolean control or use the approach suggested by srm.

独闯女儿国 2025-01-23 08:52:12

我通过将 equal 函数连接到 select 函数的中间布尔选择器输入找到了解决方案。 equal 函数有两个输入,第一个输入为 Knob ReferenceDigital Reference,以及一个Digital Reference对于第二个输入。如果这两者相等,则 equal 函数将 true 传递给 selector 函数,然后在这种情况下传递 Digital Reference

I found a solution by connecting an equal function to the middle boolean selector input of the select function. The equal function has two inputs, an either Knob Reference or Digital Reference for the first input and a Digital Reference for the second input. If those two are equal then the equal function passes true to the selector function and then the Digital Reference gets passed in this case.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文