04-16-2009 07:38 AM
I am using a modified "TCP Communicator - Active" from the Labview examples to communicate with a device over ethernet. Works well but I want to use it as a Sub Vi since it will be a part of a much larger system.
Thats is where my problem is. The String Control is inside a while loop in the Sub Vi and I have problem sending a text string to it. I think there should be a very easy solution to this.
Attaching Sub Vi and a Vi thats shows how I want to use it.
Solved! Go to Solution.
04-16-2009 07:59 AM
04-16-2009 08:02 AM
I could not run your code. But this it what I think happens then you call your sub VI
1) the input argument is loaded into the "input line" control before any code execute
2) The sub VI execution starts, and the contents of the "input line" is cleared because a locale variable is wired to an empty string
3) The content of the "input line" control is empty, and you will be stuck in the small while loop unless you do not enter something into the "input line" control
04-16-2009 08:07 AM
Awesome! Now it works. Well kind of. It goes into a endless loop and spams my device with packages. But I just have to put in some kind of "stop" when i have recieved a answer and it should be ok.
Thanks!
04-16-2009 08:43 AM
04-16-2009 08:48 AM
Hi Peter_Y,
use another refnum input for your output. Use a property node with value and change it to write (you can change it by right clicking on it). Replace your exsting output with the new property node.
Mike
04-16-2009 08:57 AM
Ah ok I tried to make a refnum output instead of an input. Made sense to me to have an refnum output to a output string. Now with a refnum input as you suggested that works aswell.
Thanks again!
04-16-2009 08:59 AM
Hi Peter_Y,
your refnum has to be an input, because it's a pointer to your control.
Mike