PosConCM.send_command

PosConCM.send_command(address, command, data=None)[source]

Sends a command to the sensor’s address specified. The command can optionally contain a data string. This method is mostly for internal use, as the higher-level API is exposed via dedicated methods.

Parameters:
addressint

PosConCM sensors have an address assigned, which defaults to 1. There’s also a broadcast address (PosConCM.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.

commandstring

A string indicating the command number to be executed with the W or R in front, depending on Writting or Reading.

datastring

An optional string of data that is sent together with the command.

Returns:
list or value

Result of the command. It can be a list or a single value depending on the operation.