uatools 1.0.0-pre2
 
Loading...
Searching...
No Matches
FcfRepro.cpp File Reference

Minimal reproducer of FCF devmgr's ualib usage pattern. More...

#include <atomic>
#include <chrono>
#include <cstdint>
#include <iostream>
#include <string>
#include <thread>
#include <vector>
#include <ifw/fnd/defs/base.hpp>
#include <ifw/fnd/defs/logger.hpp>
#include <eso/uatools/ualib/client.hpp>

Functions

int main (int argc, char **argv)
 

Detailed Description

Minimal reproducer of FCF devmgr's ualib usage pattern.

Purpose: reproduce, OUTSIDE of FCF/SCXML/CII, the scenario where an open shutter1 (an OPC UA method Call) stalls to a timeout against a real TwinCAT PLC while a long-lived SUBSCRIBING connection is up and the auto-reconnect machinery is active. UaClient cannot show this because it does a single short-lived call; FCF holds a persistent subscription.

This program mirrors the essential ualib usage of ifw::fcf::devmgr::common::DeviceLcsIf:

  1. Configure(endpoint) + Connect() (DeviceLcsIf::Connect)
  2. SetConnectionStateHandler(...) (devmgr observes state)
  3. Subscribe(status_nodes, handler) (DeviceLcsIf::StartMonitoring)
  4. keep the connection alive (iterator + subscription running)
  5. periodically Call(rpc) with the object passed explicitly (DeviceLcsIf::ExecuteRpc, post '#'-decode fix) and logs everything with timestamps so a stall around a reconnect is visible.

It deliberately sets NO reconnect properties (exactly like devmgr's DeviceLcsIf::Connect, which only sets opts.endpoint) so ualib's DEFAULT reconnect policy is in force — the configuration under suspicion.

Example (shutter defaults): FcfRepro –uri opc.tcp://134.171.59.99:4840

Or fully specified (e.g. lamp), all on one line: FcfRepro –uri opc.tcp://134.171.59.99:4840 –object 'ns=4;s=MAIN.Lamp1' –method 'ns=4;s=MAIN.Lamp1#RPC_On' –arg Double:50.0 –arg UInt32:0 –sub 'ns=4;s=MAIN.Lamp1.stat.nState' –sub 'ns=4;s=MAIN.Lamp1.stat.nSubstate'

Function Documentation

◆ main()

int main ( int argc,
char ** argv )