LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending TCP data with value change

I want to build a panel with several numeric controls where each time
any of the values are changed, it sends a packet over ethernet
indicating which control was changed and the new value. I'm not sure
how to approach this. My two main problems are:

- How do I trigger the packet to be sent when the value changes?
(Value can be changed by using the up/down buttons or typing a new
value)

- Should I create a subVI that sends out the ethernet data and use one
for each control? Or is there a way to just use one circuit to
send out the data, and feed it from all the controls?

Thanks in advance for any help.
-paul
0 Kudos
Message 1 of 3
(2,663 Views)
- How do I trigger the packet to be sent when the value changes? (Value can be changed by using the up/down buttons or typing a new value)

This seems quite simple to solve with the value changed event of the event control structure. If you can't or don't want to use the event structure, you will have to create your own control polling in your own event driven state machine. Before LabVIEW 5.1 this was the way to create UI control VIs anyhow.

- Should I create a subVI that sends out the ethernet data and use one for each control? Or is there a way to just use one circuit to send out the data, and feed it from all the controls?

It depends all a bit. I think for this particular case it would be useful to create a subVI to which you pass the control name (id
entifier or whatever to send to the other side so it knows what changed) and the new value.

More complex solutions could use a separate subVI somewhere in your top level application which runs as a parallel task with the rest of the application until shutdown and waits for data to send out. The passing between your application and that task VI would best be implemented using queues.

Rolf K
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 3
(2,663 Views)
Perfect, that's exactly what I needed to know to get started.
Thanks!! 🐵

-paul
0 Kudos
Message 3 of 3
(2,663 Views)