Poller

class ingenialink.poller.Poller(servo: ingenialink.servo.Servo, num_channels: int)[source]

Register poller for CANOpen/Ethernet communications.

Parameters
  • servo – Servo.

  • num_channels – Number of channels.

ch_configure(channel: int, reg: ingenialink.register.Register, subnode: int = 1)int[source]

Configure a poller channel mapping.

Parameters
  • channel – Channel to be configured.

  • reg – Register to associate to the given channel.

  • subnode – Subnode for the register.

Returns

Status code.

Raises
  • ILStateError – The poller is already running.

  • ILValueError – Channel out of range.

  • TypeError – If the register is not valid.

ch_disable(channel: int)int[source]

Disable a channel.

Parameters

channel – Channel to be disabled.

Raises
Returns

Status code.

ch_disable_all()int[source]

Disable all channels.

Returns

Status code.

configure(t_s: float, sz: int)int[source]

Configure data.

Parameters
  • t_s – Polling period (s).

  • sz – Buffer size.

Returns

Status code.

Raises

ILStateError – The poller is already running.

start()int[source]

Start the poller.

stop()None[source]

Stop poller.

property data

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

property num_channels

Number of channels in the poller.

property servo

Servo instance to be used.

class ingenialink.poller.PollerTimer(interval: float, function: Callable[[], Any])[source]
run()None[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.