39 std::atomic<const ProcessImage*>
image{
nullptr};
50 static_assert(std::atomic<uint64_t>::is_always_lock_free,
51 "output staging slots must be lock-free so the RT path never blocks");
75 return image.load(std::memory_order_acquire) !=
nullptr &&
76 lastWkc.load(std::memory_order_relaxed) >=
expectedWkc.load(std::memory_order_relaxed);
86 std::optional<std::vector<uint8_t>>
readPdo(uint16_t slavePosition, uint16_t index,
87 uint8_t subindex)
const;
94 bool writePdo(uint16_t slavePosition, uint16_t index, uint8_t subindex,
95 std::span<const uint8_t> bytes);
A lock-free circular recorder of the raw process image, one record per RT cycle.
Definition process_data_ring.h:34
Definition http_server.h:16
Fixed-capacity byte buffer for one direction of the process image.
Definition process_image.h:24
The live process-data runtime: the published image, the cross-thread exchange buffers,...
Definition process_data.h:36
ProcessBuffer inScratch
Definition process_data.h:59
std::atomic< int > lastWkc
Definition process_data.h:65
bool writePdo(uint16_t slavePosition, uint16_t index, uint8_t subindex, std::span< const uint8_t > bytes)
Stages a PDO output object's bytes into its slot, sent on the next cycle. Lock-free.
Definition device_manager.cc:1010
std::atomic< const ProcessImage * > image
Definition process_data.h:39
std::atomic< bool > exchanging
Definition process_data.h:62
bool healthy() const
True when an image is published and the last working counter meets the expectation.
Definition process_data.h:74
std::atomic< int > expectedWkc
Definition process_data.h:66
std::vector< std::shared_ptr< const ProcessImage > > generations
Definition process_data.h:42
ProcessBuffer outScratch
Definition process_data.h:58
std::vector< std::atomic< uint64_t > > outputSlots
Definition process_data.h:49
ProcessDataRing ring
Definition process_data.h:56
std::optional< std::vector< uint8_t > > readPdo(uint16_t slavePosition, uint16_t index, uint8_t subindex) const
Reads a PDO-mapped object's current bytes from the live image. Lock-free.
Definition device_manager.cc:970