MasterScan  Lab_Matlab_control Master Branch
List of all members | Properties and Events | Methods | Static Methods
dotsWritableDOut Class Reference

Overview

Superclass for objects that write data as digital output.

The dotsWritable superclass provides a uniform way to write digital data, such as TTL pulses.

Inheritance diagram for dotsWritableDOut:
Inheritance graph
[legend]

Properties and Events

Property defaultPauseBetweenPulses = 0.1
 for sendTTL pulses
 
- Properties and Events inherited from dotsWritable
Property isAvailable = false
 

whether or not the object is ready to read() from


 
Property clockFunction
 

any function that returns the current time as a number


 

Methods

self dotsWritableDOut ()
 Constructor takes no arguments.
 
timestamp sendStrobedWord (self, word, port)
 Send a strobed digital word. More...
 
timestamp sendTTLPulse (self)
 Send a single TTL pulse. More...
 
firstTimestamp lastTimestamp sendTTLPulses (self, numPulses, pauseBetweenPulses, channel)
 Send multiple TTL pulses Timestamps are estimates of onset times of first and last pulses. More...
 
timestamp sendTTLSignal (self, channel, signal, frequency)
 Send a TTL signal or waveform. More...
 
- Methods inherited from dotsWritable
self dotsWritable ()
 

Constructor takes no arguments.


 
 initialize (self, varargin)
 

Locate, acquire, configure, etc. device and component resources.


 
time getDeviceTime (self)
 

Get the current time from clockFunction.


 
 close (self)
 

Release any resources acquired by initialize().


 
 delete (self)
 

Automatically close when Matlab is done with this object.


 

Static Methods

static dout getDefault ()
 get default Dout device
 

Additional Inherited Members

- Protected Methods inherited from dotsWritable
 openDevice (self)
 

Locate and acquire input device resources (for subclasses).

More...
 
 closeDevice (self)
 

Release input device resources (for subclasses).

More...
 

Methods

◆ sendStrobedWord()

timestamp sendStrobedWord ( self  ,
word  ,
port   
)

Send a strobed digital word.

Parameters
wordunsigned integer representing a word or code to send
portoptional 0-based id indicating from which physical port to send word

Must set the bits of the digital output indicated by @port to match word, then set a strobe bit to indicate to an external system that word is ready for reading, then clear the strobe bit.

If word is too large to fit within the bits of port, must set as many least-significant bits as possible, and must not clip or round word. For example, if word is a 16-bit integer and port has only 8 bits, must set word modulo 2^8, instead of clipping or rounding word to 2^8-1.

If port is omitted, or of there is only one physical output port, should treat port as 0.

Must return a positive timestamp, based on the local host's clock, that is the best estimate of when the strobe bit was set, or a negative scalar to indicate an error.

◆ sendTTLPulse()

timestamp sendTTLPulse ( self  )

Send a single TTL pulse.

Parameters
channeloptional 0-based id indicating from which physical channel to send the TTL pulse.

Must send a standard transistor-transistor-logic(TTL) pulse on the given channel.

A TTL pulse should begin with channel already at a low value, within 0.0-0.8V of ground. The channel should transition to a high value, within 2.2-5V above ground, for a duration long enough to be detected by an external system. Then channel should transition back to a low value.

If channel is omitted, or of there is only one physical output channel, should treat channel as 0.

Must return a positive timestamp, based on the local host's clock, that is the best estimate of when channel transitioned to its high value, or a negative scalar to indicate an error.

◆ sendTTLPulses()

firstTimestamp lastTimestamp sendTTLPulses ( self  ,
numPulses  ,
pauseBetweenPulses  ,
channel   
)

Send multiple TTL pulses Timestamps are estimates of onset times of first and last pulses.

◆ sendTTLSignal()

timestamp sendTTLSignal ( self  ,
channel  ,
signal  ,
frequency   
)

Send a TTL signal or waveform.

Parameters
channeloptional 0-based id indicating from which physical channel to send the TTL signal.
signallogical array specifying a sequence of TTL values to output from channel, with true->high and false->low.
frequencyfrequency in Hz at which to move through elements of signal.

Must output standard transistor-transistor-logic(TTL) voltages on the given channel, according to the given signal and frequency. Once output begins, must make every attempt to output all of signal withoug timing jitter, for example by buffering signal in external hardware.

Must output each element of signal, one at a time, with true elements corresponding to logic high and false elements corresponding to logic low. Each logic value should persist on channel for the 1/frequency seconds. Consecutive high or low otuputs should be continuous, without gaps, so that signal may specify a sequence of logic pulses, or a square logic wavform.

May or may not block in order to complete and/or verify output. If signal is too long or frequency is unattainable for the given channel, should return immediately and return a negative status value.

If channel is omitted, or of there is only one physical output channel, should treat channel as 0.

Must return a positive timestamp, based on the local host's clock, that is the best estimate of when the first element of signal was output, or a negative scalar to indicate an error.


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