LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subvi running normal when alone but not inside main vi

Solved!
Go to solution
when a vi is run in normal mode it gives proper output. But when it is used as a subvi, it even not at all entering run mode. When observed with highlight execution mode, when the green running mark enters the subvi node, it stops immediately. Any issues?
 
Thanks,
Mathan
Message 1 of 29
(4,070 Views)
Well, I hate to be obvious, but can you post it?
Message 2 of 29
(4,062 Views)

Hi mathan,

if you can´t post it, can you explain what you make in your vi?

Mike

Message 3 of 29
(4,055 Views)

Dear Jeff,

Thanks for the response. But the subvi communicates with a USB device. I searched the forum too, but didn't got any ideas. I will post the main vi. Subvi is little bit confidential. sorry for that.

There are 2 USB devices connected to the system. The subvi1 will disable the device1. After a 5 seconds delay, the subvi2 will check the status of the device2.

The subvi1 runs normally disabling the device1. But subvi2 didn't run at all. when run independently, it works fine.

Hope will get some ideas.

Thanks,

Mathan



Message Edited by mathan on 07-23-2008 07:13 AM
Message 4 of 29
(4,055 Views)

Hi mathan,

in your picture, subvi1 is after the 5 sec delay and two before it. Could this be the problem or is it only a short example?

Mike



Message Edited by MikeS81 on 07-23-2008 02:15 PM
Message 5 of 29
(4,051 Views)

Can you delete all the confidential stuff, and recreate the problem with a simple sub vi?

If not, i think noone can help.

Message 6 of 29
(4,045 Views)
Dear mike, Smiley Happy
That's a good catch. Smiley Wink But unfortunately am not in LabVIEW system to try now. Smiley Mad I understand now that this a poor programming practice keeping the labels off.  Smiley Sad
I will update the status asap. Smiley Very Happy
 
Thanks,
Mathan
Message 7 of 29
(4,044 Views)

It is possibly something with references or resources or timing used by the subvi.  These are often offenders when a subvi is working when run alone but not at the toplevel.  That is if you open a resource in the subvi and dont close it, it can remain opened if the vi is a sub but can release it if the vi is not a subvi and the resources automatically deallocate.  Timing is also an issue sometimes, a dll might run in its own thread and calling the same function too fast can cause concurency issues (dead locks, resource semaphores or race conditions). When it doesnt work do you get any error messages or something to clue us in on where the issue lies?

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 8 of 29
(4,035 Views)
Are your two devices connected through a USB hub?  If one is polling the port on your computer that connects to the hub, the other may not be able to get through, and will error out.
Message 9 of 29
(4,032 Views)

falkpl wrote:

if you open a resource in the subvi and dont close it, it can remain opened if the vi is a sub but can release it if the vi is not a subvi and the resources automatically deallocate.  Timing is also an issue sometimes, a dll might run in its own thread and calling the same function too fast can cause concurency issues (dead locks, resource semaphores or race conditions).


Dear falkpl,
 
I attached the vis finally here for reference. disable is the first vi that will disable the usb device1. doctor is subvi2 that will access the usb device2. Maybe as u told, resource allocation, deadlocks may be problems. please help me in tracing out.
 

falkpl wrote:
When it doesnt work do you get any error messages or something to clue us in on where the issue lies?
No error messages. Just the program stops when it reaches subvi2.
Message 10 of 29
(4,025 Views)