LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

vi started from visual basic application

Hi,
I made a small visual basic application which has a "start loop", "stop loop",

and "quit" button. It also has a text box. When I click "start loop", it
calls
a simple vi which generates a random number and sends it back to the
text box of visual basic. This is done repeatedly until the "stop loop" button

is pressed on the vb form. The problem is that when I run the program,
the random numbers are updated correctly on the vb form but the form never

gets the focus (no idle time) so I can never press the stop loop.
Here is part of the code:

Private Sub StartLoop_Click()
' this is the code for the "start loop" button
RepeatLoop = True
Do While RepeatLoop
Call DoLVDataExchange
' the DoLVDataExchange con
tains:
' Call vi.Call(paramNames, paramVals)
Loop
End Sub

Private Sub StopLoop_Click()
' this is the code for the "Stop loop" button
RepeatLoop = False
End Sub

Any suggestions welcome. Thanks for your help!
Cyrille
0 Kudos
Message 1 of 2
(1,255 Views)
Cyrille wrote:

>
>
> gets the focus (no idle time) so I can never press the stop loop.
> Here is part of the code:
>

Check the vi.
I have never done this with VB so I am not sure.

In the VI you may need to add a "Wait MS" and wire in 200 (change to suit your
needs)
Or you may need to add this in the VB code

It sounds like the thing is running full speed and you cant hit the
button fast enough to stop the loop.

Kevin Kent
0 Kudos
Message 2 of 2
(1,255 Views)