Tag Status and Manipulation
About the Tag Status and Manipulation Methods
The tag status and manipulation methods are used to read in values of the COF (Control Object File) file's tags or write values to the tags themselves.
Tag Status Methods
Tag Manipulation Methods
GetTagVal
Returns the value of a specified parameter tag. Because parameter tags point to a parameter input or output, GetTagVal provides a means of determining the current value of a parameter. It can be used with all parameter types and returns a single floating point value.
float GetTagVal(string Name)
Arguments:
Returns:
Reads value of tag labeled 'RMS' and saves it to the variable rms.
rms = RP.GetTagVal('RMS'); % Reads rms level
rms = RP.GetTagVal('RMS') # Reads rms level
See also: Band-limited Noise, Continuous Play, Continuous Acquire, and Two Channel Continuous Acquire in the ActiveX examples.
GetTagType
Determines the data type of a parameter tag.
int GetTagType(string Name)
Arguments:
Returns:
Finds the data type of a particular parameter tag.
DataType = char(RP.GetTagType('RAMBuffer'));
See also: Device Checker in the ActiveX examples.
GetTagSize
Returns the maximum number of data points accessible through the parameter tag.
int GetTagSize(string Name)
Arguments:
Returns:
Returns the number of points in the ram buffer.
Tagsize = RP.GetTagSize('RAMBuffer');
See also: Device Checker in the ActiveX examples.
ReadTag
Reads data from the processor device's memory into variables stored on the PC. ReadTagV should be used with MATLAB. Other programming languages should use ReadTag. See ReadTagVEX for alternative ways to read data.
ReadTag can be used with any component that has a data buffer, such as: RamBuffer, LongDynDel, FIR and so forth.
int ReadTag(string Name, float[] pBuf, int nOS, int nWords);
Arguments:
Returns:
Reads 1000 points from a buffer (parameter tag labeled "datain") and stores it in a single array file (data).
Reads 1000 points from parameter tag labeled 'datain' to floating point array called data.
data = RP.ReadTag('datain', 0, 1000)
ReadTagV
Reads variables stored in the processor device's memory into a PC buffer in variant format. ReadTagV should be used with MATLAB. Other programming languages should use ReadTag. See ReadTagVEX for alternative storage methods.
ReadTagV can be used with any component that has a data buffer, such as: RamBuffer, LongDynDel, FIR and so forth.
array ReadTagV(string Name, int nOS, int nWords);
Arguments:
Returns:
Reads 1000 points from a buffer (parameter tag 'datain') and stores it in an array file (Data_A) as variant values.
Data_A = RP.ReadTagV('datain',0,1000);
See also: Continuous Acquire in the ActiveX examples.
ReadTagVEX
Reads data that has been written to a parameter tag and stored on the processor device. Data can be converted to one of five data formats (double, float, 32-, 16-, 8-bit Integer) and stored as either an array or a matrix. The user must specify the storage format of the data to be read (F32, 32-, 16-, or 8-bit Integer) and the number of channels.
When used to read compressed or shuffled data ReadTagVEX handles data manipulation and storage. Shuffled data is separated into channels and stored in a matrix. The nWords argument must be set to the number of samples in the serial buffer and is used along with nchannels to unshuffle or expand the data. For compressed data nWords must be set to the number of points after compression. e.g. If the data is compressed two-folded then only 500 samples of a 1000 point signal are contained in the serial buffer and nWords should be set to 500 (for a compression of 4 the number of points in the buffer would be 250).
ReadTagVEX is used with components that have a data Buffer, including: RamBuffer, Serial Buffer, Average Buffer, LongDelay, LongDynDelay, ShortDelay, ShortDynDelay, Biquad, IIR, FIR, HrtfFir.
Note: ReadTagVEX and WriteTagVEX are the only read/write commands that will work in languages other than MATLAB and Python
array ReadTagVEX(string Name, int nOS, int nWords, string stype, string dtype, int nchannels);
Arguments:
Returns:
MATLAB
Reads 1000 points from a processor device buffer (either compressed or Standard format) and stores it in an array of 1000 points in double format.
Data_A=RP.ReadTagVEX('datain',0,1000,'I16','F64',1);
Reads 1000 points from a processor device buffer that contains a shuffled data set (2-channels) and stores it in a matrix (2,500) in double format.
Data_A=RP.ReadTagVEX('datain',0,500,'I16','F64',2);
Reads 1000 points from a processor device buffer that contains a shuffled data set (2-channels) and stores it in a matrix (2,500) in 16-bit integer format.
Data_A=RP.ReadTagVEX("datain",0,500,"I16","I16",2)
See also: Two Channel Continuous Acquire in the ActiveX examples.
SetTagVal
Sets the value of the specified parameter tag.
int SetTagVal(string Name, float Val)
Arguments:
Returns:
Sets the parameter Tag value to that of the variable "rms".
rms=5.0
e1=RP.SetTagVal('RMS', rms); % Set RMS Level
rms = 5.0
e1 = RP.SetTagVal('RMS', rms) # Set RMS Level
See also: Band-limited Noise in the ActiveX examples.
WriteTag
Writes data from the PC to a memory buffer pointed to by a parameter tag. WriteTagV should be used with MATLAB. Other programming languages should use WriteTag. See WriteTagVEX for alternative methods of writing data.
WriteTag is used with the following components that have a data Buffer: RamBuffer, Serial Buffer, Average Buffer, LongDelay, LongDynDelay, ShortDelay, ShortDynDelay, Biquad, IIR,FIR, HrtfFir.
int WriteTag(string Name, float[] pBuf, int nOS, int nWords);
Arguments:
Returns:
Writes 1000 points from an array named 'data' to a memory buffer on the processor device (parameter tag labeled 'datain').
# data holds the values to load
RP.WriteTag('datain', data, 0, 1000)
WriteTagV
Writes variables from the PC to a memory buffer on the processor device. WriteTagV should be used with MATLAB. Other programming languages should use WriteTag. WriteTagV is designed to take data in a standard MATLAB row vector. Column vectors should be transposed.
WriteTagV is used with the following components that have a data Buffer: RamBuffer, Serial Buffer, Average Buffer, LongDelay, LongDynDelay, ShortDelay, ShortDynDelay, Biquad, IIR,FIR, HrtfFir.
Note: WriteTagV is to be used in Matlab only with data type double. Attempting to write vectors of any other type will fail and return a zero.
See WriteTagVEX for alternative methods of writing vectors of all other data types.
int WriteTagV(string Name, int nOS, Variant &buffer);
Arguments:
Returns:
MATLAB
Writes 10000 points from an array (data) to a memory buffer on a processor device (pointed to by the parameter tag (datain)).
e1=RP.WriteTagV('datain', 0, data(1000:11000));
Writes 1000 points from an array (data) to a memory buffer on a processor device (pointed to by the parameter tag (datain)).
e1=RP.WriteTagV('datain', 0, data(0:1000));
See also: Continuous Play in the ActiveX examples.
WriteTagVEX
WriteTagVEX writes data stored in array or matrix format to a memory buffer on the processor device. The data format for storage in the memory buffer can be one of the following: 32-bit Float, 32-,16-, and 8-bit Integer formats. In addition, data is not limited to a single array format. The organization of variables stored in a matrix is preserved.
WriteTagVEX is used with the following components that have a data Buffer: RamBuffer, Serial Buffer, Average Buffer, LongDelay, LongDynDelay, ShortDelay, ShortDynDelay, Biquad, IIR, FIR, and HrtfFir.
Note: ReadTagVEX and WriteTagVEX are the only read/write commands that will work in languages other than MATLAB and Python
int WriteTagVEX(string Name, int nOS, string dtype, Variant &buffer);
Arguments:
Returns:
MATLAB
Writes 10000 points from an array to a memory buffer on a processor device in floating point format.
e1=RP.WriteTagVEX('datain', 0, 'F32', data(1000:11000));
Writes 2000 points from a matrix (data) to a memory buffer on the processor device (pointed to by the parameter tag (datain) in integer format (16-bit).
e1=RP.WriteTagVEX('datain', 0, 'I16', data(1:2,1:1000));
See also: Two Channel Continuous Play in the ActiveX examples.
ZeroTag
Sets a parameter tag value to zero. When the parameter tag points to a memory buffer, all values in the buffer are set to zero.
int ZeroTag(string Name);
Arguments:
Returns:
Sets membuf values to zero.
error1=RP.ZeroTag('membuf')