LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Propably very easy problem

Solved!
Go to solution

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.

Download All
0 Kudos
Message 1 of 8
(3,286 Views)
Solution
Accepted by topic author Peter_Y
You just need to use a refnum instead to pass to the subVI. Have a look at the attached modified example saved for LV 8.0. You can create refnum's by right-clicking and Create -> Refnum.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 2 of 8
(3,275 Views)

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

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 3 of 8
(3,273 Views)

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!

0 Kudos
Message 4 of 8
(3,268 Views)
Trying to do the same with the string output but I don´t understand refnum enough to do it. Can you please help with that aswell?
0 Kudos
Message 5 of 8
(3,247 Views)

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

0 Kudos
Message 6 of 8
(3,244 Views)

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!

0 Kudos
Message 7 of 8
(3,239 Views)

Hi Peter_Y,

your refnum has to be an input, because it's a pointer to your control.

 

Mike

0 Kudos
Message 8 of 8
(3,228 Views)