Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a server TCP with VISA

Hello,
I'm writing an IVI driver in order to communicate with my device. I communicate with my device with TCP/IP protocole. Because I'm writing an IVI driver, I want to use VISA functions and not TCP functions. My device starts only if it can connect to a server TCP/IP but if I just make a viopen of a port on my computer, my device doesn't start. It starts only if I create a server TCP with RegisterTCPServer function. But then when my device replies I don't read anything with VISA function although I read something with the ServerTCPRead function. I can summarize all of this with this little script :
 
ServerTCPRead (Port, serverFunc, 0) -> my device starts
viopen (rmSession, "TCPIP0::127.0.0.1::Port::SOCKET", 0, 0, &io);
Ivi_SetAttributeViSession (IviSession, VI_NULL, IVI_ATTR_IO_SESSION, 0, io);
// My device reply after about 15 seconds so I'm sure my visa session is open
in serverFunc, on DATAREADY event
Ivi_ReadInstrData(IviSession, 255, receiveBuf, &NbReadCharUL); -> doesn't work
ServerTCPRead (g_hconversation, receiveBuf, 255, 1000); -> work
 
At this time, I use only the TCP functions and it works. But I want to know how to do the same with VISA functions which are theorically associated with IVI driver.
If someone is able to understand what I'm trying to do, thanks to helping me.
 
 
0 Kudos
Message 1 of 2
(3,459 Views)
Hello,
 
Are sure that you have configure your instrument to coommunicate via TCP/IP in MAX ? http://digital.ni.com/public.nsf/websearch/D7D8E3E1B682022286256D4A00771A52?OpenDocument
 
Moreover, have you got an error code ? If yes, what is it ?
 
Regards,
Isabelle
Ingénieur d'applications
National Instruments France
0 Kudos
Message 2 of 2
(3,439 Views)