05-09-2011 02:10 PM
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
05-10-2011
10:17 PM
- last edited on
10-29-2025
06:10 PM
by
Content Cleaner
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