Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
mm::example::ExampleCyclicTask::Config Struct Reference

Everything the task needs to know, so nothing is hard-coded in execute. More...

#include <example_cyclic_task.h>

Collaboration diagram for mm::example::ExampleCyclicTask::Config:
[legend]

Public Attributes

uint16_t slavePosition = 1
 
mm::node::ObjectAddress< int32_t > temperature
 
int32_t temperatureLimit = 60000
 
int32_t velocity = 100
 

Detailed Description

Everything the task needs to know, so nothing is hard-coded in execute.

Member Data Documentation

◆ slavePosition

uint16_t mm::example::ExampleCyclicTask::Config::slavePosition = 1

1-based bus position of the drive to watch. Position is not identity: inserting a device into the chain shifts every position after it, so re-check this after changing the bus.

◆ temperature

mm::node::ObjectAddress<int32_t> mm::example::ExampleCyclicTask::Config::temperature
Initial value:
=
constexpr ObjectAddress< int32_t > kDriveTemperatureMeasuredTemperature
Drive temperature / Measured temperature — ro, m°C.
Definition somanet_drive_objects.h:472

The temperature object, as an ObjectAddress: index, subindex, and the C++ type the drive's own dictionary declares, in one constant from somanet_drive_objects.h. Defaults to SOMANET 0x2031:01 "Drive temperature" — measured near the inverter, which is what a power-stage interlock cares about; kCoreTemperatureMeasuredTemperature is the control board instead.

The type travelling with the address is the point, not decoration. This object is a DINT; reading it as an int16_t returns nothing at all, and this task reads "no value" as too hot — so the drive would never enable and the example would look simply broken. Substituting another drive's object is a one-line change here, and the type follows it.

◆ temperatureLimit

int32_t mm::example::ExampleCyclicTask::Config::temperatureLimit = 60000

Above this, the drive is quick-stopped and held until it cools.

In the object's own units, which here are milli-degrees Celsius — the generated line for kDriveTemperatureMeasuredTemperature carries m°C in its trailing comment, decoded from the ESI's ETG.1004 unit 0xFD2D0000. So this is 60 °C; writing 60 would mean 0.06 °C and quick-stop the drive immediately.

◆ velocity

int32_t mm::example::ExampleCyclicTask::Config::velocity = 100

The velocity commanded while the drive is enabled and below the limit, in whatever units 0x60FF uses on your drive (RPM on a SOMANET drive configured that way). Keep it small while trying this out.


The documentation for this struct was generated from the following file: