LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing value of Boolean

Hello,

I have a button whose value I need to send to server through TCP connection. This is what I want to have: Whenever I change the value of the button, its value should be sent. I am achieving this only for the first value of the button(which is the default value). I understand that I may require a while loop, but that will continuously send the value of the button.  Is it possible to achieve this without a loop?

 

I want to call the TCPWrite SubVi in GUI Vi each time there is a change in the value of the button. Is there a way I can do that without a loop, or by dynamically loading the SubVi whenever the value of the button changes.

 

Thank you.

 

Regards,

-H.

 

PS: due to network problems, my previous thread(with the same subject) did not get loaded properly. I do not know if I can edit or delete the previuos thread, so I am recreating a thread here. Sorry for the confusion.

Download All
0 Kudos
Message 1 of 8
(3,666 Views)

using a vi server referance to the boolean will help.  instead of two different objects in each vi you now have 1 object and one referance to that object.

 

Functionally, you will need to poll the value in the sub vi.

 

Better yet you COULD use an event structure in the top level to call the sub vi when the value of the boolean changes.

 

 

Which way did you want to go?


"Should be" isn't "Is" -Jay
Download All
0 Kudos
Message 2 of 8
(3,661 Views)

Thankyou Jeff, Reference would help, but again I am receiving  the value of the button just once. The value being, the value that it holds when the application starts. This value is displayed and the application closes soon after. I would want the application to continue to monitor the value of the button, but possibly without a while loop.

 

-H

0 Kudos
Message 3 of 8
(3,655 Views)
In that case.  use a value change event  Lots of examples in the LV example folder on using the register vi server events

"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 8
(3,648 Views)

Hello,

 

I am passing a reference to Boolean into the subVi, to monitor the change in its value. I am now using Value Change event.

 

I am not able to go inside the event structure.  The probe to read the boolean reference value shows not ececuted. 

 

What am I missing?

 

Thanks,

 

-H

 

notexecuted.png

Download All
0 Kudos
Message 5 of 8
(3,603 Views)

Open>This example Dynamically Monitor VI's.vi that ships with LVin Examples\General\Dynamicevents.llb

 

You'll see what I meant

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 8
(3,599 Views)

I went through the Dynamically Monitor VI.vi example. I was missing the register for events node in my vi. I have modified the vi accordingly.

 

I am now passing the reference of the button, from the GUI-1ref1.vi (Main vi) to the TCPWriteRef1.vi(SubVi), at which I am registering for a change in value event. When I access the 'NewVal', in the event structure, I am not able to access anything. In the example above the 'NewVal'  provides Boolean. However, the 'NewVal' in my TCPWriteRef1.vi(SubVi) provides Boolean Refnum, and is not executed when I run the application.

 

I am not able to understand where I am going wrong.

 

Regards,


-H
 
Message Edited by H P on 03-04-2010 04:19 PM
Download All
0 Kudos
Message 7 of 8
(3,581 Views)

H P wrote:

I went through the Dynamically Monitor VI.vi example. I was missing the register for events node in my vi. I have modified the vi accordingly.

 

I am now passing the reference of the button, from the GUI-1ref1.vi (Main vi) to the TCPWriteRef1.vi(SubVi), at which I am registering for a change in value event. When I access the 'NewVal', in the event structure, I am not able to access anything. In the example above the 'NewVal'  provides Boolean. However, the 'NewVal' in my TCPWriteRef1.vi(SubVi) provides Boolean Refnum, and is not executed when I run the application.

 

I am not able to understand where I am going wrong.

 

Regards,


-H
 
Message Edited by H P on 03-04-2010 04:19 PM

You didn't go through it very thoughly.  Look at the example again.  You pass the regisrtation referances into the sub vi and to the event structre that you want to handle the events.

 

I fixed it and added a way to stop the event structure.  Go through the help on the functions and ask until you understand whats happening in this vi


"Should be" isn't "Is" -Jay
Download All
0 Kudos
Message 8 of 8
(3,569 Views)