PosCon3D
- class compas_fab.sensors.PosCon3D(serial, address)[source]
Bases:
SerialSensor
Provides an interface for the Baumer PosCon3D edge measurement sensor.
The sensor has different interfaces to retrieve its data. This class provides access to the serial interface (RS-485). This class is a context manager type, so it’s best used in combination with the
with
statement to ensure resource deallocation. The protocol of the sensor when operated via RS-485 indicates that access to it must be locked programmatically before starting operations and unlocked on completion. This is handled automatically if you use this class on awith
statement, otherwise, the methodsbegin()
andend()
must be invoked by hand.- Attributes
serial (
serial.Serial
) – Instance of the serial port used to communicate with the sensor.address (
int
) – PosCon3D sensors have an address assigned, which defaults to 1. There’s also a broadcast address (PosCon3D.BROADCAST_ADDRESS
) that can be used to query the address of the sensor connected to the RS-485 bus. Only one sensor can be in the bus when using the broadcast address to query for sensor’s address.
Examples
>>> from serial import Serial >>> with Serial('COM5', 57600, timeout=1) as serial: >>> with PosCon3D(serial, PosCon3D.BROADCAST_ADDRESS) as broadcast_query: ... addr = broadcast_query.get_address() ... ... with PosCon3D(serial, addr) as sensor: ... sensor.set_measurement_type('Edge L rise') ... sensor.set_precision(2) ... data = sensor.get_measurement()
Methods
Activates the FLEX Mount feature of the sensor to allow positioning it on an angled installation.
Adjusts the sensor to detect darker or lighter surfaces.
Locks the sensor to start RS-485 communication.
Checks that message is complete.
Deactivates the FLEX Mount feature.
Unlocks the sensor from RS-485 communication.
Formats the command.
Gets the address of the RS-485 sensors currently connected to the bus.
Retrieves the distance to the surface in the center of the laser beam and the angle at which it's found.
Retrieves the current measurement of the sensor according to the current settings.
Gets payload.
Resets the sensor to factory settings.
Sends a command to the sensor's address specified.
Defines the minimum height of an edge to be detected.
Sets the FLEX Mount feature to a specific angle and distance.
Defines the measurement type to use.
Defines the precision the sensor will use to determine edges: