LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

passing value out of a while loop

Hi guys!

I'm new to LabView and I've encountered some problems passing a value, R, out of a while loop when using a particular VI as a Sub-VI. I've attached the library file for my program.

The VI that encounters this problem is called TEST.VI, which uses the LockInDemoSimple.VI as a sub-VI. The indicator value in TEST.VI does not update itself at because the value R has problems being passed out of the while loop in LockInDemoSimple.VI. Can anyone suggest a solution to this?

Thanks a millionz.
0 Kudos
Message 1 of 7
(3,966 Views)

Hi,

    While loop doesn't pass value out of it until it stops. so as long as yor LockInDemoSimple.VI running you will not be able to get R on Test.vi.So make required changes sothat the loop will stop and throw value out of it. Secondly you can use globel appropriatly to achieve it.

Let me know if you are again in trouble.

0 Kudos
Message 2 of 7
(3,954 Views)
Hi once more,
 
I tried using global cos' I do not know how to stop the while loop by itself, throw out the value, and start the loop again. It works fine, but this program itself takes up 100% of my CPU capabilities and 'lags' my other program which is required to run simultaneously with this program.
 
Do you have any idea how to resolve the problem besides switching to a better computer?
 
Thanks.
0 Kudos
Message 3 of 7
(3,909 Views)

Hi, you were observing that 100% CPU loading because your program's Sub vi execution was not properly controlled

I have modified ur Test program to do following

Control the execution of the loop in Demo VI

Pass the R value from the  loop in Demo VI through a global variable to display on the test VI

This should not load your CPU's resources

Regards

Dev

 

 

0 Kudos
Message 4 of 7
(3,904 Views)
Hello group,
I am a new member of the group.
I want to know whether it is possible to configure LabVIEW with Modbus or Profibus.
If yes the can anubody tell me how can we do that in detail.
Srinivas
0 Kudos
Message 5 of 7
(3,901 Views)
Hi,

for the modified program, I can't seem to stop after I pressed start....


0 Kudos
Message 6 of 7
(3,863 Views)


@Srinivas Kharsada Patnaik wrote:
I want to know whether it is possible to configure LabVIEW with Modbus or Profibus.
If yes the can anubody tell me how can we do that in detail.



Hi Srinivas,

You should post your question in a new thread, since this one is for "while loop" only.

Check out this link, which may help you.

http://forums.ni.com/ni/board/message?board.id=170&message.id=156492&query.id=73571#M156492

Message 7 of 7
(3,851 Views)