|
|
Up |
|
|
  |
Author: mathanmathan Date: Jul 23, 2008 05:10
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
|
| |
|
| | 28 Comments |
|
  |
Author: JeffOvertonJeffOverton Date: Jul 23, 2008 05:10
Well, I hate to be obvious, but can you post it?
|
| |
|
| | no comments |
|
  |
Author: MikeS81MikeS81 Date: Jul 23, 2008 05:40
Hi mathan,
if you can´t post it, can you explain what you make in your vi?
Mike
|
| |
| no comments |
|
  |
Author: mathanmathan Date: Jul 23, 2008 05:40
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.
 http://forums.ni.com/attachments/ni/170/343250/1/untitled5.PNG">
Hope will get some ideas.
Thanks,
MathanMessage Edited by mathan on 07-23-2008 07:13 AM
untitled5.PNG:
http://forums.ni.com/attachments/ni/170/343250/1/untitled5.PNG
|
| |
| no comments |
|
  |
Author: MikeS81MikeS81 Date: Jul 23, 2008 05:40
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?
MikeMessage Edited by MikeS81 on 07-23-2008 02:15 PM
|
| |
| no comments |
|
  |
Author: PntPnt Date: Jul 23, 2008 05:40
Can you delete all the confidential stuff, and recreate the problem with a simple sub vi?
If not, i think noone can help.
|
| |
| no comments |
|
  |
Author: mathanmathan Date: Jul 23, 2008 05:40
Dear mike, :smileyhappy:
That's a good catch. :smileywink: But unfortunately am not in LabVIEW system to try now. :smileymad: I understand now that this a poor programming practice keeping the labels off. :smileysad:
I will update the status asap. :smileyvery-happy:
Thanks,
Mathan
|
| |
| no comments |
|
  |
Author: falkplfalkpl Date: Jul 23, 2008 05:40
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?
|
| |
| no comments |
|
  |
Author: JeffOvertonJeffOverton Date: Jul 23, 2008 06:10
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.
|
| |
| no comments |
|
  |
|
|
  |
Author: mathanmathan Date: Jul 23, 2008 06:10
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.
|
| |
| no comments |
|
|
|
|