fieldbus_core

Protocol-neutral fieldbus profile layer for Isochronon

fieldbus
profile
cia402
moon add mokomoking2501/fieldbus_core@0.1.0
Download zip
Version
0.1.0
License
Apache-2.0
Last updated
last month
Downloads
12
README

#Fieldbus Core

mokomoking2501/fieldbus_core is the local profile layer for protocol-neutral fieldbus semantics. W0 provides the CiA 402 profile as a pure MoonBit package before any protocol-specific adapter is published; W1A adds a local CANopen binding skeleton that reuses the same object contracts.

moonecat_master_harness/ is the provider-owned delivery descriptor for a MoonECAT minimal master. It records the intended @hal.Nic / @hal.ZeroCopyNic / @hal.Clock bindings to Lockwire native link sessions and frame-pool/clock substrate without importing MoonECAT into Lockwire, and now owns the no-live handoff inventory for list-if / scan / validate / run / run-zc / diagnostic live CLI surfaces. Concrete MoonECAT adapter wrappers and live evidence remain provider-side work.

profinet_master_harness/ is the matching provider-owned delivery descriptor for profinet_master. It records how the former ffi/rawnet, ffi/udpnet, and ffi/pcapdump surfaces bind to Lockwire native link sessions, UDP, pcap writer, and highres clock substrate. DCP/helper/RT/pcap/root-facade live CLI handoffs carry capability labels and manual evidence slots, while the protocol stack stays free of lockwire imports.

The migration cost is intentionally concentrated in those live CLI handoffs: protocol/runtime packages stay sans-I/O and lockwire-free, while fieldbus_core/*_harness owns the provider delivery shape that can later connect driver, stack, trace, replay, and manual evidence.

cmd/main provides the no-live provider harness command entry:

moon run fieldbus_core/cmd/main harness-handoffs --provider all moon run fieldbus_core/cmd/main harness-handoffs --provider moonecat moon run fieldbus_core/cmd/main harness-handoffs --provider profinet moon run fieldbus_core/cmd/main harness-coverage moon run fieldbus_core/cmd/main harness-run-plan --provider moonecat --handoff scan --target windows-npcap moon run fieldbus_core/cmd/main harness-exec --provider moonecat --handoff scan --target windows-npcap --interface '\Device\NPF_{...}' --allow-live --confirm-interface '\Device\NPF_{...}' moon run fieldbus_core/cmd/main harness-exec --provider profinet --handoff rpc-b4 --target windows-npcap --interface '\Device\NPF_{...}' --allow-live --confirm-interface '\Device\NPF_{...}' --provider-arg 192.168.0.10 moon run fieldbus_core/cmd/main harness-exec --provider profinet --handoff rpc-probe --target windows-npcap --interface '\Device\NPF_{...}' --allow-live --confirm-interface '\Device\NPF_{...}' --provider-arg 192.168.0.10 powershell -ExecutionPolicy Bypass -File scripts\provider-harness-exec.ps1 -Provider moonecat -Handoff scan powershell -ExecutionPolicy Bypass -File scripts\provider-harness-exec.ps1 -Provider profinet -Handoff rpc-b4 -InterfaceName '\Device\NPF_{...}' -AllowLiveExecution -ConfirmInterfaceName '\Device\NPF_{...}' -ProviderArg 192.168.0.10

These commands print the handoff inventory, coverage matrix, run-plan authorization, and provider-owned CLI argv template. harness-coverage expands all 42 provider handoffs across windows-npcap and linux-raw into 84 cases, including the provider command template status and blocked PROFINET root facade entries. harness-exec may produce a command that can open a device when run by an external runner, but the Fieldbus Core command itself still does not open a NIC or execute provider live I/O. The generated argv is command-specific: raw/pcap commands carry --if or --iface, while UDP-only helpers such as rpc-probe keep the interface only as a Fieldbus Core authorization gate.

scripts/provider-harness-exec.ps1 is the thin execute/collect wrapper for that CLI. It writes provider-harness-exec-summary.json plus stdout/stderr artifacts, and deliberately records the provider command as not executed; MoonBit tests own the summary and file fact policies. The provider run-plan and exec runner stdout policies require an exact machine-readable line set, so stale status or provider execution lines cannot be mixed into an otherwise passing evidence stream.

mokomoking2501/fieldbus_core/provider_handoff_evidence also owns the no-live command coverage gate for provider CLIs. It expands the MoonECAT/EtherCAT and PROFINET handoff inventory across windows-npcap and linux-raw, checks which commands produce external-runner argv templates, and keeps PROFINET root facade entries blocked until they have provider-owned CLI surfaces.

The same coverage gate is part of the provider operator package policy. A provider package only passes when manifest facts, run-plan/harness-exec runner facts, and the full Windows/Linux CLI template matrix all pass. The manifest handoff inventory must align with the coverage inventory, so a partial manifest cannot borrow a passing full-matrix coverage report. This still does not execute provider CLIs; it makes missing CLI coverage visible before the package is handed to an operator.

///|
test "cia402 profile binding smoke" {
assert_eq(cia402_coe_bindings().length(), 6)
assert_eq(canopen_cia402_bindings().length(), 6)
}

#
canopen_arbitration_sample_fixture

#
canopen_cia402_assets

#
canopen_cia402_bindings

fn canopen_cia402_bindings(node_id? : Int) -> Array[
ObjectBinding
]

#
canopen_cia402_contracts

fn canopen_cia402_contracts(node_id? : Int) ->
ContractRegistry

#
canopen_cia402_observer_backend

fn canopen_cia402_observer_backend(node_id? : Int) ->
ObserverBackend

#
canopen_cia402_observer_report

fn canopen_cia402_observer_report(node_id? : Int) ->
ConformanceReport

#
canopen_cia402_protocol

#
canopen_cia402_trace_fixture

fn canopen_cia402_trace_fixture(node_id? : Int) ->
TraceLog

#
canopen_error_state_sample_fixture

#
canopen_frame_medium_report

fn canopen_frame_medium_report(node_id? : Int, seed? : Int) ->
CanopenFrameMediumReport

#
canopen_frame_medium_trace_fixture

fn canopen_frame_medium_trace_fixture(node_id? : Int, seed? : Int) ->
TraceLog

#
canopen_heartbeat_base_cob_id

let canopen_heartbeat_base_cob_id : Int

#
canopen_heartbeat_cob_id

fn canopen_heartbeat_cob_id(node_id~ : Int) -> Int

#
canopen_medium_id

fn canopen_medium_id() -> String

#
canopen_nmt_cob_id

let canopen_nmt_cob_id : Int

#
canopen_rpdo1_base_cob_id

let canopen_rpdo1_base_cob_id : Int

#
canopen_rpdo1_cob_id

fn canopen_rpdo1_cob_id(node_id~ : Int) -> Int

#
canopen_rpdo1_frame_fixture

fn canopen_rpdo1_frame_fixture(node_id? : Int) ->
CanopenPdoFrame

#
canopen_sdo_download_base_cob_id

let canopen_sdo_download_base_cob_id : Int

#
canopen_sdo_download_cob_id

fn canopen_sdo_download_cob_id(node_id~ : Int) -> Int

#
canopen_sdo_expedited_download_fixture

fn canopen_sdo_expedited_download_fixture(node_id? : Int, index? : UInt, subindex? : Byte, value_digest? : Int) ->
CanopenSdoExpeditedFrame

#
canopen_sdo_expedited_upload_fixture

fn canopen_sdo_expedited_upload_fixture(node_id? : Int, index? : UInt, subindex? : Byte, value_digest? : Int) ->
CanopenSdoExpeditedFrame

#
canopen_sdo_upload_base_cob_id

let canopen_sdo_upload_base_cob_id : Int

#
canopen_sdo_upload_cob_id

fn canopen_sdo_upload_cob_id(node_id~ : Int) -> Int

#
canopen_tpdo1_base_cob_id

let canopen_tpdo1_base_cob_id : Int

#
canopen_tpdo1_cob_id

fn canopen_tpdo1_cob_id(node_id~ : Int) -> Int

#
canopen_tpdo1_frame_fixture

fn canopen_tpdo1_frame_fixture(node_id? : Int) ->
CanopenPdoFrame

#
cia402_actual_position_index

let cia402_actual_position_index : UInt

#
cia402_coe_bindings

#
cia402_controlword_index

let cia402_controlword_index : UInt

#
cia402_enable_fault_reset_protocol

#
cia402_fault_index

let cia402_fault_index : UInt

#
cia402_mode_of_operation_index

let cia402_mode_of_operation_index : UInt

#
cia402_object_contracts

#
cia402_statusword_index

let cia402_statusword_index : UInt

#
cia402_target_position_index

let cia402_target_position_index : UInt

#
decode_statusword

#
modbus_fabric_framing_trace

fn modbus_fabric_framing_trace(seed? : Int) ->
TraceLog

#
modbus_framing_simulation_report

#
modbus_medium_id

fn modbus_medium_id() -> String

#
modbus_p2p_framing_trace

fn modbus_p2p_framing_trace(seed? : Int) ->
TraceLog

#
modbus_query_trace_fixture

fn modbus_query_trace_fixture(unit_id? : Int) ->
TraceLog

#
modbus_read_holding_pdu

fn modbus_read_holding_pdu(address? : UInt, quantity? : Int) ->
ModbusApplicationPdu

#
modbus_read_input_pdu

fn modbus_read_input_pdu(address? : UInt, quantity? : Int) ->
ModbusApplicationPdu

#
modbus_register_bindings

fn modbus_register_bindings(unit_id? : Int) -> Array[
ObjectBinding
]

#
modbus_register_contracts

fn modbus_register_contracts(unit_id? : Int) ->
ContractRegistry

#
modbus_register_observer_backend

fn modbus_register_observer_backend(unit_id? : Int) ->
ObserverBackend

#
modbus_register_observer_report

fn modbus_register_observer_report(unit_id? : Int) ->
ConformanceReport

#
modbus_register_profile_report

#
modbus_register_profiles

#
modbus_register_protocol

#
modbus_register_trace_fixture

fn modbus_register_trace_fixture(unit_id? : Int) ->
TraceLog

#
modbus_rtu_boundary_fixture

#
modbus_rtu_read_input_fixture

fn modbus_rtu_read_input_fixture(unit_id? : Int, baud_rate? : Int) ->
ModbusRtuFrame

#
modbus_tcp_read_holding_fixture

fn modbus_tcp_read_holding_fixture(transaction_id? : Int, unit_id? : Int) ->
ModbusTcpFrame

#
moonecat_cia402_bindings

#
moonecat_cia402_contracts

#
moonecat_cia402_observer_backend

#
moonecat_cia402_observer_report

#
moonecat_cia402_protocol

#
moonecat_cia402_trace_fixture

fn moonecat_cia402_trace_fixture() ->
TraceLog

#
package_id

fn package_id() -> String

#
zenoh_cia402_bindings

fn zenoh_cia402_bindings(axis_id? : Int) -> Array[
ObjectBinding
]

#
zenoh_cia402_contracts

fn zenoh_cia402_contracts(axis_id? : Int) ->
ContractRegistry

#
zenoh_cia402_mirror_report

#
zenoh_cia402_mirrors

#
zenoh_cia402_observer_backend

fn zenoh_cia402_observer_backend(axis_id? : Int) ->
ObserverBackend

#
zenoh_cia402_observer_report

fn zenoh_cia402_observer_report(axis_id? : Int) ->
ConformanceReport

#
zenoh_cia402_protocol

#
zenoh_cia402_trace_fixture

fn zenoh_cia402_trace_fixture(axis_id? : Int) ->
TraceLog

#
zenoh_fabric_session_observer_report

fn zenoh_fabric_session_observer_report(seed? : Int, axis_id? : Int) ->
ConformanceReport

#
zenoh_fabric_session_report

fn zenoh_fabric_session_report(seed? : Int, axis_id? : Int) ->
ZenohFabricSessionReport

#
zenoh_fabric_session_trace_fixture

fn zenoh_fabric_session_trace_fixture(seed? : Int, axis_id? : Int) ->
TraceLog

#
zenoh_mirror_medium_id

fn zenoh_mirror_medium_id() -> String

Source Files