LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re: tcp ip

Solved!
Go to solution
Guys pls help me out as i am facing a problem while communicating through TCP/IP Protocol. I have made a main VI and Sub VIs which are communicating through TCP/IP protocol. Individually the Main VI and SubVIs are working fine while communicating through TCP/IP. But when i am integrating all the SUB VIs inside the Main VI and running the program, only the main VI is able to communicate through TCP/IP not the SUB VIs (on clicking the command button for the specific SUB VI). Pls help me out in locating the problem and provide me the solution for that. Thanks in advance
0 Kudos
Message 1 of 9
(3,877 Views)
Solution
Accepted by topic author Dushy@11

Guys pls help me out as i am facing a problem while communicating through TCP/IP Protocol.

 

I have made a main VI and Sub VIs which are communicating through TCP/IP protocol. Individually the Main VI and SubVIs are working fine while communicating through TCP/IP. But when i am integrating all the SUB VIs inside the Main VI and running the program, only the main VI is able to communicate through TCP/IP not the SUB VIs (on clicking the command button for the specific SUB VI).

Pls help me out in locating the problem and provide me the solution for that.


Thanks in advance

0 Kudos
Message 2 of 9
(3,865 Views)
Solution
Accepted by topic author Dushy@11

Guys pls help me out as i am facing a problem while communicating through TCP/IP Protocol.

 

I have made a main VI and Sub VIs which are communicating through TCP/IP protocol. Individually the Main VI and SubVIs are working fine while communicating through TCP/IP. But when i am integrating all the SUB VIs inside the Main VI and running the program, only the main VI is able to communicate through TCP/IP not the SUB VIs (on clicking the command button for the specific SUB VI).

Pls help me out in locating the problem and provide me the solution for that.


Thanks in advance

0 Kudos
Message 3 of 9
(3,874 Views)

Rather than tacking your message onto the end of a year and a half old thread that was barely relevant, you should have started a new message.  I have moved your message to a new thread so it will get attention.

 

But if you are looking for help and talk about main VI's and subVI's, you need to actually post your code.  There is no way anyone can help you without seeing it.

 

EDIT:  You did it to 3 different old threads.  I merged all the messages into this new thread.

0 Kudos
Message 4 of 9
(3,857 Views)

Thanks a lot RAVENSMAN for helping me in putting my query at the right forum.

 

I am attaching snippets of my code where i am actually communicating through TCP/IP protocol. Also attaching the Front panel snippet for making you understand more clearly what i am trying to do.

 

When i am running my Main VI and communicating through TCP/IP,it is working fine and data is transferring absolutely OK.

But when i am clicking the ZOOM Button situated at the extreme left bottom to open another SUB VI(which is part of the logic), the SUB VI opens but the TCP/IP communication is not establishing and hence data is not transferring. And then when i am again clicking the BACK button from SUB VI to go back to the Main VI, Main VI again communicating OK through the TCP/IP protocol.

 

I am using the same module for TCP/IP in both Main VI and SUB VI block Diagram,as you must be seeing in the attached file.

 

P.S. - Do i need to make the SUB VI RE-ENTRANT. Will it solve the problem

 

Pls help me out in locating the problem.

 

Thanks in advance 

0 Kudos
Message 5 of 9
(3,754 Views)

Please attach the actual VI's.  Screenshots aren't code and don't allow us to poke around and see the parts of the code that can't be seen.

 

I don't see where the Zoom button comes into play in your Main VI, so I can't see why that would cause you a problem.  I don't see a "Back" button in your subVI either.

 

My first guess is that when your subVI starts executing, it is blocking further execution of the part of your main VI that contains it.  That is normal dataflow, an node or structure is not going to finish until all code inside of it is complete, and having a subVI that is still executing means it hasn't completed.

 

I doubt re-entrancy settings will come into play here.

0 Kudos
Message 6 of 9
(3,728 Views)

Pls find the attached code for the Main VI & the Sub VI

 

Sub VI is called by the command button ZOOM,which is located at the extreme left bottom

 

 

Pls see to it and suggest why my data is not communicating throgh TCP/IP when i am opening the "date-time_Automate.vi" by clicking ZOOM Button.

 

 

Thanks

Download All
0 Kudos
Message 7 of 9
(3,678 Views)

Have you tried probing or putting indicators on any error wires to see if they are still trying to execute and generating any errors?

 

I see that you are trying to open the same IP address and port connection in both VI's.  That is something I've never tried to do before.  Maybe you can do that, but it just seems wrong to me.  Perhaps opening the second one winds up blocking the first one.  Is there a reason you are splitting up the TCP/IP communication between two completely different VI's?  I would keep all of it in a single location.  If you need information and communicate messages from multiple locations, then I would set up some queues to pass the information around.  Basically keep all communication channeled through a single point.

 

My original thought is that your subVI is blocking your main VI.  But from what I can see in your code, the call of the subVI is in a separate loop with an event structure from the loop that handles the first setup of the TCP/IP connection.   However one thing that concerns me with event structures is when people keep the default setting of "Lock Front Panel until event completes".  Usually that cause people problems long before they fix the architecture or adjust the settings and get it working like they want.  But that manifests as a locked up front panel or program, and you aren't describing that kind of problem.

0 Kudos
Message 8 of 9
(3,653 Views)

Yup i did put the probe in the "Connection ID Output" of the "TCP OPEN CONNECTION" Function block and it was reading "0".

 

What i am trying to do in my code is that i am communicating with microcontroller through TCP/IP Protocol.From my main VI, i send a command to the microcontroller and on recieving the command, microcontroller sends a stream of data to me which i display in my graph.

 

And then on clicking ZOOM Button, my another "date-time_Automate.vi" opens and from there also i send a command to my Microcontroller and on recieving the specified command, it sends me the required data, which i display on my VI.

 

This is what i am trying to implement.

 

Pls suggest, what option should i try to make it work.

 

Shall i introduce the Queue function into my  SUB VI and pass the data into it.(same queue as in Main VI).Will it work

0 Kudos
Message 9 of 9
(3,601 Views)