Opticka 2.16.1
Opticka is an experiment manager for behavioral research.
Loading...
Searching...
No Matches
labJackT Class Reference

LABJACKT Connects and manages a LabJack T4 / T7 This class handles digital I/O and analog I/O and analog streaming. Connection can be USB or network. Network is slightly lower latency than USB. More...

Detailed Description

LABJACKT Connects and manages a LabJack T4 / T7 This class handles digital I/O and analog I/O and analog streaming. Connection can be USB or network. Network is slightly lower latency than USB.

Example:

l = labJackT('openNow', true);
l.sendStrobe(128); % sends 128 via EIO 8 bits
l.close;
LABJACKT Connects and manages a LabJack T4 / T7 This class handles digital I/O and analog I/O and ana...
Definition labJackT.m:17

Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md

Inheritance diagram for labJackT:

Public Member Functions

function labJackT (in varargin)
 Class constructor.
 
function open (in me, in serial)
 Open the LabJack device.
 
function close (in me)
 Close the LabJack device void LJUSB_CloseDevice(HANDLE hDevice); //Closes the handle of a LabJack USB device.
 
function reset (in me)
 
function listAll (in me)
 
function isServerRunning (in me)
 check if lua code is running
 
function isHandleValid (in me)
 
function sendStrobe (in me, in value)
 sends a value to RAMAddress, requires the Lua server to be running, 0-2047 controls EIO0-8 & CIO0-3 - 2048 TTLs CIO-4
 
function sendStrobedEIO (in me, in value)
 
function sendStrobedCIO (in me, in value)
 
function setFIO (in me, in line, in value, in direction)
 
function sendTTL (in me, in fio, in value)
 
function getAIN (in me, in channels)
 setAIO setAIO sets the value for FIO,
 
function startStream (in me)
 startStream
 
function stopStream (in me)
 stopStream
 
function plotStream (in me, in timeL, in updateN)
 plotStream This plots the last X seconds worth of Analog data (AIN 0-3)
 
function closeHandler (in src, in evnt)
 
function initialiseServer (in me)
 upload the Lua server to the LabJack and start it
 
function stopServer (in me)
 upload the Lua server to the LabJack and start it
 
function get fullName (in me)
 concatenate the name with a uuid at get.
 
function resetStrobe (in me, in varargin)
 
function startRecording (in me, in varargin)
 
function resumeRecording (in me, in varargin)
 
function pauseRecording (in me, in varargin)
 
function stopRecording (in me, in varargin)
 
function rstop (in me, in varargin)
 
function startFixation (in me, in varargin)
 
function prepareStrobe (in me, in value)
 LEGACY Command - create a command to strobe EIO 0-255 ONLY.
 
function strobeWord (in me)
 LEGACY Command - create a command to strobe EIO 0-255 ONLY.
 
function strobeServer (in me, in value)
 LEGACY - use sendStrobe.
 
function endStimulus (in me)
 
function correct (in me)
 
function incorrect (in me)
 
function breakFixation (in me)
 
function test (in me)
 
function testAIN (in me, in channels)
 

Public Attributes

Property name
 friendly object name, setting this to 'null' will force silentMode=1
 
Property deviceID
 what LabJack device to use; 4 = T4, 7 = T7
 
Property device
 if more than one labJack connected, which one to open? Default is first device
 
Property connectType
 Connection type: ANY, USB, TCP, ETHERNET, WIFI.
 
Property IP
 IP address if using network.
 
Property strobeTime
 strobeTime is time of strobe in ms; max = 100ms
 
Property streamChannels
 streamChannels which channels to stream
 
Property streamSampleRate
 stream sample rate (Hz)
 
Property streamSamples
 number of stream samples to collect in each read
 
Property streamResolution
 resolution of the stream 0-5 for T4, 0 is default (=1), 5 being best/slowest
 
Property timeOut
 timeout for communication in ms
 
Property header
 header needed by loadlib
 
Property library
 the library itself
 
Property verbose
 do we log everything to the command window?
 
Property openNow
 allows the constructor to run the open method immediately
 
Property silentMode
 silentMode=true allows one to gracefully fail methods without a labJack connected
 
Property comment
 comment
 
Property winLibrary
 
Property winHeader
 

Constructor & Destructor Documentation

◆ labJackT()

function labJackT::labJackT ( in  varargin)

Class constructor.

We use parseArgs to parse allowed properties on construction and also switch into silent mode and/or auto open the labjack connection.

Parameters
vararginare passed as a structure of properties which is parsed.
Returns
instance of labJack class.

Member Function Documentation

◆ breakFixation()

function labJackT::breakFixation ( in  me)
Parameters
<br>

◆ close()

function labJackT::close ( in  me)

Close the LabJack device void LJUSB_CloseDevice(HANDLE hDevice); //Closes the handle of a LabJack USB device.

◆ closeHandler()

function labJackT::closeHandler ( in  src,
in  evnt 
)

◆ correct()

function labJackT::correct ( in  me)
Parameters
<br>

◆ endStimulus()

function labJackT::endStimulus ( in  me)
Parameters
<br>

◆ fullName()

function get labJackT::fullName ( in  me)

concatenate the name with a uuid at get.

Parameters

return name the concatenated name

◆ getAIN()

function labJackT::getAIN ( in  me,
in  channels 
)

setAIO setAIO sets the value for FIO,

Parameters
channelsAIN channels 0-3
Returns
out voltages

◆ incorrect()

function labJackT::incorrect ( in  me)
Parameters
<br>

◆ initialiseServer()

function labJackT::initialiseServer ( in  me)

upload the Lua server to the LabJack and start it

◆ isHandleValid()

function labJackT::isHandleValid ( in  me)

◆ isServerRunning()

function labJackT::isServerRunning ( in  me)

check if lua code is running

◆ listAll()

function labJackT::listAll ( in  me)

◆ open()

function labJackT::open ( in  me,
in  serial 
)

Open the LabJack device.

Open the LabJack device

◆ pauseRecording()

function labJackT::pauseRecording ( in  me,
in  varargin 
)
Parameters
<br>

◆ plotStream()

function labJackT::plotStream ( in  me,
in  timeL,
in  updateN 
)

plotStream This plots the last X seconds worth of Analog data (AIN 0-3)

Parameters
timeL- time in seconds to record
updateN- refresh plot every N loops (too many refreshes slows down recording)

◆ prepareStrobe()

function labJackT::prepareStrobe ( in  me,
in  value 
)

LEGACY Command - create a command to strobe EIO 0-255 ONLY.

◆ reset()

function labJackT::reset ( in  me)

◆ resetStrobe()

function labJackT::resetStrobe ( in  me,
in  varargin 
)
Parameters
<br>

◆ resumeRecording()

function labJackT::resumeRecording ( in  me,
in  varargin 
)
Parameters
<br>

◆ rstop()

function labJackT::rstop ( in  me,
in  varargin 
)
Parameters
<br>

◆ sendStrobe()

function labJackT::sendStrobe ( in  me,
in  value 
)

sends a value to RAMAddress, requires the Lua server to be running, 0-2047 controls EIO0-8 & CIO0-3 - 2048 TTLs CIO-4

Parameters
value0 - 2048

◆ sendStrobedCIO()

function labJackT::sendStrobedCIO ( in  me,
in  value 
)

◆ sendStrobedEIO()

function labJackT::sendStrobedEIO ( in  me,
in  value 
)

◆ sendTTL()

function labJackT::sendTTL ( in  me,
in  fio,
in  value 
)

◆ setFIO()

function labJackT::setFIO ( in  me,
in  line,
in  value,
in  direction 
)

◆ startFixation()

function labJackT::startFixation ( in  me,
in  varargin 
)
Parameters
<br>

◆ startRecording()

function labJackT::startRecording ( in  me,
in  varargin 
)
Parameters
<br>

◆ startStream()

function labJackT::startStream ( in  me)

startStream

◆ stopRecording()

function labJackT::stopRecording ( in  me,
in  varargin 
)
Parameters
<br>

◆ stopServer()

function labJackT::stopServer ( in  me)

upload the Lua server to the LabJack and start it

◆ stopStream()

function labJackT::stopStream ( in  me)

stopStream

◆ strobeServer()

function labJackT::strobeServer ( in  me,
in  value 
)

LEGACY - use sendStrobe.

◆ strobeWord()

function labJackT::strobeWord ( in  me)

LEGACY Command - create a command to strobe EIO 0-255 ONLY.

◆ test()

function labJackT::test ( in  me)

◆ testAIN()

function labJackT::testAIN ( in  me,
in  channels 
)

Member Data Documentation

◆ comment

Property labJackT::comment

comment

◆ connectType

Property labJackT::connectType

Connection type: ANY, USB, TCP, ETHERNET, WIFI.

◆ device

Property labJackT::device

if more than one labJack connected, which one to open? Default is first device

◆ deviceID

Property labJackT::deviceID

what LabJack device to use; 4 = T4, 7 = T7

◆ header

Property labJackT::header

header needed by loadlib

◆ IP

Property labJackT::IP

IP address if using network.

◆ library

Property labJackT::library

the library itself

◆ name

Property labJackT::name

friendly object name, setting this to 'null' will force silentMode=1

◆ openNow

Property labJackT::openNow

allows the constructor to run the open method immediately

◆ silentMode

Property labJackT::silentMode

silentMode=true allows one to gracefully fail methods without a labJack connected

◆ streamChannels

Property labJackT::streamChannels

streamChannels which channels to stream

◆ streamResolution

Property labJackT::streamResolution

resolution of the stream 0-5 for T4, 0 is default (=1), 5 being best/slowest

◆ streamSampleRate

Property labJackT::streamSampleRate

stream sample rate (Hz)

◆ streamSamples

Property labJackT::streamSamples

number of stream samples to collect in each read

◆ strobeTime

Property labJackT::strobeTime

strobeTime is time of strobe in ms; max = 100ms

◆ timeOut

Property labJackT::timeOut

timeout for communication in ms

◆ verbose

Property labJackT::verbose

do we log everything to the command window?

◆ winHeader

Property labJackT::winHeader

◆ winLibrary

Property labJackT::winLibrary

The documentation for this class was generated from the following file: