Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
somanet_control.h File Reference

SOMANET drive control by bus position — resolve, bind the vendor view, run one operation. More...

#include <chrono>
#include <cstdint>
#include <expected>
#include <string>
#include <vector>
#include "node/device_manager.h"
#include "node/somanet_drive.h"
Include dependency graph for somanet_control.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  mm
 
namespace  mm::node
 

Functions

std::expected< BrakeState, std::string > mm::node::brakeState (DeviceManager &deviceManager, uint16_t slavePosition)
 Reads a drive's brake configuration and current state (0x2004).
 
std::expected< BrakeState, std::string > mm::node::releaseBrake (DeviceManager &deviceManager, uint16_t slavePosition, std::chrono::milliseconds settle)
 Releases (disengages) a drive's brake, then waits for the release to finish.
 
std::expected< BrakeState, std::string > mm::node::engageBrake (DeviceManager &deviceManager, uint16_t slavePosition, std::chrono::milliseconds settle)
 Engages a drive's brake and waits settle for it to bite.
 
std::expected< std::vector< DeviceFile >, std::string > mm::node::readFileList (DeviceManager &deviceManager, uint16_t slavePosition)
 Reads the list of files stored on a device (FoE read of "fs-getlist").
 
std::expected< void, std::string > mm::node::removeFile (DeviceManager &deviceManager, uint16_t slavePosition, const std::string &filename)
 Deletes one file from a device's flash.
 
std::expected< HardwareDescription, std::string > mm::node::readHardwareDescription (DeviceManager &deviceManager, uint16_t slavePosition)
 Reads and parses a device's .hardware_description file.
 
std::expected< std::optional< IntegroVariant >, std::string > mm::node::readIntegroVariant (DeviceManager &deviceManager, uint16_t slavePosition)
 Reads and parses a device's .variant file.
 
std::expected< FirmwareCompatibility, std::string > mm::node::checkFirmwarePackage (DeviceManager &deviceManager, uint16_t slavePosition, std::string_view packageFilename)
 Reads what a device is and decides whether a firmware package belongs on it.
 
std::expected< HrdRecording, std::string > mm::node::readHrdRecording (DeviceManager &deviceManager, uint16_t slavePosition, somanet::HrdData data)
 Reads a drive's high resolution data recording back and decodes it.
 

Detailed Description

SOMANET drive control by bus position — resolve, bind the vendor view, run one operation.

The SOMANET sibling of cia402_control.h, and the same three lines each: DeviceManager::deviceAt to resolve the position and hold the device alive, createSomanetDrive to validate the device really is a SOMANET drive, then one call on the view. The domain logic stays on SomanetDrive; these are only the lifetime-safe way in for code that has a bus position rather than a device.

These are not procedures, for the reason spelled out in cia402_control.h: they are short interactive control, and they are what procedures are built from. A diagnostics procedure releases the brake as one of its steps by calling SomanetDrive::releaseBrake on the device it already borrowed — never by starting a brake "procedure", which would deadlock against the device token it already holds.