Skip to content

Creation of modbus tcp client and state machine#699

Merged
brettpac merged 2 commits intojazzyfrom
brettpac_branch
Dec 23, 2025
Merged

Creation of modbus tcp client and state machine#699
brettpac merged 2 commits intojazzyfrom
brettpac_branch

Conversation

@brettpac
Copy link
Collaborator

The SMACC2 client library for Modbus TCP relay control is now complete with:

cl_modbus_tcp_relay

  • CpModbusConnection: Connection management with heartbeat monitoring
  • CpModbusRelay: Coil read/write operations
  • CbRelayOn/CbRelayOff: Single channel control behaviors
  • CbAllRelaysOn/CbAllRelaysOff: Batch control behaviors
  • CbRelayStatus: Status reading behavior

sm_modbus_tcp_relay_test_1

Test state machine that exercises all behaviors:
StConnect → StConnected → StRelayOn → StRelayOff → StAllOn → StAllOff → StReadStatus → StComplete

Running the Test

source install/setup.bash
ros2 launch sm_modbus_tcp_relay_test_1 sm_modbus_tcp_relay_test_1.launch.py

Configuration

Edit config/sm_modbus_tcp_relay_test_1_config.yaml to set your relay board IP address (default: 192.168.1.254).

@brettpac brettpac merged commit 181dd8e into jazzy Dec 23, 2025
5 checks passed
@brettpac brettpac deleted the brettpac_branch branch December 23, 2025 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant