LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can a VI be both server and client?

Solved!
Go to solution

Hi Rambaldi!

I am having same problem as you were having.

Can you post your vis which are working?

0 Kudos
Message 11 of 15
(563 Views)

here is the code im using.

0 Kudos
Message 12 of 15
(554 Views)

 


@Rambaldi wrote:

here is the code im using.


  • Why do you have two 100ms waits in the client? Since they execute in parallel, the total time is the same as if you had only one.
  • What is the purpose of the sequence structure around the server code? Makes no sense.
  • None of your "OR FALSE" code fragments make any sense. A plain wire would do the same thing.
  • both client and server know how big a flat boolean is, you don't need to send the size.
  • Can you explain what you are doing in the second true case of the server?

 

0 Kudos
Message 13 of 15
(537 Views)

I have to talk to some legacy CVI (7.1) code that resides on the Unit Under Test and is running in the form of an exe.  That code is currently a TCP Client.  It was being called by some CVI tests that were bundled into a DLL, and each test was called from TestStand (3.1).  The tests within CVI are considered the slave, as there is a setup routine that calls RegisterTCPServer.

 

if ((status = RegisterTCPServer (ATS_TCP_PORT, ATS_TCP_Callback, NULL)) < 0)

 

To work within our existing architecture, however, I need to re-do (what is currently) the Server code in LabVIEW (8.5) and each of the tests will be called from TestStand (4.01).  In the CVI Server, the TCP_Handle was a static Unsigned, so the handle seemed to be valid for all the tests that wanted to use it from TestStand.

 

static unsigned     TCPhandle = 0;

 

In my mind, it would make most sense if the UUT code (what is now the client) were modified so as to be the server.  Then, each labview test (called from teststand) would open a TCP connection, send the message, close connection.  However, some would like to re-use the client-side C code if at all possible.  If I did that, the labview tests would somehow need to be a server, or I need to create ONE somehow that all the tests use, correct?  I thought I ran into this long ago, where the type for a TCP handle created down in a labVIEW VI didn't translate well into a TestStand type, so I couldn't keep the TCP Handle valid.

 

Any thoughts or clarification would be appreciated.

 

0 Kudos
Message 14 of 15
(477 Views)

Thanks

0 Kudos
Message 15 of 15
(340 Views)