Should be initialized as MATLAB package with name +intan
.
This repo contains code for running the Intan RHX interface via TCP.
git submodule add git@github.com:Neuro-Mechatronics-Interfaces/matlab_package__intan.git +intan
The +intan
package includes the following functions:
char5ReadFromArray
: Reads 5-character arrays from data streams.computeBytesPerBlock
: Calculates the number of bytes per data block.createLineCopy
: Duplicates line objects for plotting.enableAudio
: Activates audio channels.enableDigIn
: Enables digital input channels.enablePortChannelBatch
: Batch enables port channels.handleIndexUpdatingCallback
: Manages index update callbacks.handleWaveformBytesCallback
: Processes waveform byte callbacks.initWaveformBytesGraphicsHandles
: Initializes graphics handles for waveform bytes.int32ReadFromArray
: Reads 32-bit integers from data arrays.readWaveformByteBlock
: Reads blocks of waveform bytes.resetTriggerAxes
: Resets axes for trigger plots.setAnalogTCP
: Configures analog settings via TCP.setChannelTCP
: Sets channel parameters via TCP.setDigitalTCP
: Configures digital settings via TCP.setFile
: Specifies file settings.setFileSavePeriod
: Sets the file save interval.startRecording
: Initiates data recording.startRunning
: Starts the system running.stopRecording
: Stops data recording.stopRunning
: Stops the system running.uint16ReadFromArray
: Reads 16-bit unsigned integers from data arrays.uint32ReadFromArray
: Reads 32-bit unsigned integers from data arrays.uint8ReadFromArray
: Reads 8-bit unsigned integers from data arrays.
After adding the +intan package to your MATLAB path, you can utilize its functions to control the Intan RHX interface.
All instructions assume you have already launched RHX
application and created the corresponding control websocket in the network interface.
For example, to start recording data:
intanTcpClient = tcpclient("127.0.0.1", 5000); % Control interface
waveformTcpClient = tcpclient("127.0.0.1", 5001); % Waveform interface
intan.setChannelTCP(intanTcpClient, 'a', 1:128, false, true, false, false); % Enables HPF channels 1-128 on port "A".
intan.startRunning(intanTcpClient); % Starts running (not recording) the interface
[data, timestamp] = intan.readWaveformByteBlock(waveformTcpClient, 128, 0, false);
Refer to the individual function documentation for detailed usage instructions.
Ensure that your system meets the necessary requirements for TCP/IP communication with the Intan RHX interface. Proper configuration of network settings may be required.
For additional resources and related MATLAB packages, visit the Neuro-Mechatronics Lab's GitHub page.