API Reference v9.2.0

IlluminatorChannelclass

Module: ZaberMotionMicroscopy

Use to control a channel (LED lamp) on an illuminator. Requires at least Firmware 7.09.

The following example illustrates how you can obtain an instance of this type:

import ZaberMotionAscii
import ZaberMotionMicroscopy

let connection = try await Connection.openSerialPort(portName: "COM3")
let microscope = try await Microscope.find(connection: connection)
let illuminator = microscope.illuminator
let illuminatorChannel = try illuminator.getChannel(channelNumber: 1)
Related Guides:

Properties

p

channelNumber

readonly
illuminatorChannel.channelNumber
Int The channel number identifies the channel on the illuminator.
p

illuminator

readonly
illuminatorChannel.illuminator
Illuminator Illuminator of this channel.
p

settings

readonly
illuminatorChannel.settings
AxisSettings Settings and properties of this channel.
p

storage

readonly
illuminatorChannel.storage
AxisStorage Key-value storage of this channel.
p

warnings

readonly
illuminatorChannel.warnings
Warnings Warnings and faults of this channel.

Methods

m

genericCommand()

asyncthrows
try await illuminatorChannel.genericCommand(command, checkErrors = true, timeout = 0)
Sends a generic ASCII command to this channel. For more information refer to: ASCII Protocol Manual.
Arguments
NameTypeDescription
commandStringCommand and its parameters.
checkErrorsBoolControls whether to throw an exception when the device rejects the command.
timeoutIntThe timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.
Return Value
Response A response to the command.
m

genericCommandMultiResponse()

asyncthrows
try await illuminatorChannel.genericCommandMultiResponse(command, checkErrors = true, timeout = 0)
Sends a generic ASCII command to this channel and expects multiple responses. Responses are returned in order of arrival. For more information refer to: ASCII Protocol Manual.
Arguments
NameTypeDescription
commandStringCommand and its parameters.
checkErrorsBoolControls whether to throw an exception when a device rejects the command.
timeoutIntThe timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.
Return Value
[Response] All responses to the command.
m

genericCommandNoResponse()

asyncthrows
try await illuminatorChannel.genericCommandNoResponse(command)
Sends a generic ASCII command to this channel without expecting a response and without adding a message ID For more information refer to: ASCII Protocol Manual.
Arguments
NameTypeDescription
commandStringCommand and its parameters.
m

getIntensity()

asyncthrows
try await illuminatorChannel.getIntensity()
Gets the current intensity of this channel.
Return Value
Double Current intensity as fraction of maximum flux.
m

getState()

asyncthrows
try await illuminatorChannel.getState()
Returns a serialization of the current channel state that can be saved and reapplied.
Return Value
String A serialization of the current state of the channel.
m

isOn()

asyncthrows
try await illuminatorChannel.isOn()
Checks if this channel is on.
Return Value
Bool True if channel is on, false otherwise.
m

off()

asyncthrows
try await illuminatorChannel.off()
Turns this channel off.
m

on()

asyncthrows
try await illuminatorChannel.on(duration = nil)
Turns this channel on.
Arguments
NameTypeDescription
durationMeasurement?Duration for which to turn the channel on. If not specified, the channel remains on until turned off.
m

setIntensity()

asyncthrows
try await illuminatorChannel.setIntensity(intensity)
Sets channel intensity as a fraction of the maximum flux.
Arguments
NameTypeDescription
intensityDoubleFraction of intensity to set (between 0 and 1).
m

setOn()

asyncthrows
try await illuminatorChannel.setOn(on)
Turns this channel on or off.
Arguments
NameTypeDescription
onBoolTrue to turn channel on, false to turn it off.
m

setState()

asyncthrows
try await illuminatorChannel.setState(state)
Applies a saved state to this channel.
Arguments
NameTypeDescription
stateStringThe state object to apply to this channel.
Return Value
SetStateAxisResponse Reports of any issues that were handled, but caused the state to not be exactly restored.
m

toString()

throws
try illuminatorChannel.toString()
Returns a string that represents the channel.
Return Value
String A string that represents the channel.