LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Concatendate String Issues when feeding TCP Write

Hello

I have an issue with concatenating 2 strings.

My inputs: 2 strings. Each string is selected by a boolean switch (ie. send one command, or the other)
Output: a concatenated string feeding into the 'data in' of TCP (which communicates to a TCP-serial adaptor, and a serial RS422 interface of an instrument)

I noticed that when I ran the program showing the program flow (ie. ran the program slow) everything worked perfectly. When I ran it in normal mode (ie. at the set baud rate set by the TCP configerator) I got a serial buffer overload. My guess was that in when Concatenate String wasn't feeding in the (concatenated 2 strings) that it was feeding some sort of wait or empty command. So I decided to try putting in a WHILE loop (with a control button to terminate the loop) and it worked.

So my question is, when the concatenate string is waiting for the string inputs, does it send anything to TCP write?

Thanks
Edward
0 Kudos
Message 1 of 6
(3,154 Views)

LabVIEW is a dataflow language. A function will only run when it was supplied with all of its inputs. That includes both the concatenate function and the TCP Write function, so what you are suggesting should not happen.

Your description is not very clear, but if you post your code, I'm sure we can quickly explain the problem.


___________________
Try to take over the world!
0 Kudos
Message 2 of 6
(3,145 Views)
Thanks for the reply

I'll attach a screen shot of my program
0 Kudos
Message 3 of 6
(3,138 Views)


@eclau wrote:
So my question is, when the concatenate string is waiting for the string inputs, does it send anything to TCP write?

Nothing is waiting for any string inputs, because all your strings are diagram constants and thus always ready.

You inner loop has no purpose except to delay the TCP write until you stop the loop (that loop needs a wait function!). What is the mechanical action setting of this inner stop button? The rest of the code does not make a lot of sense either. What is the purpose of the "front panel" switch? What determines the loop rate of the outer loop?

Familiarize yourself with dataflow.

Can you attach the real program? Why are none of the errors wired for the TCP train?

0 Kudos
Message 4 of 6
(3,125 Views)
Whenever you have code that only works when highlighting is turned on a big red flashing alarm should go off in your head: RACE CONDITION!! (for full multimedia effect imagine loud annoying klaxon sounding).

It's almost a sure bet that everything is not wired up like it looks like it is. Verify the connections on all the wires and above all connect up the error chain through the TCP VIs.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 6
(3,108 Views)
 

As explained, the diagram doesn't have to wait anything, so it executes as soon as it's ready. An alternative method (without changing the basic code) would be to have an event processing mechanism and to execute this code only when a certain event occures. Examples would be an event structure with a boolean control or some of the templates you can see when you click File>>New.

Also, the example finder (Help>>Find Examples) includes some TCP related examples which you should look at.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
0 Kudos
Message 6 of 6
(3,098 Views)