Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa TCP/IP as Listener

Hi,

 

I have an application running on several remote PCs that controls residual gas analyzers (RGA).

The application has a tcp/ip function that allows me to enter the host machine (my desktop pc) and port number and then sends out data strings using stream tcp sockets whenever the rga has completed a full spectrum scan.

 

I want to set up a tcp listener using visa, but can't find any examples or documentation on how to set up an event handler for this.  Should I use the tcpipsocket or tcpipsession  and what is the event ( servicerequest?) used to read the incoming data strings.  I would really prefer to use ni-visa for this. 

Any help or example code would be welcome!

 

thanks

 

Curt

Message 1 of 2
(3,704 Views)

Hello Curt C,

 

There is a good example for using service requests that you can install with the VISA driver.  Check this page for more information on installing the examples.  Once installed, navigate to either

 

Windows Vista or Windows 7

C:\Users\Public\Documents\National Instruments\NI-VISA\Examples\DotNET4.0

 

or

 

Windows XP

C:\Program Files\National Instruments\Measurement Studio\DotNET\Examples for Windows XP

 

Check out the example called ServiceRequest.  Also, go to Start >> Programs >> National Instruments >> VISA >> Documentation >> NI-VISA .NET Framework 4.0 Help and search for tcpipsocket.  The documentation is pretty good, but I'm not aware of any example code that uses the class.

 

You can also do this using .NET.  Here is a good resource on the TcpListener Class.

 

Regards,

 

Brandon V.

Applications Engineering

National Instruments

 

 

 

 

 

0 Kudos
Message 2 of 2
(3,686 Views)