Example Python script for Stack lights (signal tower).
How to run?:
- Place the macro in the “scripts” folder of your profile (in my case “C:\Program Files\simCNC\profiles\test\scripts”)
- Edit the macro to configure the digital input/output numbers and delay values
# Digital outputs:
Green_lamp_out = 0 # Digital output number for the green lamp
Yellow_lamp_out = 1 # Digital output number for the yellow lamp
Red_lamp_out = 2 # Digital output number for the red lamp
Buzzer_Present = True # When the signal tower is equipped with a buzzer set to True if not set to False
Buzzer_out = 3 # Digital output number for the buzzer (Set to 0 if not used)
# Digital inputs:
External_buzzer_trigger_in = 1 # Digital input number triggering the buzzer (Set to 0 if not used)
# Interval settings:
Fast_flash_interval = 250 # Fast flash interval for lamps, minimum value is 250ms.
Slow_flash_interval = 1000 # Slow flash interval for lamps, minimum value is 1000ms.
Buzer_interval = 1000 # Buzzer interval, minimum value is 250ms.
3. Configure the Python action as below.