<< viRead VISA Integration Toolbox viWrite >>

VISA Integration Toolbox >> VISA Integration Toolbox > viRequest

viRequest

Synchronously Read and Write data in device or interface.

Calling Sequence

[status, bufOut] = viRequest(Session, buf)

Arguments

status

a real.

bufOut

a character string.

location of a buffer to receiving data from device.

Session

unique logical identifier of a session.

buf

a character string

Location of the data block to be sent to the device

Description

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.

Examples

[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);

Report an issue
<< viRead VISA Integration Toolbox viWrite >>