The Instrument Control toolkit is a set of low level I/O functions for serial, i2c, spi, modbus, parallel, tcp, gpib, vxi11, udp and usbtmc interfaces
The Instrument Control toolkit must be installed and then loaded to be used.
It can be installed in GNU Octave directly from octave-forge, or can be installed in an off-line mode via a downloaded tarball.
The toolkit must be then be loaded once per each GNU Octave session in order to use its functionality.
For GPIB support (Linux only), linux-gpib must be installed before installing instrument-control. GPIB support is also available for windows by following the information from the wiki: https://wiki.octave.org/Instrument_control_package#Requirements
For VXI11 support, rpcgen, and libtirpc-devel must be installed before installing instrument-control.
For MODBUS support, the libmodbus-devel must be installed before installing instrument-control.
If using the GNU Octave installer in Windows, the toolkit will have already been installed, and does not need to be re-installed unless a newer version is available.
Run the following command to verify if the toolkit is available:
pkg list instrument-control
With an internet connection available, toolkit can be installed from octave-forge using the following command within GNU Octave:
pkg install -forge instrument-control
The latest released version of the toolkit will be downloaded, compiled and installed.
With the toolkit package already downloaded, and in the current directory when running GNU Octave, the package can be installed using the following command within GNU Octave:
pkg install instrument-control-0.9.4.tar.gz
Regardless of the method of installing the toolkit, in order to use its functions, the toolkit must be loaded using the pkg load command:
pkg load instrument-control
The toolkit must be loaded on each GNU Octave session.
The Instrument control package provides low level I/O functions for serial, i2c, spi, parallel, tcp, gpib, vxi11, udp and usbtmc interfaces.
It was written mainly by the following developers:
The ability to use each interface is dependent on OS and what libraries were available during the toolkit install.
To verify the available interfaces, run the following command in octave:
instrhwinfo
The function will return information on the supported interfaces that are available, similar to below:
ToolboxVersion = 0.7.0 ToolboxName = octave instrument control package SupportedInterfaces = { [1,1] = gpib [1,2] = i2c [1,3] = parallel [1,4] = serial [1,5] = serialport [1,6] = tcp [1,7] = tcpclient [1,8] = udp [1,9] = udpport [1,10] = usbtmc [1,11] = vxi11 }
Most interfaces have two types of functions:
NOTE: The serial object has been deprecated and may not appear in newer versions of the instrument-control toolbox. Instead new code should use the serialport object. |
The serial port can be opened using the serial function:
s = serial("/dev/ttyUSB1", 115200)
The first parameter is the device name and is OS specific. The second parameter is the baudrate.
A list of available serial ports can be retrieved using the function:
seriallist
After creating the interface object, properties of the device can be set or retrieved using get or set functions or as property access.
s = serial("/dev/ttyUSB1", 115200) br = get(s, "baudrate") # gets the baudrate br = s.baudrate # also gets the baudrate set(s, "baudrate", 9600) # set the baudrate s.baudrate = 9600 # also sets the baudrate
The device can be written and read from using fread, fwrite and srl_read and slr_write functions.
srl_write(s, "hello world") # write hello world fprintf(s, "hello again") val = srl_read(s, 10) # attempt to read val = fread(s, 10)
The device can be closed using fclose or srl_close.
fclose(s)
The recommended method of accessing serial ports is through the serialport object.
The serial port can be opened using the serialport function:
s = serialport("/dev/ttyUSB1", 115200)
The first parameter is the device name and is OS specific. The second parameter is the baudrate.
A list of available serial ports can be retrieved using the function:
serialportlist
After creating the interface object, properties of the device can be set or retrieved using get or set functions or as property access.
s = serialport("/dev/ttyUSB1", 115200) br = get(s, "BaudRate") # gets the baudrate br = s.BaudRate # also gets the baudrate set(s, "BaudRate", 9600) # set the baudrate s.BaudRate = 9600 # also sets the baudrate
The device can be written and read from using read and write functions.
write(s, "hello world") # write hello world val = read(s, 10)
The device can be closed by clearing the serialport object.
clear s
NOTE: The TCP object has been deprecated and may not appear in newer versions of the instrument-control toolbox. Instead new code should use the tcpclient object. |
A TCP connection can be opened using the tcp or tcpip function:
s = tcp("127.0.0.1", 80)
The first parameter is the IP address to connect to. The second parameter is the port number. And optional timeout value can be also be provided.
A more matlab compatible function is available as tcpip to also open a tcp port:
s = tcpip("gnu.org", 80)
The first parameter is a hostname or ip address, the second the port number. Additional parameter/value pairs can be provided after the port.
After creating the interface object, properties of the device can be set or retrieved using get or set functions or as property access.
s = tcp("127.0.0.1", 80) oldtimeout = get(s, "timeout") # get timeout set(s, "timeout", 10) # set the timeout s.timeout = oldtimeout # also sets the timeout
The device can be written and read from using fread, fwrite and tcp_read and tcp_write functions.
tcp_write(s, "HEAD / HTTP/1.1\r\n\r\n") val = tcp_read(s, 100, 500) # attempt to read 100 bytes
The device can be closed using fclose or tcp_close.
fclose(s)
The recommended method of creating a tcp connection is through the tcpclient object.
A TCP connection can be opened using the tcpclient function:
s = tcpclient("127.0.0.1", 80)
The first parameter is the IP address or hostname to connect to. The second parameter is the port number.
Additional parameter/value pairs can be provided after the port.
After creating the interface object, properties of the device can be set or retrieved using get or set functions or as property access.
s = tcpclient("127.0.0.1", 80) oldtimeout = get(s, "Timeout") # get timeout set(s, "Timeout", 10) # set the timeout s.Timeout = oldtimeout # also sets the timeout
The device can be written and read from using read and write functions.
write(s, "HEAD / HTTP/1.1\r\n\r\n") val = read(s, 100) # attempt to read 100 bytes
The device can be closed by clearing the object variable.
clear s
NOTE: The UDP object has been deprecated and may not appear in newer versions of the instrument-control toolbox. Instead new code should use the udpport object. |
A UDP connection can be opened using the udp function:
s = udp("127.0.0.1", 80)
The first parameter is the IP address data will be to. The second parameter is the port number.
If and ip address and port is not provides, it will default to "127.0.0.1" and 23.
The address and port can be changed after creation using the remotehost and remoteport properties.
s = udp() s.remotehost = "127.0.0.1"; s.remoteport = 100;
After creating the interface object, other properties of the device can be set or retrieved using get or set functions or as property access.
s = udp("127.0.0.1", 80) oldtimeout = get(s, "timeout") # get timeout set(s, "timeout", 10) # set the timeout s.timeout = oldtimeout # also sets the timeout
The device can be written and read from using fread, fwrite and udp_read and udp_write functions.
udp_write(s, "test") val = udp_read(s, 5)
The device can be closed using fclose or udp_close.
fclose(s)
The recommended method of creating a udp socket is through the udpport object.
A udpport object can be created using the udpport function:
s = udpport()
Additional parameter/value pairs can be provided during creation of the object.
After creating the interface object, properties of the device can be set or retrieved using get or set functions or as property access.
s = udpport() oldtimeout = get(s, "Timeout") # get timeout set(s, "Timeout", 10) # set the timeout s.Timeout = oldtimeout # also sets the timeout
The device can be written and read from using read and write functions.
The destination address and port to send data to must be specified at least on the first time write is used.
write(s, "test", "127.0.0.1", s.LocalPort) val = read(s)
The device can be closed by clearing the object variable.
clear s
The functions currently available in the toolkit are described below.
(dev, data, datatype)
¶Write a IEEE 488.2 binblock of data to a instrument device
binblock formatted data is defined as:
#<A><B><C>
where: <A> ASCII number containing the length of part <B>
<B> ASCII number containing the number of bytes of <C>
<C> Binary data block
dev - connected device
data - binary data to send
datatype - datatype to send data as
None
See also: flushoutput.
[list] =
instrhwinfo ()
¶list =
instrhwinfo (interface)
¶Query available hardware for instrument-control
When run without any input parameters, instrhwinfo will provide the toolbox information and a list of supported interfaces.
interface is the instrument interface to query. When provided, instrhwinfo will provide information on the specified interface.
Currently only interface "serialport","i2c" and "spi" and is supported, which will provide a list of available serial ports or i2c ports.
If an output variable is provided, the function will store the information to the variable, otherwise it will be displayed to the screen.
instrhwinfo scalar structure containing the fields: ToolboxVersion = 0.4.0 ToolboxName = octave instrument control package SupportedInterfaces = { [1,1] = i2c [1,2] = parallel [1,3] = serialport [1,4] = tcp [1,5] = udp [1,6] = usbtmc [1,7] = vxi11 }
name =
resolvehost (host)
¶[name, address] =
resolvehost (host)
¶out =
resolvehost (host, returntype)
¶Resolve a network host name or address to network name and address
host - Host name or IP address string to resolve.
name - Resolved IP host name.
returntype - ’name’ to get host name, ’address’ to get IP address.
name - Resolved IP host name.
address - Resolved IP host address.
out - host name if returntype is ’name’, ipaddress if returntype is ’address’
%% get resolved ip name and address of www.gnu.org [name, address] = resolvehost ('www.gnu.org'); %% get ip address of www.gnu.org ipaddress = resolvehost ('www.gnu.org', 'address');
See also: tcp, udp.
res =
fclose (obj)
¶Closes connection to GPIB device obj
res =
fopen (obj) (dummy)
¶Opens connection to GPIB device obj This currently is a dummy function to improve compatibility to MATLAB
data =
fread (obj)
¶data =
fread (obj, size)
¶data =
fread (obj, size, precision)
¶[data,count] =
fread (obj, ...)
¶[data,count,errmsg] =
fread (obj, ...)
¶Reads data from GPIB instrument
obj is a GPIB object
size Number of values to read. (Default: 100) precision precision of data
count values read errmsg read operation error message
res =
fscanf (obj)
¶res =
fscanf (obj, format)
¶res =
fscanf (obj, format, size)
¶[res,count] =
fscanf (obj, ...)
¶[res,count,errmsg] =
fscanf (obj, ...)
¶Reads data res from GPIB instrument
obj is a GPIB object
format Format specifier size number of values
count values read errmsg read operation error message
(obj)
¶Send clear command to Clear GPIB instrument.
obj is a GPIB object
gpib =
gpib ([gpibid], [timeout])
¶Open gpib interface.
gpibid - the interface number.
timeout - the interface timeout value. If omitted defaults to blocking call.
The gpib() shall return instance of octave_gpib class as the result gpib.
(gpib)
¶Close the interface and release a file descriptor.
gpib - instance of octave_gpib class.
[data, count, eoi] =
gpib_read (gpib, n)
¶Read from gpib interface.
gpib - instance of octave_gpib class.
n - number of bytes to attempt to read of type Integer.
The gpib_read() shall return number of bytes successfully read in count as Integer and the bytes themselves in data as uint8 array. eoi indicates read operation complete
(gpib, timeout)
¶t =
gpib_timeout (gpib)
¶Set new or get existing gpib interface timeout parameter. The timeout value is valid from 0 to 17.
gpib - instance of octave_gpib class.
timeout - Value of 0 means never timeout, 11 means one second and 17 means 1000 seconds (see GPIB documentation (ibtmo) for further details)
If timeout parameter is omitted, the gpib_timeout() shall return current timeout value as the result t.
n =
gpib_write (gpib, data)
¶Write data to a gpib interface.
gpib - instance of octave_gpib class.
data - data to be written to the gpib interface. Can be either of String or uint8 type.
Upon successful completion, gpib_write() shall return the number of bytes written as the result n.
res =
fopen (obj) (dummy)
¶Opens I2C connection obj
This currently is a dummy function to improve compatibility to MATLAB
data =
fread (obj)
¶data =
fread (obj, size)
¶data =
fread (obj, size, precision)
¶[data,count] =
fread (obj, ...)
¶[data,count,errmsg] =
fread (obj, ...)
¶Reads data from I2C instrument
obj is a I2C object.
size Number of values to read. (Default: 100).
precision precision of data.
data data values.
count number of values read.
errmsg read operation error message.
struct =
get (i2c)
¶field =
get (i2c, property)
¶Get the properties of i2c object.
i2c - instance of octave_i2c class.
property - name of property.
When property was specified, return the value of that property.
otherwise return the values of all properties as a structure.
See also: @octave_i2c/set.
set
(obj, property,value)
¶set
(obj, property,value,…)
¶Set the properties of i2c object.
obj - instance of octave_i2c class.
property - name of property.
If property is a cell so must be value, it sets the values of all matching properties.
The function also accepts property-value pairs.
Set the name for the i2c socket.
Set the remote address for the i2c socket.
None
See also: @octave_i2c/get.
i2c =
i2c ([port_path], [address])
¶Open i2c interface.
port_path - the interface device port/path of type String. If omitted defaults to
’/dev/i2c-0’.
address - the slave device address. If omitted must be set using i2c_addr() call.
i2c - An instance of octave_i2c class.
The i2c object has the following properties:
Name of the object
the slave device address
The interface driver port (readonly)
(i2c, address)
¶addr =
i2c_addr (i2c)
¶Set new or get existing i2c slave device address.
i2c - instance of octave_i2c class.
address - i2c slave device address of type Integer.
The address is passed in the 7 or 10 lower bits of the argument.
addr - If address parameter is omitted, the i2c_addr() shall return current i2c slave device address.
[data, count] =
i2c_read (i2c, n)
¶Read from i2c slave device.
i2c - instance of octave_i2c class.
n - number of bytes to attempt to read of type Integer.
The i2c_read() shall return number of bytes successfully read in count as Integer and the bytes themselves in data as uint8 array.
n =
i2c_write (i2c, data)
¶Write data to a i2c slave device.
i2c - instance of octave_i2c class.
data - data, of type uint8, to be written to the slave device.
Upon successful completion, i2c_write() shall return the number of bytes written as the result n.
struct =
get (dev)
¶field =
get (dev, property)
¶Get the properties of modbus object.
dev - instance of octave_modbus class.
property - name of property.
When property was specified, return the value of that property.
otherwise return the values of all properties as a structure.
See also: @octave_modbus/set.
data =
maskWrite (dev, address, andmask, ormask)
¶data =
maskWrite (dev, address, andmask, ormask, serverid)
¶Read holding register at address from modbus device dev apply masking and write the change data.
writeregister value = (readregister value AND andMask) OR (orMask AND (NOT andMask))
dev - connected modbus device
address - address to read from.
andmask - AND mask to apply to the register
ormask - OR mask to apply to the register
serverId - address to send to (0-247). Default of 1 is used if not specified.
data - data read from the device
See also: modbus.
data =
read (dev, target, address)
¶data =
read (dev, target, address, count)
¶data =
read (dev, target, address, count, serverId, precision)
¶Read data from modbus device dev target target starting at address address.
dev - connected modbus device
target - target type to read. One of ’coils’, ’inputs’, ’inputregs’ or ’holdingregs’
address - address to start reading from.
count - number of elements to read. If not provided, count is 1.
serverId - address to send to (0-247). Default of 1 is used if not specified.
precision - Optional precision for how to interpret the read data. Currently known precision values are uint16 (default), int16, uint32, int32, uint64, uint64, single, double.
data - data read from the device
See also: modbus.
set
(obj, property,value)
¶set
(obj, property,value,…)
¶Set the properties of modbus object.
obj - instance of octave_modbus class.
property - name of property.
If property is a cell so must be value, it sets the values of all matching properties.
The function also accepts property-value pairs.
Set the stored string name of the object.
Set the timeout value.
Set the numretries value.
Set the byteorder value
Set the wordorder value
Set the userdata value
None
See also: @octave_modbus/get.
(dev, target, address, values)
¶(dev, target, address, values, serverId, precision)
¶Write data data to modbus device dev target target starting at address address.
dev - connected modbus device
target - target type to read. One of ’coils’ or ’holdingregs’
address - address to start reading from.
data - data to write.
serverId - address to send to (0-247). Default of 1 is used if not specified.
precision - Optional precision for how to interpret the write data. Currently known precision values are uint16 (default), int16, uint32, int32, uint64, uint64, single, double.
None
See also: modbus.
data =
writeRead (dev, writeAddress, values, readAddress, readcount)
¶data =
writeRead (dev, writeAddress, values, readAddress, readcount, serverId)
¶data =
writeRead (dev, writeAddress, values, writePrecision, readAddress, readCount, readPrecision)
¶Write data values to the modbus device dev holding registers starting at address writeAddress and then read readCount register values starting at address readAddress.
dev - connected modbus device
writeAddress - address to start writing to.
values - data to write to the device.
readAddress - address to start reading from.
readCount - number of elements to read.
serverId - address to send to (0-247). Default of 1 is used if not specified.
precision - Optional precision for how to interpret the read data. Currently known precision values are uint16 (default), int16, uint32, int32, uint64, uint64, single, double.
data - data read from the device
See also: modbus.
dev =
modbus ('tcpip', deviceaddress)
¶dev =
modbus ('tcpip', deviceaddress, remoteport)
¶dev =
modbus ('tcpip', deviceaddress, name, value)
¶dev =
modbus ('serialrtu', serialport)
¶dev =
modbus ('serialrtu', serialport, name, value)
¶Open modbus interface using a specified transport of ’tcpip’ or ’serialrtu’.
deviceaddress - the device ip address of type String.
remoteport - the device remote port number. If not specified, a default of 502 will be used.
name, value - Optional name value pairs for setting properties of the object.
serialport - the name of the serial port to connect to. It must be specified when transport is ’serialrtu’.
timeout value used for waiting for data
number of retries after a timeout
Additional data to attach to the object
Baudrate for the serial port
number of databits for serial port
Parity for serial port (’odd’, ’even’ or ’none’)
number of stopbits for serial port
The modbus() shall return instance of octave_modbus class as the result modbus.
The modbus object has the following public properties:
name assigned to the modbus object
instrument type ’modbus’ (readonly)
Remote port number or serial port name (readonly)
Device address if transport was ’tcpip’ (readonly)
status of the object ’open’ or ’closed’ (readonly)
timeout value used for waiting for data
number of retries after a timeout
Additional data to attach to the object
res =
fopen (obj) (dummy)
¶Opens parallel interface obj
This currently is a dummy function to improve compatibility to MATLAB
data =
fread (obj)
¶data =
fread (obj, size)
¶data =
fread (obj, size, precision)
¶[data,count] =
fread (obj, ...)
¶[data,count,errmsg] =
fread (obj, ...)
¶Reads data from parallel instrument
obj is a parallel object.
size Number of values to read. (Default: 1).
precision precision of data.
data The read data.
count values read.
errmsg read operation error message.
parallel =
parallel ([path], [direction])
¶Open Parallel interface.
path - the interface path of type String. If omitted defaults to ’/dev/parport0’.
direction - the direction of interface drivers of type Integer, see: PP_DATADIR for more info.
If omitted defaults to 1 (Input).
The parallel() shall return instance of octave_parallel class as the result parallel.
(parallel, ctrl)
¶c =
pp_ctrl (parallel)
¶Sets or Read the Control lines.
parallel - instance of octave_parallel class.
ctrl - control parameter to be set of type Byte.
If ctrl parameter is omitted, the pp_ctrl() shall return current Control lines state as the result c.
(parallel, data)
¶d =
pp_data (parallel)
¶Sets or Read the Data lines.
parallel - instance of octave_parallel class.
data - data parameter to be set of type Byte.
If data parameter is omitted, the pp_data() shall return current Data lines state as the result d.
(parallel, direction)
¶dir =
pp_datadir (parallel)
¶Controls the Data line drivers.
Normally the computer’s parallel port will drive the data lines, but for byte-wide transfers from the peripheral to the host it is useful to turn off those drivers and let the peripheral drive the signals. (If the drivers on the computer’s parallel port are left on when this happens, the port might be damaged.)
parallel - instance of octave_parallel class.
direction - direction parameter of type Integer. Supported values: 0 - the drivers are turned on
(Output/Forward direction); 1 - the drivers are turned off (Input/Reverse direction).
If direction parameter is omitted, the pp_datadir() shall return current Data direction as the result dir.
res =
fopen (obj) (dummy)
¶Opens SERIAL interface obj
This currently is a dummy function to improve compatibility to MATLAB
data =
fread (obj)
¶data =
fread (obj, size)
¶data =
fread (obj, size, precision)
¶[data,count] =
fread (obj, ...)
¶[data,count,errmsg] =
fread (obj, ...)
¶Reads data from serial instrument
obj is a serial object.
size Number of values to read. (Default: 100).
precision precision of data.
data The read data.
count values read.
errmsg read operation error message.
struct =
get (serial)
¶field =
get (serial, property)
¶Get the properties of serial object.
serial - instance of octave_serial class.
property - name of property.
When property was specified, return the value of that property.
otherwise return the values of all properties as a structure.
See also: @octave_serial/set.
set
(obj, property,value)
¶set
(obj, property,value,…)
¶Set the properties of serial object.
serial - instance of octave_serial class.
property - name of property.
If property is a cell so must be value, it sets the values of all matching properties.
The function also accepts property-value pairs.
Set the baudrate of serial port. Supported values by instrument-control: 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200 and 230400. The supported baudrate of your serial port may be different.
Set the bytesize. Supported values: 5, 6, 7 and 8.
Set the stored string name of the serial object.
Set the parity value. Supported values: Even/Odd/None. This Parameter must be of type string. It is case insensitive and can be abbreviated to the first letter only
Set the number of stopbits. Supported values: 1, 2.
Set the timeout value in tenths of a second. Value of -1 means a blocking call. Maximum value of 255 (i.e. 25.5 seconds).
Set the requesttosend (RTS) line.
Set the dataterminalready (DTR) line.
None
See also: @octave_serial/get.
(serial, baudrate)\
¶br =
srl_baudrate (serial)
¶Set new or get existing serial interface baudrate parameter. Only standard values are supported.
serial - instance of octave_serial class.
baudrate - the baudrate value used. Supported values: 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600 19200, 38400, 57600, 115200 and 230400.
If baudrate parameter is omitted, the srl_baudrate() shall return current baudrate value as the result br.
br - The currently set baudrate
This function is obsolete. Use get and set method instead.
(serial, bsize)
¶bs =
srl_bytesize (serial)
¶Set new or get existing serial interface byte size parameter.
serial - instance of octave_serial class.
bsize - byte size of type Integer. Supported values: 5/6/7/8.
If bsize parameter is omitted, the srl_bytesize() shall return current byte size value or in case of unsupported setting -1, as the result bs.
This function is obsolete. Use get and set method instead.
bs -the currently set byte size.
(serial, [q])
¶Flush the pending input/output.
serial - instance of octave_serial class.
q - queue selector of type Integer. Supported values:
flush untransmitted output
flush pending input
flush both pending input and untransmitted output.
If q parameter is omitted, the srl_flush() shall flush both, input and output buffers.
None
(serial, parity)
¶p =
srl_parity (serial)
¶Set new or get existing serial interface parity parameter. Even/Odd/None values are supported.
serial - instance of octave_serial class.
parity - parity value of type String. Supported values:
Even/Odd/None (case insensitive, can be abbreviated to the first letter only)
If parity parameter is omitted, the srl_parity() shall return current parity value as the result p.
This function is obsolete. Use get and set method instead.
p - The currently set parity
(serial, stopb)
¶sb =
srl_stopbits (serial)
¶Set new or get existing serial interface stop bits parameter. Only 1 or 2 stop bits are supported.
serial - instance of octave_serial class.
stopb - number of stop bits used. Supported values: 1, 2.
If stopb parameter is omitted, the srl_stopbits() shall return current stop bits value as the result sb.
This function is obsolete. Use get and set method instead.
(serial, timeout)
¶t =
srl_timeout (serial)
¶Set new or get existing serial interface timeout parameter used for srl_read() requests. The timeout value is specified in tenths of a second.
serial - instance of octave_serial class.
timeout - srl_read() timeout value in tenths of a second.
A value of -1 means a blocking call. Maximum value of 255 (i.e. 25.5 seconds).
If timeout parameter is omitted, the srl_timeout() shall return current timeout value as the result t.
This function is obsolete. Use get and set method instead.
serial =
serial ([path], [baudrate], [timeout])
¶Open serial interface.
path - the interface path of type String.
baudrate - the baudrate of interface. If omitted defaults to 115200.
timeout - the interface timeout value. If omitted defaults to blocking call.
The serial() shall return an instance of octave_serial class as the result serial.
The serial object has the following public properties:
name assigned to the object
instrument type ’serial’ (readonly)
OS specific port name (readonly)
status of the object ’open’ or ’closed’ (readonly)
timeout value used for waiting for data
number of bytes currently available to read (readonly)
number of stopbits to use
request to send state - ’on’ or ’off’
Parity setting ’none’, ’even’, ’odd’
Number of bits to a byte (7 or 8)
Baudrate setting
state of dataterminal ready - ’on’ or ’off’
current state of pins (readonly)
[data, count] =
srl_read (serial, n)
¶Read from serial interface.
serial - instance of octave_serial class.
n - number of bytes to attempt to read of type Integer.
The srl_read() shall return number of bytes successfully read in count as Integer and the bytes themselves in data as uint8 array.
n =
srl_write (serial, data)
¶Write data to a serial interface.
serial - instance of octave_serial class.
data - data to be written to the serial interface. Can be either of String or uint8 type.
Upon successful completion, srl_write() shall return the number of bytes written as the result n.
(serial, term)
¶(serial, readterm, writeterm)
¶Set terminator for ASCII string manipulation
serial - serialport object
term - terminal value for both read and write
readterm = terminal value type for read data
writeterm = terminal value for written data
The terminal can be either strings "cr", "lf" (default), "lf/cr" or an integer between 0 to 255.
None
See also: serialport.
data =
flush (dev)
¶data =
flush (dev, "input")
¶data =
flush (dev, "output")
¶Flush the serial port buffers
dev - connected serialport device
If an additional parameter is provided of "input" or "output", then only the input or output buffer will be flushed
None
See also: serialport.
data =
fread (obj)
¶data =
fread (obj, size)
¶data =
fread (obj, size, precision)
¶[data,count] =
fread (obj, ...)
¶[data,count,errmsg] =
fread (obj, ...)
¶Reads data from serial port instrument
obj is a serialport object.
size Number of values to read.
precision precision of data.
data The read data.
count number of values read.
errmsg read operation error message.
struct =
get (serial)
¶field =
get (serial, property)
¶Get the properties of serialport object.
serial - instance of octave_serialport class.
property - name of property.
When property was specified, return the value of that property.
otherwise return the values of all properties as a structure.
See also: @octave_serial/set.
data =
read (dev, count)
¶data =
read (dev, count, precision)
¶Read a specified number of values from a serialport using optional precision for valuesize.
dev - connected serialport device
count - number of elements to read
precision - Optional precision for the output data read data. Currently known precision values are uint8 (default), int8, uint16, int16, uint32, int32, uint64, uint64
data - data read from the device
See also: serialport.
set
(obj, property,value)
¶set
(obj, property,value,…)
¶Set the properties of serialport object.
serial - instance of octave_serialport class.
property - name of property.
If property is a cell so must be value, it sets the values of all matching properties.
The function also accepts property-value pairs.
Set the baudrate of serial port. Supported values by instrument-control: 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200 and 230400. The supported baudrate of your serial port may be different.
Set the bytesize. Supported values: 5, 6, 7 and 8.
Set the stored string name of the serial object.
Set the parity value. Supported values: Even/Odd/None. This Parameter must be of type string. It is case insensitive and can be abbreviated to the first letter only
Set the number of stopbits. Supported values: 1, 2.
Set the timeout value in tenths of a second. Value of -1 means a blocking call. Maximum value of 255 (i.e. 25.5 seconds).
Set the requesttosend (RTS) line.
Set the dataterminalready (DTR) line.
None
See also: @octave_serialport/-get.
serial =
serialport ([path], [baudrate])
¶serial =
serialport ([path], [propname, propvalue])
¶Open serial port interface.
path - the interface path of type String.
baudrate - the baudrate of interface.
propname,propvalue - property name/value pairs.
Known input properties:
Numeric baudrate value
Numeric timeout value in seconds or -1 to wait forever
number of stopbits to use
Parity setting ’none’, ’even’, ’odd’
Number of bits to a byte (5 to 8)
Number of bits to a byte ’none’, ’hardware’, ’software’
The serialport() shall return an instance of octave_serialport class as the result serial.
The serial object has the following public properties:
name assigned to the object
instrument type ’serial’ (readonly)
OS specific port name (readonly)
status of the object ’open’ or ’closed’ (readonly)
timeout value used for waiting for data
number of bytes currently available to read (readonly)
number of bytes written (readonly)
number of stopbits to use
Parity setting ’none’, ’even’, ’odd’
Number of bits to a byte (5 to 8)
Baudrate setting
Number of bits to a byte ’none’, ’hardware’, ’software’
current state of pins (readonly)
user defined data
list =
serialportlist ()
¶list =
serialportlist ("all")
¶list =
serialportlist ("available")
¶Returns a list of all serial ports detected in the system.
’all’ - show all serial ports (same as providing no arguments) ’available’ - show only serial ports that are available for use
list is a string cell array of serial ports names detected in the system.
See also: instrhwinfo("serialport").
res =
fopen (obj) (dummy)
¶Opens SPI connection obj
This currently is a dummy function to improve compatibility to MATLAB
data =
fread (obj)
¶data =
fread (obj, size)
¶data =
fread (obj, size, precision)
¶[data,count] =
fread (obj, ...)
¶[data,count,errmsg] =
fread (obj, ...)
¶Reads data from a SPI instrument
obj is a SPI object.
size Number of values to read. (Default: 10).
precision precision of data.
data data values.
count number of values read.
errmsg read operation error message.
struct =
get (spi)
¶field =
get (spi, property)
¶Get the properties of spi object.
spi - instance of octave_spi class.
property - name of property.
Name for the spi socket.
The bitrate for the spi object.
The clock polarity for the spi object of ’idlehigh’ or ’idlelow’.
The clock phase for the spi object of ’firstedge’ or ’secondedge’.
The device port name.
The device status of ’open’ or ’closed’
When property was specified, return the value of that property.
otherwise return the values of all properties as a structure.
See also: @octave_spi/set.
set
(obj, property,value)
¶set
(obj, property,value,…)
¶Set the properties of spi object.
obj - instance of octave_spi class.
property - name of property.
If property is a cell so must be value, it sets the values of all matching properties.
The function also accepts property-value pairs.
Set the name for the spi socket.
Set the bitrate for the spi object.
Set the clock polarity for the spi object of ’idlehigh’ or ’idlelow’.
Set the clock phase for the spi object of ’firstedge’ or ’secondedge’.
None
See also: @octave_spi/get.
spi =
spi ([port_path])
¶spi =
spi ([port_path], [propname, propvalue])
¶Open a spi interface.
port_path - the interface device port/path of type String. If omitted defaults to
’/dev/spi-0’.
propname,propvalue - property name/value pairs.
Known input properties:
Name of the object
Numeric bitrate value
Clock polarity: idlehigh or idlelow.
Clock phase value: firstedge or secondedge
spi - An instance of octave_spi class.
The spi object has the following properties:
Name of the object
Open or closed status of object (readonly).
Numeric bitrate value
Clock polarity: idlehigh or idlelow.
Clock phase value: firstedge or secondedge
The interface driver port (readonly)
[data, count] =
spi_read (spi, n)
¶Read from spi slave device.
spi - instance of octave_spi class.
n - number of bytes to attempt to read of type Integer.
The spi_read() shall return number of bytes successfully read in count as Integer and the bytes themselves in data as uint8 array.
rddata =
spi_writeAndRead (spi, wrdata)
¶Write data to a spi slave device and then read same number of values.
spi - instance of octave_spi class.
wrdata - data, of type uint8, to be written to the slave device.
Upon successful completion, spi_writeAndRead() shall return the bytes read.
data =
flush (dev)
¶data =
flush (dev, "input")
¶data =
flush (dev, "output")
¶Flush the tcp socket buffers
dev - connected tcp device
If an additional parameter is provided of "input" or "output", then only the input or output buffer will be flushed
None
See also: serialport.
res =
fopen (obj) (dummy)
¶Opens TCP connection obj
This currently is a dummy function to improve compatibility to MATLAB
data =
fread (obj)
¶data =
fread (obj, size)
¶data =
fread (obj, size, precision)
¶[data,count] =
fread (obj, ...)
¶[data,count,errmsg] =
fread (obj, ...)
¶Reads data from TCP instrument
obj is a TCP object.
size Number of values to read. (Default: 100).
precision precision of data.
data data read.
count values read.
errmsg read operation error message.
struct =
get (tcp)
¶field =
get (tcp, property)
¶Get the properties of tcp object.
tcp - instance of octave_tcp class.
property - name of property.
When property was specified, return the value of that property.
otherwise return the values of all properties as a structure.
See also: @octave_tcp/set.
set
(obj, property,value)
¶set
(obj, property,value,…)
¶Set the properties of tcp object.
If property is a cell so must be value, it sets the values of all matching properties.
The function also accepts property-value pairs.
Set the name for the tcp socket.
Set the remote host name for the tcp socket.
Set the remote port for the tcp socket.
Set the timeout value in seconds. Value of -1 means a blocking call.
None
See also: @octave_tcp/get.
tcp =
tcp ()
¶tcp =
tcp (ipaddress)
¶tcp =
tcp (ipaddress, port)
¶tcp =
tcp (ipaddress, port, timeout)
¶tcp =
tcp (ipaddress, [propertyname, propertyvalue])
¶tcp =
tcp (ipaddress, port, [propertyname, propertyvalue])
¶Open tcp interface.
ipaddress - the ip address of type String. If omitted defaults to ’127.0.0.1’.
port - the port number to connect. If omitted defaults to 23.
timeout - the interface timeout value. If omitted defaults to blocking call.
propname,propvalue - property name/value pairs.
Known input properties:
name value
Numeric timeout value or -1 to wait forever
The tcp() shall return instance of octave_tcp class as the result tcp.
The tcp object has the following public properties:
name assigned to the tcp object
instrument type ’tcp’ (readonly)
local port number (readonly)
remote port number
remote host
status of the object ’open’ or ’closed’ (readonly)
timeout value in seconds used for waiting for data
number of bytes currently available to read (readonly)
[data, count] =
tcp_read (tcp, n, timeout)
¶Read from tcp interface.
tcp - instance of octave_tcp class.
n - number of bytes to attempt to read of type Integer
timeout - timeout in ms if different from default of type Integer
count - number of bytes successfully read as an Integer
data - data bytes themselves as uint8 array.
(tcp, timeout)
¶t =
tcp_timeout (tcp)
¶Set new or get existing tcp interface timeout parameter used for tcp_read() requests. The timeout value is specified in milliseconds.
tcp - instance of octave_tcp class.
timeout - tcp_read() timeout value in milliseconds. Value of -1 means a blocking call.
If timeout parameter is omitted, the tcp_timeout() shall return current timeout value as the result t.
n =
tcp_write (tcp, data)
¶Write data to a tcp interface.
tcp - instance of octave_tcp class.
data - data to be written to the tcp interface. Can be either of String or uint8 type.
Upon successful completion, tcp_write() shall return the number of bytes written as the result n.
tcp =
tcpip (host, [port], [PropertyName, PropertyValue...])
¶Matlab compatible wrapper to the tcp interface.
NOTE: tcpip has been deprecated. Use tcpclient instead
host - the host name or ip.
port - the port number to connect. If omitted defaults to 80.
PropertyName, PropertyValue - Optional property name, value pairs to set on the tcp object.
Currently the only known properties are "timeout" and "name".
tcpip will return an instance of octave_tcp class as the result.
(tcp, term)
¶(tcp, readterm, writeterm)
¶Set terminator on a tcpclient object for ASCII string manipulation
tcp - tcpclient object
term - terminal value for both read and write
readterm = terminal value type for read data
writeterm = terminal value for written data
The terminal can be either strings "cr", "lf" (default), "lf/cr" or an integer between 0 to 255.
None
See also: tcpport.
data =
flush (dev)
¶data =
flush (dev, "input")
¶data =
flush (dev, "output")
¶Flush the tcpclient socket buffers
dev - connected tcpclient device
If an additional parameter is provided of "input" or "output", then only the input or output buffer will be flushed
None
See also: serialport.
struct =
get (tcpclient)
¶field =
get (tcpclient, property)
¶Get the properties of tcpclient object.
tcpclient - instance of octave_tcpclient class.
property - name of property.
When property was specified, return the value of that property.
otherwise return the values of all properties as a structure.
See also: @octave_tcpclient/set.
data =
read (obj)
¶data =
read (obj, size)
¶data =
read (obj, size, datatype)
¶Reads data from TCP instrument
obj is a TCP object.
size Number of values to read. (Default: NumBytesAvailable).
datatype datatype of data.
data data read.
set
(obj, property,value)
¶set
(obj, property,value,…)
¶Set the properties of tcpclient object.
If property is a cell so must be value, it sets the values of all matching properties.
The function also accepts property-value pairs.
Set the name for the tcpclient socket.
Set user data for the tcpclient socket.
Set the timeout value in seconds. Value of -1 means a blocking call.
None
See also: @octave_tcpclient/get.
tcpclient =
tcpclient (ipaddress, port)
¶tcpclient =
tcpclient (ipaddress, port, [propertyname, propertyvalue])
¶Open tcpclient interface.
ipaddress - the ip address of type String.
port - the port number to connect.
propname,propvalue - property name/value pairs.
Known input properties:
name value
Numeric timeout value or -1 to wait forever
Boolean to enable or disable the nagle algorithm for delay transfer.
User data value.
The tcpclient() shall return instance of octave_tcpclient class as the result tcpclient.
The tcpclient object has the following public properties:
name assigned to the tcpclient object
instrument type ’tcpclient’ (readonly)
remote port number (Readonly)
remote host address (Readonly)
status of the object ’open’ or ’closed’ (readonly)
timeout value in seconds used for waiting for data
number of bytes currently available to read (readonly)
number of bytes currently available to read (readonly)
Byte order for data (currently not used)
Terminator value used for string data (currently not used)
User data
Bool for whether transfer delay is enabled. (Read only)
(tcp, term)
¶(tcp, readterm, writeterm)
¶Set terminator on a tcpserver object for ASCII string manipulation
tcp - tcpserver object
term - terminal value for both read and write
readterm = terminal value type for read data
writeterm = terminal value for written data
The terminal can be either strings "cr", "lf" (default), "lf/cr" or an integer between 0 to 255.
None
See also: tcpport.
data =
flush (dev)
¶data =
flush (dev, "input")
¶data =
flush (dev, "output")
¶Flush the tcpserver socket buffers
dev - connected tcpserver device
If an additional parameter is provided of "input" or "output", then only the input or output buffer will be flushed
None
See also: serialport.
struct =
get (tcpserver)
¶field =
get (tcpserver, property)
¶Get the properties of tcpserver object.
tcpserver - instance of octave_tcpserver class.
property - name of property.
When property was specified, return the value of that property.
otherwise return the values of all properties as a structure.
See also: @octave_tcpserver/set.
data =
read (obj)
¶data =
read (obj, size)
¶data =
read (obj, size, datatype)
¶Reads data from TCP instrument
obj is a TCP Server object.
size Number of values to read. (Default: NumBytesAvailable).
datatype datatype of data.
data data read.
set
(obj, property,value)
¶set
(obj, property,value,…)
¶Set the properties of tcpserver object.
If property is a cell so must be value, it sets the values of all matching properties.
The function also accepts property-value pairs.
Set the name for the tcpserver socket.
Set user data for the tcpserver socket.
Set the timeout value in seconds. Value of -1 means a blocking call.
None
See also: @octave_tcpserver/get.
tcpserver =
tcpserver (ipaddress, port)
¶tcpserver =
tcpserver (port)
¶tcpserver =
tcpserver (…, [propertyname, propertyvalue])
¶Open tcpserver interface.
ipaddress - the ip address of type String.
port - the port number to bind.
propname,propvalue - property name/value pairs.
Known input properties:
name value
Numeric timeout value or -1 to wait forever
User data value.
The tcpserver() shall return instance of octave_tcpserver class as the result tcpserver.
The tcpserver object has the following public properties:
boolean flag for when connected to a client (Readonly)
connected client port number (Readonly)
connected client address (Readonly)
name assigned to the tcpserver object
instrument type ’tcpserver’ (readonly)
server port number (Readonly)
server address (Readonly)
status of the object ’open’ or ’closed’ (readonly)
timeout value in seconds used for waiting for data
number of bytes currently available to read (readonly)
number of bytes currently available to read (readonly)
Byte order for data (currently not used)
Terminator value used for string data (currently not used)
User data
res =
fopen (obj) (dummy)
¶Opens UDP connection obj This currently is a dummy function to improve compatibility to MATLAB
data =
fread (obj)
¶data =
fread (obj, size)
¶data =
fread (obj, size, precision)
¶[data,count] =
fread (obj, ...)
¶[data,count,errmsg] =
fread (obj, ...)
¶Reads data from UDP instrument
obj is a UDP object.
size Number of values to read. (Default: 100).
precision precision of data.
data data values.
count number of values read.
errmsg read operation error message.
struct =
get (udp)
¶field =
get (udp, property)
¶Get the properties of udp object.
udp - instance of octave_udp class.
property - name of property.
When property was specified, return the value of that property.
otherwise return the values of all properties as a structure.
See also: @octave_udp/set.
set
(obj, property,value)
¶set
(obj, property,value,…)
¶Set the properties of udp object.
obj - instance of octave_udp class.
property - name of property.
If property is a cell so must be value, it sets the values of all matching properties.
The function also accepts property-value pairs.
Set the name for the udp socket.
Set the remote host name for the udp socket.
Set the remote port for the udp socket.
Set the timeout value in seconds. Value of -1 means a blocking call.
None
See also: @octave_udp/get.
numbytes =
write (obj, data)
¶numbytes =
write (obj, data, destinationAddress, destinationPort))
¶numbytes =
write (obj, data, datatype)
¶numbytes =
write (obj, data, datatype, destinationAddress, destinationPort)
¶Writes data to UDP instrument
obj is a UDP object.
data data to write.
datatype datatype of data. If not specified defaults to uint8.
destinationAddress ipaddress to send to. If not specified, use the remote address.
destinationPort port to send to. If not specified, use the remote port.
returns number of bytes written.
udp =
udp ()
¶udp =
udp (remoteipaddress, remoteport)
¶udp =
udp (remoteipaddress, remoteport, [propertyname, propertyvalue ...])
¶Open udp interface.
remoteipaddress - the ip address of type String. If omitted defaults to ’127.0.0.1’.
remoteport - the port number to connect. If omitted defaults to 23.
localport - the local port number to bind. If omitted defaults to 0
propertyname, propertyvalue - property name/value pair
The udp() shall return instance of octave_udp class as the result udp.
The udp object has the following public properties:
name assigned to the udp object
instrument type ’udp’ (readonly)
local port number (readonly)
local host address (readonly)
remote port number
remote host
status of the object ’open’ or ’closed’ (readonly)
timeout value in seconds used for waiting for data
number of bytes currently available to read (readonly)
result =
udp_demo ()
¶Run test SNTP demonstration for udp class
See also: udp.
[data, count] =
udp_read (udp, n, timeout)
¶Read from udp interface.
udp - instance of octave_udp class.
n - number of bytes to attempt to read of type Integer
timeout - timeout in ms if different from default of type Integer
The udp_read() shall return number of bytes successfully read in count as Integer and the bytes themselves in data as uint8 array.
(udp, timeout)
¶t =
udp_timeout (udp)
¶Set new or get existing udp interface timeout parameter used for udp_read() requests. The timeout value is specified in milliseconds.
udp - instance of octave_udp class.
timeout - udp_read() timeout value in milliseconds. Value of -1 means a blocking call.
If timeout parameter is omitted, the udp_timeout() shall return current timeout value as the result t.
n =
udp_write (udp, data)
¶Write data to a udp interface.
udp - instance of octave_udp class.
data - data to be written to the udp interface. Can be either of String or uint8 type.
Upon successful completion, udp_write() shall return the number of bytes written as the result n.
(udp, term)
¶(udp, readterm, writeterm)
¶Set terminator for ASCII string manipulation
udp - udpport object
term - terminal value for both read and write
readterm = terminal value type for read data
writeterm = terminal value for written data
The terminal can be either strings "cr", "lf" (default), "lf/cr" or an integer between 0 to 255.
None
See also: udpport.
data =
flush (dev)
¶data =
flush (dev, "input")
¶data =
flush (dev, "output")
¶Flush the udpport socket buffers
dev - open udpport device
If an additional parameter is provided of "input" or "output", then only the input or output buffer will be flushed
None
See also: udpport.
data =
fread (obj)
¶data =
fread (obj, size)
¶data =
fread (obj, size, precision)
¶[data,count] =
fread (obj, ...)
¶[data,count,errmsg] =
fread (obj, ...)
¶Reads data from UDP instrument
obj is a UDP port object.
size Number of values to read. (Default: 100).
precision precision of data.
data data values.
count number of values read.
errmsg read operation error message.
struct =
get (udpport)
¶field =
get (udpport, property)
¶Get the properties of udpport object.
udpport - instance of octave_udpport class.
property - name of property.
When property was specified, return the value of that property.
otherwise return the values of all properties as a structure.
See also: @octave_udpport/set.
set
(obj, property,value)
¶set
(obj, property,value,…)
¶Set the properties of udpport object.
obj - instance of octave_udpport class.
property - name of property.
If property is a cell so must be value, it sets the values of all matching properties.
The function also accepts property-value pairs.
Set the name for the udpport socket.
Set the user data of the object.
Set the timeout value in seconds. Value of -1 means a blocking call.
None
See also: @octave_udpport/get.
numbytes =
write (obj, data)
¶numbytes =
write (obj, data, destinationAddress, destinationPort))
¶numbytes =
write (obj, data, datatype)
¶numbytes =
write (obj, data, datatype, destinationAddress, destinationPort)
¶Writes data to UDP instrument
obj is a UDPPort object.
data data to write.
datatype datatype of data. If not specified defaults to uint8.
destinationAddress ipaddress to send to. If not specified, use the previously used remote address.
destinationPort port to send to. If not specified, use the remote port.
returns number of bytes written.
(dev, data)
¶(dev, data, destaddr, destport)
¶Write data to a udpport including terminator value
dev - connected device
data - ASCII data to write
destaddr - Destination address
destport - Destination port
Where the address and port is not specified, the previously used address and port is used.
None
See also: flushoutput.
udp =
udpport ()
¶udp =
udpport (propertyname, propertyvalue ...)
¶Open udpport interface.
propertyname, propertyvalue - property name/value pair
Known input properties:
name assigned to the udp object
local port number
local host address
timeout value in seconds used for waiting for data
Boolean if the socket has port sharing enabled (readonly)
The udpport() shall return instance of octave_udp class as the result udp.
The udp object has the following public properties:
name assigned to the udp object
instrument type ’udpport’ (readonly)
local port number (readonly)
local host address (readonly)
status of the object ’open’ or ’closed’ (readonly)
timeout value in seconds used for waiting for data
number of bytes currently available to read (readonly)
multicast group socket is subscribed to (readonly)
Boolean if the socket has any multicast group it is subscribed to (readonly)
Boolean if the socket has port sharing enabled (readonly)
Terminator value used for string data (currently not used)
res =
fopen (obj) (dummy)
¶Opens USBTMC connection obj This currently is a dummy function to improve compatibility to MATLAB
data =
fread (obj)
¶data =
fread (obj, size)
¶data =
fread (obj, size, precision)
¶[data,count] =
fread (obj, ...)
¶[data,count,errmsg] =
fread (obj, ...)
¶Reads data from usbtmc instrument
obj is a usbtmc object.
size Number of values to read. (Default: 100).
precision precision of data.
data The read data.
count values read.
errmsg read operation error message.
[data, count] =
usbtmc_read (usbtmc, n)
¶Read from usbtmc slave device.
usbtmc - instance of octave_usbtmc class.
n - number of bytes to attempt to read of type Integer.
count - the number of bytes successfully read as an Integer.
data - the read bytes as a uint8 array.
n =
usbtmc_write (usbtmc, data)
¶Write data to a usbtmc slave device.
usbtmc - instance of octave_usbtmc class.
data - data, of type uint8, to be written to the slave device.
Upon successful completion, usbtmc_write() shall return the number of bytes written as the result n.
res =
fopen (obj) (dummy)
¶Opens VXI11 connection obj This currently is a dummy function to improve compatibility to MATLAB
data =
fread (obj)
¶data =
fread (obj, size)
¶data =
fread (obj, size, precision)
¶[data,count] =
fread (obj, ...)
¶[data,count,errmsg] =
fread (obj, ...)
¶Reads data from vxi11 instrument
obj is a vxi11 object.
size Number of values to read. (Default: 100).
precision precision of data.
data The read data.
count values read.
errmsg read operation error message.
vxi11 =
vxi11 (ip,instr)
¶Open vxi11 interface.
ip - the ip address of type String. If omitted defaults to ’127.0.0.1’. instr - the instrument name of type String. If omitted defaults to ’inst0’.
The vxi11() shall return instance of octave_vxi11 class as the result vxi11.
(vxi11)
¶Close the interface and release a file descriptor.
vxi11 - instance of octave_vxi11 class.
[data, count] =
vxi11_read (vxi11, n)
¶Read from vxi11 slave device.
vxi11 - instance of octave_vxi11 class.
n - number of bytes to attempt to read of type Integer.
The vxi11_read() shall return number of bytes successfully read in count as Integer and the bytes themselves in data as uint8 array.
n =
vxi11_write (vxi11, data)
¶Write data to a vxi11 slave device.
vxi11 - instance of octave_vxi11 class.
data - data to be written to the slave device. Can be either of String or uint8 type.
Upon successful completion, vxi11_write() shall return the number of bytes written as the result n.
Copyright © 2007 Free Software Foundation, Inc. http://fsf.org/ Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program—to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers’ and authors’ protection, the GPL clearly explains that there is no warranty for this free software. For both users’ and authors’ sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users’ freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work’s System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work’s users, your or third parties’ legal rights to forbid circumvention of technological measures.
You may convey verbatim copies of the Program’s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation’s users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party’s predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor’s “contributor version”.
A contributor’s “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor’s essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient’s use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy’s public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
one line to give the program's name and a brief idea of what it does. Copyright (C) year name of author This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
program Copyright (C) year name of author This program comes with ABSOLUTELY NO WARRANTY; for details type ‘show w’. This is free software, and you are welcome to redistribute it under certain conditions; type ‘show c’ for details.
The hypothetical commands ‘show w’ and ‘show c’ should show the appropriate parts of the General Public License. Of course, your program’s commands might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see http://www.gnu.org/licenses/.
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read http://www.gnu.org/philosophy/why-not-lgpl.html.
Jump to: | B C F G I L M O P R S T U V W |
---|
Jump to: | B C F G I L M O P R S T U V W |
---|