KeyenceCl3000#
Controls a Keyence CL-3000 series confocal laser displacement sensor from Python. This class inherits from MeasmaticDevice.
method get_program()#
Reads the number of the active program.
Returns#
| Type | Description |
|---|---|
| int | The program number (0..7). |
Example#
sensor = measmatic.get_device('device-cl3000')
program = sensor.get_program()
method light_off()#
Switches the laser light of the sensor off.
Example#
sensor = measmatic.get_device('device-cl3000')
sensor.light_off()
method light_on()#
Switches the laser light of the sensor on.
Example#
sensor = measmatic.get_device('device-cl3000')
sensor.light_on()
method measure(channel: int = 1)#
Reads the measured distance of an output channel. The first measurement of a channel configures the output format and switches the light on. Raises an error if the value is invalid or out of the display range.
Parameters#
| Name | Description |
|---|---|
| channel | The output channel (1..8). Defaults to 1. Default: 1 |
Returns#
| Type | Description |
|---|---|
| float | The measured distance in micrometers (a .NET Single). |
Example#
sensor = measmatic.get_device('device-cl3000')
distance = sensor.measure(1)
method set_average_filter(channel: int = 1, filter: Any = ...)#
Sets the measurement value filter of an output channel to a moving average.
Parameters#
| Name | Description |
|---|---|
| channel | The output channel (1..8). Defaults to 1. Default: 1 |
| filter | The number of values to average, of type Atv.Framework.Devices.Optical.LaserDistanceSensor.KeyenceCl3000.AverageFilter (Time1 to Time262144). Defaults to AverageFilter.Time16. Default: ... |
Example#
sensor = measmatic.get_device('device-cl3000')
from Atv.Framework.Devices.Optical.LaserDistanceSensor.KeyenceCl3000 import AverageFilter
sensor.set_average_filter(1, AverageFilter.Time16)
method set_measurement_method(method: Any, par: list[Any] = None, devId: int = 0, progNo: bytes = 0, outNo: bytes = 0)#
Sets the measurement method of an output of a program. The meaning of the entries of par depends on the method, missing entries use the device defaults.
Parameters#
| Name | Description |
|---|---|
| method | The measurement method, of type Atv.Framework.Devices.Optical.LaserDistanceSensor.CL3_IF_DLL.CL3IF_MEASUREMENTMETHOD. |
| par | The method-specific parameters (for example the head number), or None. Defaults to None. Default: None |
| devId | The device ID. Defaults to 0. Default: 0 |
| progNo | The program number. Defaults to 0. Default: 0 |
| outNo | The output number. Defaults to 0. Default: 0 |
Returns#
| Type | Description |
|---|---|
| int | The return code of the sensor library (0 on success). |
Example#
sensor = measmatic.get_device('device-cl3000')
from Atv.Framework.Devices.Optical.LaserDistanceSensor.CL3_IF_DLL import CL3IF_MEASUREMENTMETHOD
result = sensor.set_measurement_method(CL3IF_MEASUREMENTMETHOD.CL3IF_MEASUREMENTMETHOD_DISPLACEMENT, None, 0, 0, 0)
method set_program(programNumber: int)#
Switches the sensor to the given program.
Parameters#
| Name | Description |
|---|---|
| programNumber | The program number (0..7). |
Example#
sensor = measmatic.get_device('device-cl3000')
sensor.set_program(1)
method set_sampling_cycle(cycle: Any)#
Sets the sampling cycle of the active program. The 100 us cycle switches the ambient light filter off.
Parameters#
| Name | Description |
|---|---|
| cycle | The sampling cycle, of type Atv.Framework.Devices.Optical.LaserDistanceSensor.KeyenceCl3000.SamplingCycle (Cycle1000Us, Cycle500Us, Cycle200Us or Cycle100Us). |
Example#
sensor = measmatic.get_device('device-cl3000')
from Atv.Framework.Devices.Optical.LaserDistanceSensor.KeyenceCl3000 import SamplingCycle
sensor.set_sampling_cycle(SamplingCycle.Cycle500Us)
method zero(channel: int = 1, isTurnedOn: bool = True)#
Sets or clears the zero offset of an output channel.
Parameters#
| Name | Description |
|---|---|
| channel | The output channel (1..8). Defaults to 1. Default: 1 |
| isTurnedOn | True to set the zero offset, False to clear it. Defaults to True. Default: true |
Example#
sensor = measmatic.get_device('device-cl3000')
sensor.zero(1)
sensor.zero(1, False)
method zero_off(channel: int = 1)#
Clears the zero offset of an output channel, so that absolute measurement values are returned again.
Parameters#
| Name | Description |
|---|---|
| channel | The output channel (1..8). Defaults to 1. Default: 1 |
Example#
sensor = measmatic.get_device('device-cl3000')
sensor.zero_off(1)