Synchronously reads data from device or interface .
[status, buf, readCount] = viRead(session, count)
a real.
a character string.
location of the buffer receiving data from device.
number of bytes actually transferred.
unique logical identifier of a session.
number of bytes to be read (size max: 255).
The viRead() operation synchronously transfers data. The data read is stored in the buffer represented by buf. This operation returns only when the transfer is terminated. Only one synchronous read operation can occur at a time.
[status, defaultRM] = viOpenDefaultRM(); // Send command to get identifier of device located at TCPIP0::ftp.ni.com::21::SOCKET [status, instr] = viOpen(defaultRM, "TCPIP0::ftp.ni.com::21::SOCKET", viGetDefinition("VI_NULL"), viGetDefinition("VI_NULL")); [status, count] = viWrite(instr, "*IDN?"); // Read command answer (device identifier) [status, bufferOut, count] = viRead(instr, 255); disp(bufferOut); viClose(instr); viClose(defaultRM); | ![]() | ![]() |