Skip to main content
Skip table of contents

Digital Out

class digitalOut.DigitalOut

Bases: Schedule

The Dout class is used to set and get all values related to the Dout.

RGBToTrigger(color)

Helper function determines expected trigger from a given RGB 255 colour tuple.

Returns:

trigger value in decimal (base 10)

Return type:

int

Low-level C definition:

none

TriggerToRGB(trigger)

Helper function determines pixel mode RGB 255 colour value based on desired 24-bit trigger (in decimal, base 10)

Returns:

list of containing [R, G, B] in RGB 255

Return type:

list

Low-level C definition:

none

disablePixelMode()

Disables pixel mode.

When this function is disabled, the digital ouputs do not show the RGB value of first upper left pixel of the screen. The digital outputs can then be used normally. This is the default mode. This feature is only available on VIEWPixx with firmware revision 31 and higher. Any firmware for DATAPixx3.

disablePixelModeGB()

Disables pixel mode GB.

When this function is disabled, the digital ouputs do not show the GB value of first upper left pixel of the screen. The digital outputs can then be used normally. This is the default mode. This feature is only available on VIEWPixx with firmware revision 48 and higher. Any firmware for DATAPixx3.

enablePixelMode()

Enables pixel mode.

When this function is enabled, the digital outputs show the RGB value of first upper left pixel of the screen. In this case, digital outputs cannot be used for other purposes. This feature is only available on VIEWPixx with firmware revision 31 and higher. Any firmware for DATAPixx3.

enablePixelModeGB()

Enables pixel mode GB.

When this function is enabled, the digital output 8-24 show the GB value of first upper left pixel of the screen. In this case, digital outputs 8-24 cannot be used for other purposes, but digital outputs 0-7 can. This feature is only available on VIEWPixx with firmware revision 48 and higher. Any firmware for DATAPixx3.

getBaseAddress()

Gets the Ram buffer start address.

This method allows the user to get the RAM buffer start address used in schedules. It should only be used if the user wants the schedules to wrap when it has reached its maximum size. When schedules are expected to wrap, the user should also use setBufferSize()

Returns:

Any value in a range of 0 up to the RAM size.

Return type:

int

getBitValue()

Gets the current value of the bits.

Returns:

value of bit.

Return type:

int

See also

setBitValue

getBufferSize()

Gets the Ram buffer size.

This method allows the user to get the RAM buffer size used in schedules.

Returns:

Any value in a range of 0 up to the RAM size.

Return type:

int

getNbrOfBit()

Gets the number of bits available.

Returns:

Number of bits.

Return type:

int

getReadAddress()

Gets the Ram buffer read address.

This method allows the user to get the RAM buffer read address used in schedules.

Returns:

Any value in a range of 0 up to the RAM size.

Return type:

int

getScheduleCount()

Gets the schedule count value.

This method allows the user to get the current count for a schedule.

Returns:

Any positive value equal to or greater than 0.

Return type:

int

getScheduleOnset()

Gets the schedule onset value.

This method allows the user to get the schedule onset value used in schedules. The onset represents a nanosecond delay between schedule start and first sample.

Returns:

Any positive value equal to or greater than 0.

Return type:

int

getScheduleRate()

Gets the schedule rate value.

This method allows the user to get the schedule rate value used in schedules. The rate represents the speed at which the schedule updates.

Returns:

Any positive value equal to or greater than 0.

Return type:

int

getScheduleRunningState()

Gets the schedule state for the subsystem.

Returns:

“running” if a schedule is currently running, “stopped” otherwise.

Return type:

schedule_state (str)

getScheduleUnit()

Gets the schedule unit value.

This method allows the user to get the schedule unit value used in schedules.

Returns:

Any positive value equal to or greater than 0.

Return type:

int

isBacklightPulseEnabled()

Verifies if the back light pulse mode is enabled.

Returns:

True if back light pulse mode is enabled, False otherwise.

Return type:

enable (Bool)

isButtonSchedulesEnabled()

Verifies if the schedule start on button press mode is enabled.

Returns:

True if the mode is enabled, False otherwise.

Return type:

enable (Bool)

isCountDownEnabled()

Verifies the schedule count down mode.

Returns:

True if the schedule is decrementing at every sample, False otherwise.

Return type:

enable (Bool)

isPixelModeEnabled()

Verifies if the pixel mode is enabled on digital outputs.

Returns:

True if the mode is enabled, False otherwise.

Return type:

enable (Bool)

isPixelModeGBEnabled()

Verifies if the pixel mode GB is enabled on digital outputs.

Returns:

True if the mode is enabled, False otherwise.

Return type:

enable (Bool)

isScheduleRunning()

Verifies if a schedule is currently running on the subsystem.

Returns:

True if a schedule is currently running, False otherwise.

Return type:

schedule_running (Bool)

setBacklightPulse(enable)

Sets the back light pulse mode.

This method allows the user to enable or disable the back light pulse mode. When enabled, the LCD back light LEDs are gated by bit 15 of the digital output. It can be used to make a tachistoscope by pulsing bit 15 of the digital output with a schedule. When disabled, the outputs work normally and are unaffected.

Parameters:

enable (Bool) – True to activate the back light pulse mode, False otherwise.

setBaseAddress(value)

Sets the Ram buffer start address.

This method allows the user to set the RAM buffer start address used in schedules. The given address must be an even value.

Parameters:

address (int) – Any value in a range of 0 up to the RAM size.

setBitValue(value, bit_mask)

Sets the value of the bits.

This method allows the user to set the bit value for the subsystem. The mask is one value representing all bits from the port. The given bit_mask will set the direction of all digital input bits. For each bit which should drive its port, the corresponding bit_mask value should be set to 1.

For example, bit_mask = 0x0000F will enable the port for the first 4 bits on the right. All other ports will be disabled. User can then use the first 4 bits to drive the port.

Parameters:
  • value (int) – value of bits.

  • bit_mask (int) – Set bit to 1 will enable the port for that bit. Set bit to 0 will disable it.

See also

getBitValue

setBufferSize(buffer_size)

Sets the Ram buffer size.

This method allows the user to set the RAM buffer size used in schedules. It should only be used if the user wants the schedules to wrap when it has reached its maximum size. When schedules are expected to wrap, the user should also use setBaseAddress(). The given size is in bytes and must be an even value.

Parameters:

buffer_size (int) – Any value in a range of 0 up to the RAM size.

setButtonSchedules(enable)

Sets the schedule start on button press mode.

This method allows the user to enable or disable the transition log events on acquired data. When enabled, digital output schedules are done following a digital input button press. When disabled, digital output schedules have to be started manually.

Parameters:

enable (Bool) – True to activate the log event mode, False otherwise.

setDoutBuffer(bufferData, addr=8000000)

Writes the digital output waveform data in ‘bufferData’ to the DATAPixx RAM at memory address ‘bufferAddress’.

Mimics the behavior of Datapixx(‘WriteDoutBuffer’) in MATLAB.
  1. ‘bufferData’ must be of type int scaled between (0,65535)

  2. ‘bufferData’ can be either a list or a numpy.array

  3. ‘bufferData’ must be shaped as (N,)

Parameters:
  • bufferData (list or numpy.array) – contains waveform data. if a list, must be castable to a numeric numpy.array

  • bufferAddress (int) – memory location in DATAPixx RAM. default = int(8e6)

Exceptions:
  1. bufferData cannot be casted into a numpy.array of type int

  2. bufferData is empty

  3. bufferData has more than 1 dimension

  4. bufferAddress is not of type int or is less than 0 or is odd

setDoutSchedule(scheduleOnset, scheduleRate, maxScheduleFrames, bufferAddress=8000000, numBufferFrames=None)

Implements a digital output schedule in a DATAPixx.

Mimics the behavior of Datapixx(‘SetDoutSchedule’) in MATLAB.

Parameters:
  • scheduleOnset (float) – the audio schedule delay in seconds

  • scheduleRate (int or list) – the sampling rate of the digital output schedule in one of several formats:

  • integer (1) 'scheduleRate' is an) –

  • Hertz (0 'hz' sampling rate specified in) –

  • an (2) 'scheduleRate' is a list with 2 elements. the first element is) –

  • either (integer indicating the sampling rate. the second element is) –

  • allowable (an integer or a string indicating the sampling rate units.) –

  • below (values for the second element are in the 'int' and 'str' columns) –

  • description (int str) –

  • Hertz

  • frames (1 'video' sampling rate specified in DATAPixx video) –

  • nanoseconds (2 'nano' sampling rate specified in) –

  • NOTE – regardless of the choosen format, sampling rate cannot exceed 10 MHz

  • maxScheduleFrames – the number of samples after which the digital output schedule stops sampling. if maxScheduleFrames > numBufferFrames, the digital output schedule loops back to sample datum at the start address of the digital output buffer.

Exceptions:
  1. scheduleOnset is not of type float or is less than 0

  2. scheduleOnset is greater than 4.295 seconds

  3. scheduleRate does not obey supported format

  4. scheduleRate specifies sampling rate greater than 10 MHz, regardless of format

  5. maxScheduleFrames is not of type int or is less than 0

  6. maxScheduleFrames is zero and numBufferFrames was omitted

  7. bufferAddress is not of type int or is less than 0 or is odd

  8. numBufferFrames is not of type int or is less than 0

setReadAddress(address)

Sets the Ram buffer read address.

This method allows the user to set the RAM buffer read address used in schedules. This address is used by schedule to know where the data should be first read from. The schedules will then read the following data to the address following the RAM buffer read address.

The given address must be an even value.

Parameters:

address (int) – Any value in a range of 0 up to the RAM size.

setScheduleCount(count)

Sets the schedule count.

This method allows the user to set the schedule count for a schedule with a fixed number of sample. In which case, the schedule will decrement at a given rate and stop when the count reaches 0.

Parameters:

count (int) – Any positive value greater than 0.

setScheduleCountDown(enable)

Sets the schedule count down mode.

This method allows the user to enable or disable the count down on a schedule. When enabled, the schedule decrements at the given rate and stops automatically when the count hits 0. When disabled, the schedule increments at the given rate and is stopped by calling stopSchedule().

Parameters:

enable (Bool) – True if count down is enabled, False otherwise.

setScheduleOnset(onset)

Sets the schedule onset value.

This method allows the user to set the nanosecond delay between schedule start and first sample. If no delay is required, this method doesn’t need to be used. Default value is 0.

Parameters:

onset (int) – Any positive value equal to or greater than 0.

setScheduleRate(rate, unit='hz')

Sets the schedule rate.

This method allows the user to set the schedule rate. Since the rate can be given with different units, the method also needs to have a unit associated with the rate.

If no delay is required, this method doesn’t need to be used. Default value is 0.

Parameters:
  • rate (int) – Any positive value equal to or greater than 0.

  • unit (str) – hz : rate updates per second, maximum 10 MHz. video : rate updates per video frame, maximum 10 MHz. nano : rate updates period in nanoseconds, minimum 100 ns.

startSchedule()

Starts a schedule.

Schedules may be configured in different ways, affecting their behavior. Before a schedule is started, the user should make sure that it is properly set in the right mode.

stopSchedule()

Stops the active schedule for a given subsystem.

Depending on how the schedules are configured, it may not be necessary to call this method. When a schedule is using a count down, it is not needed to stop the schedule.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.