![]() |
Opticka 2.16.1
Opticka is an experiment manager for behavioral research.
|
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...
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:
Copyright ©2014-2022 Ian Max Andolina — released: LGPL3, see LICENCE.md
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 |
| 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.
| varargin | are passed as a structure of properties which is parsed. |
| function labJackT::breakFixation | ( | in | me | ) |
| <br> |
| function labJackT::close | ( | in | me | ) |
Close the LabJack device void LJUSB_CloseDevice(HANDLE hDevice); //Closes the handle of a LabJack USB device.
| function labJackT::closeHandler | ( | in | src, |
| in | evnt | ||
| ) |
| function labJackT::correct | ( | in | me | ) |
| <br> |
| function labJackT::endStimulus | ( | in | me | ) |
| <br> |
| function get labJackT::fullName | ( | in | me | ) |
concatenate the name with a uuid at get.
return name the concatenated name
| function labJackT::getAIN | ( | in | me, |
| in | channels | ||
| ) |
setAIO setAIO sets the value for FIO,
| channels | AIN channels 0-3 |
| function labJackT::incorrect | ( | in | me | ) |
| <br> |
| function labJackT::initialiseServer | ( | in | me | ) |
upload the Lua server to the LabJack and start it
| function labJackT::isHandleValid | ( | in | me | ) |
| function labJackT::isServerRunning | ( | in | me | ) |
check if lua code is running
| function labJackT::listAll | ( | in | me | ) |
| function labJackT::open | ( | in | me, |
| in | serial | ||
| ) |
Open the LabJack device.
Open the LabJack device
| function labJackT::pauseRecording | ( | in | me, |
| in | varargin | ||
| ) |
| <br> |
| function labJackT::plotStream | ( | in | me, |
| in | timeL, | ||
| in | updateN | ||
| ) |
plotStream This plots the last X seconds worth of Analog data (AIN 0-3)
| timeL | - time in seconds to record |
| updateN | - refresh plot every N loops (too many refreshes slows down recording) |
| function labJackT::prepareStrobe | ( | in | me, |
| in | value | ||
| ) |
LEGACY Command - create a command to strobe EIO 0-255 ONLY.
| function labJackT::reset | ( | in | me | ) |
| function labJackT::resetStrobe | ( | in | me, |
| in | varargin | ||
| ) |
| <br> |
| function labJackT::resumeRecording | ( | in | me, |
| in | varargin | ||
| ) |
| <br> |
| function labJackT::rstop | ( | in | me, |
| in | varargin | ||
| ) |
| <br> |
| 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
| value | 0 - 2048 |
| function labJackT::sendStrobedCIO | ( | in | me, |
| in | value | ||
| ) |
| function labJackT::sendStrobedEIO | ( | in | me, |
| in | value | ||
| ) |
| function labJackT::sendTTL | ( | in | me, |
| in | fio, | ||
| in | value | ||
| ) |
| function labJackT::setFIO | ( | in | me, |
| in | line, | ||
| in | value, | ||
| in | direction | ||
| ) |
| function labJackT::startFixation | ( | in | me, |
| in | varargin | ||
| ) |
| <br> |
| function labJackT::startRecording | ( | in | me, |
| in | varargin | ||
| ) |
| <br> |
| function labJackT::startStream | ( | in | me | ) |
startStream
| function labJackT::stopRecording | ( | in | me, |
| in | varargin | ||
| ) |
| <br> |
| function labJackT::stopServer | ( | in | me | ) |
upload the Lua server to the LabJack and start it
| function labJackT::stopStream | ( | in | me | ) |
stopStream
| function labJackT::strobeServer | ( | in | me, |
| in | value | ||
| ) |
LEGACY - use sendStrobe.
| function labJackT::strobeWord | ( | in | me | ) |
LEGACY Command - create a command to strobe EIO 0-255 ONLY.
| function labJackT::test | ( | in | me | ) |
| function labJackT::testAIN | ( | in | me, |
| in | channels | ||
| ) |
| Property labJackT::comment |
comment
| Property labJackT::connectType |
Connection type: ANY, USB, TCP, ETHERNET, WIFI.
| Property labJackT::device |
if more than one labJack connected, which one to open? Default is first device
| Property labJackT::deviceID |
what LabJack device to use; 4 = T4, 7 = T7
| Property labJackT::header |
header needed by loadlib
| Property labJackT::IP |
IP address if using network.
| Property labJackT::library |
the library itself
| Property labJackT::name |
friendly object name, setting this to 'null' will force silentMode=1
| Property labJackT::openNow |
allows the constructor to run the open method immediately
| Property labJackT::silentMode |
silentMode=true allows one to gracefully fail methods without a labJack connected
| Property labJackT::streamChannels |
streamChannels which channels to stream
| Property labJackT::streamResolution |
resolution of the stream 0-5 for T4, 0 is default (=1), 5 being best/slowest
| Property labJackT::streamSampleRate |
stream sample rate (Hz)
| Property labJackT::streamSamples |
number of stream samples to collect in each read
| Property labJackT::strobeTime |
strobeTime is time of strobe in ms; max = 100ms
| Property labJackT::timeOut |
timeout for communication in ms
| Property labJackT::verbose |
do we log everything to the command window?
| Property labJackT::winHeader |
| Property labJackT::winLibrary |