Synchronously Read and Write data in device or interface.
[status, bufOut] = viRequest(Session, buf)
a real.
a character string.
location of a buffer to receiving data from device.
unique logical identifier of a session.
a character string
Location of the data block to be sent to the device
The viRequest() operation synchronously transfers data. The data to be written is in the buffer represented by buf and the data read to be stored is in the buffer represented by bufOut. This operation returns only when the transfer is terminated. Only one synchronous query operation can occur at a time.
[status, defaultRM] = viOpenDefaultRM(); disp("write :"); disp("Adress = "" device adress "" exemple Adress = ""TCPIP0::ftp.ni.com::21::SOCKET"""); if execstr("Adress", 'errcatch') == 4 then Adress = "TCPIP0::ftp.ni.com::21::SOCKET"; end [status, instr] = viOpen (defaultRM, Adress, viGetDefinition("VI_NULL"),viGetDefinition("VI_NULL")); [status, bufferOut] = viRequest(instr, "*IDN?"); bufferOut viClose (instr); viClose (defaultRM); | ![]() | ![]() |