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: 

Configuring outputs correctly on a sub VI

Hello:

I am using Mr. Troy's can recieve( forums.ni.com/t5/forums/postpage/board-id/170 )

But when I try to use it as a subvi connecting it directly; none of the outputs work.... I have connected them as I normaly do with a sub VI000000000.PNGWhat is the correct way to fix this..... Can someone help me

0 Kudos
Message 1 of 10
(3,503 Views)

First of foremost: NEVER implement a NEVERENDING loop on Windows targets!

Second: What is that boolean button you connect to the boolean input of that VI?

 

Hint: your link is malformatted. At least, i have no access right on the link you provided and i assume that most people here share my fate in regard to that.....

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 10
(3,498 Views)

hello

 

Here is the link again!

http://forums.ni.com/t5/Example-Program-Drafts/Vector-XL-Driver-LabVIEW-wrappers/tac-p/3595817#M1231...

 

It is the stop of the original vi

0 Kudos
Message 3 of 10
(3,473 Views)

@LP_C wrote:
[...]

It is the stop of the original vi


There you have your explanation. A subVI only returns values if it stops. EDIT: As you pass the button value to the subVI when the subVI is called and the button is false (unpressed), the subVI will never stop, no matter how often you press the button on the caller. If the button was true (pressed) at the moment of the call, the subVI will iterate one time and then finish execution.

 

In order to use that example as a subVI you have to rework the way it stops or you have to add mechanisms to transfer data in parallel (e.g. queue).

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 10
(3,453 Views)

Norbert_B escribió:

@LP_C wrote:
[...]

It is the stop of the original vi


There you have your explanation. A subVI only returns values if it stops. EDIT: As you pass the button value to the subVI when the subVI is called and the button is false (unpressed), the subVI will never stop, no matter how often you press the button on the caller. If the button was true (pressed) at the moment of the call, the subVI will iterate one time and then finish execution.

 

In order to use that example as a subVI you have to rework the way it stops or you have to add mechanisms to transfer data in parallel (e.g. queue).


How Could I transfer the data in parallel?

That would work wonders!

Troy the creator of the original VI, told me this:

@@LP_C It looks to me like you're trying to do too much in your single "SUB VI".

The problem is that you're constantly opening and closing the port/channel. It's only open for a very short period of time before it's closed again so your missing all the messages. You need to keep the channel activated so the messages get stored in the receive queue, then you can read them out in the next loop iteration. Have a look where the while loop is in my receive example. You have to do something like that or make an "Action engine" style VI that stores the active port handle and state inside it etc.


So could you help me solve it please!

0 Kudos
Message 5 of 10
(3,421 Views)

Hello LP_C

 

As Nortbert_B mentioned you need to implement an architecture that communicates with queues. For example, the Producer/Consumer. http://www.ni.com/white-paper/3023/en/

 

As well, we strongly suggest avoiding nested loops (A loop inside a loop) so it is an important idea to take in consideration when developing code.

 

Diego H

National Instruments. 

Message 6 of 10
(3,409 Views)

Hi guys

I still haven't understand or managed how to make it work............. 😞

0 Kudos
Message 7 of 10
(3,375 Views)

LP_C

 

Start by reviewing this document.

 

Tutorial: SubVIs

http://www.ni.com/white-paper/7593/en/

 

Diego H

National Instruments

Message 8 of 10
(3,350 Views)

Start with the example that works.  From there you can make changes and add features.  The examples included in that library are perfect for Initializing, Writing, Closing, and one for Initializing, Reading in a Loop, Closing.

Message 9 of 10
(3,339 Views)

I didn't managed to make it work. So I will run it without a sub VI.... I tried and tried.....

0 Kudos
Message 10 of 10
(3,316 Views)