From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

“USB RAW-块”范例的问题

Solved!
Go to solution

请问labVIEW2010的“USB RAW-块”(NI范例查找器\硬件输入与输出\VISA\USB RAW -块)范例中,第1步(根据注释)中的枚举常量输出的值(0-Initialize/Session Closed;1-Session Opened; 2-Do Nothing)是由什么决定的呀?

Nothing Impossibe!
0 Kudos
Message 1 of 7
(2,782 Views)

不太明白你问的是什么意思,枚举常量里面有三个值,分别决定case结构中的操作,输出的值是自己选择的。

0 Kudos
Message 2 of 7
(2,766 Views)

我的意思是,这个枚举常量什么情况下输出0(0-Initialize/Session Closed),什么情况下输出1(1-Session Opened),什么情况下输出2( 2-Do Nothing)?或者说它输出0、1、2由谁决定的?

谢谢了呀!

Nothing Impossibe!
0 Kudos
Message 3 of 7
(2,762 Views)
Solution
Accepted by topic author univer

首先初始值就是While循环外部的那个值,将枚举常量选成0-Initialize/Session Closed,
后面输出是由While循环上的移位寄存器来存储每次循环的值,相当于一个状态机。

0 Kudos
Message 4 of 7
(2,760 Views)

谢谢Bonnie

根据您的精辟的讲解,我的理解是:

枚举常量的框相当于一个局部变量,里面装的值是枚举类型,

在循环外选为0,即取0值,给局部变量赋0值,

在事件结构里取1、2值,给局部变量赋1、2值,

是吗?

Nothing Impossibe!
0 Kudos
Message 5 of 7
(2,755 Views)

对的,是根据程序的需求,在一种状态下需要决定下一致性状态是什么,直接给移位寄存器赋值就好了,移位寄存器里存储的是下一状态的值

0 Kudos
Message 6 of 7
(2,744 Views)

非常感谢Bonnie

Nothing Impossibe!
0 Kudos
Message 7 of 7
(2,738 Views)