Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP Listen connection to VISA

No, I'm not using Bytes at Serial Port.
0 Kudos
Message 11 of 21
(2,120 Views)

Then what is the serial function you are looking to duplicate with the TCP Listen? Perhaps if you provided some details on the client/server design you have.

0 Kudos
Message 12 of 21
(2,118 Views)
I'm passing the VISA resource to my VIs after the connection is already open (opened a socket, opened the COM port, etc.). They are a black box for all intents and purposes, they just read and write characters.

My only question is can I use VISA, in any way, to listen for a TCP connection.
0 Kudos
Message 13 of 21
(2,115 Views)

As I said, I think the only thing you can do is a VISA Read with a short timeout. I would imagine that your serial connection would work the same way then.

0 Kudos
Message 14 of 21
(2,113 Views)
Hi Dennis,

There's no way to do a VISA Read if I don't have a resource to pass to it. That's what I'm looking for; how to create that resource for TCP as a listener. A VISA client is easy (tcpip::address::port::SOCKET) but there doesn't look like a way to be a server.

I think the answer is there isn't one. I'll search for another solution. Thanks for everyone's help.
0 Kudos
Message 15 of 21
(2,110 Views)

I don't understand. You said "I'm passing the VISA resource to my VIs after the connection is already open". The resource is the same whether you are doing a write or a read. You have the same com port resource don't you?

0 Kudos
Message 16 of 21
(2,104 Views)

Ok, let's start over.  I have two computers that communicate over a serial port. Both computers open their serial ports and use my VIs to communicate. Those VIs take in a VESA Resource to pass to the underlying VESA Read/Write functions.

 

Now, I want to do the same thing but over TCP/IP not the serial port.  On one computer, acting as the client, I can pass the string "tcpip::address::port::SOCKET" to VISA Open to connect to the other but there doesn't appear to be a way on the server to listen for that incoming connection.

 

Normally, you would use TCP Listen and pass the TCP Connection ID it returns to the TCP Read/Write functions to communicate, but my VIs on the server take a VESA Resource. And, while you CAN go from a VISA Resource to a TCP Connection, it doesn't look like you can do the reverse.

 

I was wondering if there was a way, maybe a way to format the VISA resource string, to listen for an incoming connection; the opposite of passing in "tcpip::address::port::SOCKET" to VISA Open.

0 Kudos
Message 17 of 21
(2,100 Views)

Okay, so different pc's. So one pc has an IP of say 192.168.1.1 (pc1) and the other (pc2) has an IP of 192.168.1.2. So you are saying you can open on pc1 a resource to 192.168.1.2 and write to it but on pc2 you cannot open a resource to 192.168.1.1 and read from it?

0 Kudos
Message 18 of 21
(2,097 Views)

Yes, on PC1 there is a way to format the VISA Resource name to connect to a server (PC2) but no way to format the VISA Resource name on PC2 to listen for that connection.

0 Kudos
Message 19 of 21
(2,091 Views)

And what kind of error do you get with the VISA Open on pc2?

0 Kudos
Message 20 of 21
(2,083 Views)