Poller

class ingenialink.canopen.poller.CanopenPoller(servo, num_channels)[source]

Register poller for CANOpen communications.

Parameters
  • servo (CanopenServo) – Servo.

  • num_channels (int) – Number of channels.

Raises

ILCreationError – If the poller could not be created.

ch_configure(channel, reg)[source]

Configure a poller channel mapping.

Parameters
  • channel (int) – Channel to be configured.

  • reg (Register) – Register to associate to the given channel.

Returns

Status code.

Return type

int

Raises
  • ILStateError – The poller is already running.

  • ILValueError – Channel out of range.

  • TypeError – If the register is not valid.

ch_disable(channel)[source]

Disable a channel.

Parameters

channel (int) – Channel to be disabled.

Raises
Returns

Status code.

Return type

int

ch_disable_all()[source]

Disable all channels.

Returns

Status code.

Return type

int

configure(t_s, sz)[source]

Configure data.

Parameters
  • t_s (int, float) – Polling period (s).

  • sz (int) – Buffer size.

Returns

Status code.

Return type

int

Raises

ILStateError – The poller is already running.

start()[source]

Start the poller.

stop()[source]

Stop poller.

property data

Time vector, array of data vectors and a flag indicating if data was lost.

Type

tuple (list, list, bool)

property num_channels

Number of channels in the poller.

Type

int

property servo

Servo instance to be used.

Type

Servo

class ingenialink.canopen.poller.PollerTimer(time, cb)[source]

Custom timer for the CanopenPoller.

Parameters
  • time (int) – Timeout to use for the timer.

  • cb (function) – Callback.

cancel()[source]

Stops the poller timer

handle_function()[source]

Handle method that creates the timer for the poller

start()[source]

Starts the poller timer