Table of Contents
CTC one Button and two LEDs
Content → Hardware → CTC-Modules → CTC Rocrail Configuration → CTC one Button and two LEDs
This documentation is based on Rocrail Version 2.1.4391 dated 29.03.2024 .
As a WIO a Pico-W is used with WIO version 850.
Introduction
The Task: construct a CTC desk to switch the track Power and the Automatic mode ON and OFF
Using this example is done by the users own risk.
The Rocrail workspace.
For a Rocrail output the "accessory-140" is used as a CTC-Module.
The upper LED is used to indicate the state of Power or the state of Automatic mode on the CTC desk.
The lower LED is used as a "button pressed feedback indicator". It will become active as soon as the real CTC button is pressed.
During simulation of the CTC button in the Rocrail plan this LED will not become active.
This example uses actions.
This example uses WIO Node ID 51; the user has to replace these values by his own WIO Node ID.
There will be three layers to watch at:
layer | image | description |
---|---|---|
1 | ![]() | the Rocrail plan with the Rocrail objects |
2 | ![]() | the Rocrail plan with the CTC-Module objects for a simulation of the CTC objects |
3 | ![]() | real CTC-Modules |
This solution uses the following technique:
1) Rocrail Objects
1.1) Outputs
The two output objects are quite normal:
All configurations and parameters for the outputs are listed here in one table:
Object | Action control | Action Definition | |||
---|---|---|---|---|---|
Output | Action ID | State | Type | Command | |
co_power | ac_power_on | on | System | go | |
co_power | ac_power_off | off | System | stop | |
co_automatic | ac_automatic_on | on | System | on | |
co_automatic | ac_automatic_off | off | System | off |
1.2) System
Four system actions are used:
All configurations and parameters for the system actions are listed here in one table:
Object | Action control | Conditions | Action Definition | ||||||
---|---|---|---|---|---|---|---|---|---|
Action ID | State | Type | ID | State | Type | ID | Command | ||
System | ac_co_power_on | go-cmd | Output | co_power | off | Output | co_power | on | |
System | ac_co_power_off | stop-cmd | Output | co_power | on | Output | co_power | off | |
System | ac_co_automatic_on | on-auto | Output | co_automatic | off | Output | co_automatic | on | |
System | ac_co_automatic_off | off-auto | Output | co_automatic | on | Output | co_automatic | off |
2) CTC-Modules
Two CTC-Modules of type "accessory-140" are used.
To map the CTC objects to the Rocrail objects
- just oben the properties of the the Rocrail object
- klick the button "Pixel CTC…"
- an fill out the CTC Module dialog.
The parameters can be found in the table below:
Modul | Rocrail Object | Mapping ID | Button | LEDs | Accessory No. |
---|---|---|---|---|---|
1 | co_power | ctc_co_power | T1 = 1 | 1,3 | 140 |
2 | co_automatic | ctc_co_automatic | T1 = 2 | 1,3 | 140 |
The CTC index shows a summary of the CTC module configuration.
3) real CTC-Modules
4) Hardware
To build the hardware the following parts are required:
- one Pico-W
- two CTC-Modules with buttons and enclosure (or NeoPixel LEDs and two extra buttons)
- one USB power supply (or any other 5 Volt power supply).
The picture does include some other parts that are not required for this example.
5) Remarks
None.