03-03-2010 04:44 PM
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.
03-03-2010 04:57 PM
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?
03-03-2010 05:11 PM
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
03-03-2010 05:29 PM
03-04-2010 12:58 PM
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
03-04-2010 01:08 PM
Open>This example Dynamically Monitor VI's.vi that ships with LVin Examples\General\Dynamicevents.llb
You'll see what I meant
03-04-2010 04:18 PM - edited 03-04-2010 04:19 PM
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,
03-04-2010 05:01 PM
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,
-HMessage 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