LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP client server sample

All,

 

This may not really be a LabWindows/CVI question but I'm really stuck on what should be easy to

solve. The brain trust here on the forums has always been helpful so I'll try to explain.

 

The project:
------------------
Get LabWindows/CVI code talking to a muRata SN8200 embedded WiFi module.


The setup:
---------------
(running Labwindows/CVI 2009)

Computer 1 -- (with a wireless NiC) running simple demo TCP server program provided by muRata.

Computer 2 -- USB connection (virtual COM port) with simple program (also provided by muRata) that talks to the SN8200 embedded WiFi module.  This code along with the module creates a simple TCP client.


Whats working:
---------------------
I can successfuly get the Computer 2 client connected to and talking to the Computer 1 server. (using the muRata supplied code)

I can also run the LabWindows/CVI sample code from (\CVI2009\samples\tcp), server on computer 1 & client on computer 2 and they talk with no problems.
(I'm using the same IP addresses and port numbers in all cases)

 

Whats NOT working:
-------------------------------
Run the CVI server program on computer 1.
I cannot get the muRata client program  to connect to the CVI server.

I also tried get the CVI client program to connect to the muRata server.  No luck that way either. The CVI client sample program trys connect, and this function call:
ConnectToTCPServer (&g_hconversation, portNum, tempBuf, ClientTCPCB, NULL, 5000 );
returns with a timeout error code (-11).


What I need:
-------------
Some ideas on how to get this working.

Is there something unique about the LabWindows/CVI sample client/server demo code that would make them incompatible with the muRata code?

Can you think of some ways I can debug this further?  I feel like I'm kind of running blind.
What else can I look at?


For those that have read this far, thanks much and any ideas or comments will be appreciated,


Kirk
 


 

0 Kudos
Message 1 of 3
(4,395 Views)

Hi kirkm,

 

I noticed on this document from muRata a sequence of commands for TCP commands. I don't believe the sample CVI code will have all those steps. 

Humphrey H.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(4,375 Views)

Humphrey,

 

First,

I just figured out what the problem is:

 

When I was trying to use the CVI sample server I was entering the wrong port number.

The reason I entered the wrong port was because the hard-coded port number in the muRata demo code was displayed in hex as 0x9069. ( I converted this to decimal and entered it into the CVI sample server code) The correct port number was 0x6990.  (upper and lower bytes swapped)  Arrgh!

I found the problem by using the netstat command line utility to display the connections and noted that the port being used was not 0x9069.  It is really a problem with the muRata eval kit demo code.

 

 

Second,

Humphrey you are right about the CVI sample code not handling all the muRata commands for the client end of the connection that communicates with the SN8200 module.  For my test I was using the muRata code for that "end".

 

The server end is simple and the CVI sample is adequate and is now working.

 

 

Thank you to all who took the time to browse my questions,

 

Kirk

0 Kudos
Message 3 of 3
(4,369 Views)