All Downloads are FREE. Search and download functionalities are using the official Maven repository.

data.nodescript.turnouts.Threewayturnout_Fleischmann_Profi_doublecoil_oncontrol.nodescript Maven / Gradle / Ivy

### Dieses Script definiert ein Asseccory, 
### um eine Dreiwegweiche (Fleischmann Prof) mit Doppelspulen 
### anzusteuern.
###
### Hardware: 3 Switchport mit Poweroutput f?r Spulenantrieb 
###           Port 0 = Antrieb A - abzweig 
###           Port 1 = Antrieb A - gerade
###           Port 2 = Antrieb B - abzweig 
###           Port 3 = Antrieb B - gerade
### Software: 1 accessory
###           3 macros, 0 = Hp0, 1 = Hp1, 2 = Hp2, 3 = Hp0+Sh1
###
### history: 2017-11-04 A.Tillner, erste Version
###          2017-11-05 A.Kuhtz
###                     - Port correction for "Straight"
###          2017-11-05 A.Tillner 
###                     - remove switch off after switched on
###                     - Port-Config set to 15 (Impulse)

###
### how to use:
### A) configure
###    In section 1, define your ports and the desired accessory number
###    In section 2, define your settings (like brightness and speed)
### B) load and run this script
###    what will happen?
###    1. the ports will be configured with the given parameters
###    2. three new macros for the aspects will be defined
###    3. these macros will be assigned to the accessory
### C) have fun
###
##require(vid="13", pid="117,140,141,142,122,143,144,145")
##requireVersion(min=1.0.0, max=3.0.0)

###
### -------------- 1. Select Target
##application(text:de="Dreiwegweiche, Fleischmann Profi (Doppelspule) an OneControl", text:en="Three-Way turnout, Fleischmann Profi (double coil) at OneControl", text:nl="Driewegwissel van Fleischmann Profi met twee spoelen op de OneControl")
##instruction(text:de="Dreiwegweiche, Fleischmann Profi (Doppelspule) an OneControl: 
Powerports:
Antrieb A - abzweig (gr?n), Antrieb A - gerade (rot), Antrieb B - abzweig (gr?n), Antrieb B - gerade (rot)
Macros = rechts, links, gerade", text:en="Three-Way turnout, Fleischmann Profi (double coil) at OneControl:
Powerports:
Track switch A - turn (green), Track switch A - straight (red), Track switch B - turn (green), Track switch B - straight (red)
Macros = right, straight, left") ### ##input($AccessoryName:string, text:de="Name der Weiche: ", text:en="Name of the trunout: ", default="Dreiwegweiche") ##input($my_accessory:accessory, text:de="Nummer des zu erzeugenden Accessory: ", text:en="Nummber of the Accessory: ", default=0) ##input($my_macro:macro, text:de="Nummer des ersten Macros (rechts): ", text:en="Number of the first macro (right): ", default=0) ##input($start_powerport:switch, text:de="Nummer des ersten Powerport: ", text:en="Number of the first Powerport: ", default=0) ##input($prevent_replace_labels:boolean, text:de="Keine Namen fuer Accessory, Makros, Ports ersetzen", text:en="Prevent replace labels for accessory, macro and ports", default=false) ### -- prepare some variables -- #set($switch_gap = 1) ### die anderen Spulen sind an den folgenden Powerports angeschlossen #set($CVs_perPort = 3) #set($CVoffset = 389) #set($Antrieb_A_gn = $start_powerport) ### Spule an erstem Powerport, der eingegeben wurde #set($Antrieb_A_rt = 1 * $switch_gap + $start_powerport) ### Spule an naechstem Powerport #set($Antrieb_B_gn = 2 * $switch_gap + $start_powerport) ### Spule an naechstem Powerport #set($Antrieb_B_rt = 3 * $switch_gap + $start_powerport) ### Spule an naechstem Powerport #set($pairAntrieb_A_gn = $Antrieb_A_gn - $node_servo_count) #set($pairAntrieb_A_rt = $Antrieb_A_rt - $node_servo_count) #set($pairAntrieb_B_gn = $Antrieb_B_gn - $node_servo_count) #set($pairAntrieb_B_rt = $Antrieb_B_rt - $node_servo_count) #set($CV_Antrieb_A_gn_config = $CVoffset + $CVs_perPort * $pairAntrieb_A_gn) #set($CV_Antrieb_A_gn_pulse = $CV_Antrieb_A_gn_config + 1) #set($CV_Antrieb_A_gn_paire = $CV_Antrieb_A_gn_pulse + 1) #set($CV_Antrieb_A_rt_config = $CVoffset + $CVs_perPort * $pairAntrieb_A_rt) #set($CV_Antrieb_A_rt_pulse = $CV_Antrieb_A_rt_config + 1) #set($CV_Antrieb_A_rt_paire = $CV_Antrieb_A_rt_pulse + 1) #set($CV_Antrieb_B_gn_config = $CVoffset + $CVs_perPort * $pairAntrieb_B_gn) #set($CV_Antrieb_B_gn_pulse = $CV_Antrieb_B_gn_config + 1) #set($CV_Antrieb_B_gn_paire = $CV_Antrieb_B_gn_pulse + 1) #set($CV_Antrieb_B_rt_config = $CVoffset + $CVs_perPort * $pairAntrieb_B_rt) #set($CV_Antrieb_B_rt_pulse = $CV_Antrieb_B_rt_config + 1) #set($CV_Antrieb_B_rt_paire = $CV_Antrieb_B_rt_pulse + 1) ### ### -------------- set Parameters for Ports #set($switchDelay = 5) #set($portPulse = 100) #set($portConfig = 11) #set($Delay = $portPulse + 1) ### ### -------------- Set CV values ### set CV $CV_Antrieb_A_gn_config $portConfig set CV $CV_Antrieb_A_gn_pulse $portPulse set CV $CV_Antrieb_A_gn_paire $pairAntrieb_A_rt set CV $CV_Antrieb_A_rt_config $portConfig set CV $CV_Antrieb_A_rt_pulse $portPulse set CV $CV_Antrieb_A_rt_paire $pairAntrieb_A_gn set CV $CV_Antrieb_B_gn_config $portConfig set CV $CV_Antrieb_B_gn_pulse $portPulse set CV $CV_Antrieb_B_gn_paire $pairAntrieb_B_rt set CV $CV_Antrieb_B_rt_config $portConfig set CV $CV_Antrieb_B_rt_pulse $portPulse set CV $CV_Antrieb_B_rt_paire $pairAntrieb_B_gn ### ### -------------- 3. execute part of the script ### #set($macro0 = $my_macro) ### need some additional macros #set($macro1 = $macro0 + 1) ### need some additional macros #set($macro2 = $macro0 + 2) ### need some additional macros ######################################## ### Setzt label, wenn ${prevent_replace_labels} NICHT true #if (!${prevent_replace_labels}) ### ### Set label of Ports set switch ${Antrieb_A_gn} name="${AccessoryName}_${my_accessory}_${Antrieb_A_gn}_A_green" set switch ${Antrieb_A_rt} name="${AccessoryName}_${my_accessory}_${Antrieb_A_rt}_A_red" set switch ${Antrieb_B_gn} name="${AccessoryName}_${my_accessory}_${Antrieb_B_gn}_B_green" set switch ${Antrieb_B_rt} name="${AccessoryName}_${my_accessory}_${Antrieb_B_rt}_B_red" ### Set label of Macro set macro ${macro0} name="${AccessoryName}_${my_accessory}_rechts" set macro ${macro1} name="${AccessoryName}_${my_accessory}_gerade" set macro ${macro2} name="${AccessoryName}_${my_accessory}_links" ### Set label of Accessories set accessory ${my_accessory} name="${AccessoryName}_${my_accessory}" #end ######################################## ################################################/ ### Macro turn right ### select macro ${macro0} config macro repeat=1 slowdown=1 ### stop the other macros add step ptype=macro action=stop number=${macro1} add step ptype=macro action=stop number=${macro2} ### All powerports off add step ptype=switch action=off number=${Antrieb_A_gn} add step ptype=switch action=off number=${Antrieb_A_rt} add step ptype=switch action=off number=${Antrieb_B_gn} add step ptype=switch action=off number=${Antrieb_B_rt} ### ### turn right add step ptype=switch action=on number=${Antrieb_A_rt} add step delay=${switchDelay} ptype=switch action=on number=${Antrieb_B_gn} add step delay=${Delay} ptype=delay ### ### End Macro turn right ### ################################################/ ################################################/ ### Macro straight ### select macro ${macro1} config macro repeat=1 slowdown=1 ### stop the other macros add step ptype=macro action=stop number=${macro0} add step ptype=macro action=stop number=${macro2} ### All powerports off add step ptype=switch action=off number=${Antrieb_A_gn} add step ptype=switch action=off number=${Antrieb_A_rt} add step ptype=switch action=off number=${Antrieb_B_gn} add step ptype=switch action=off number=${Antrieb_B_rt} ### ### turn straight add step ptype=switch action=on number=${Antrieb_B_gn} add step delay=${switchDelay} ptype=switch action=on number=${Antrieb_A_gn} add step delay=${Delay} ptype=delay ### ### End Macro straight ### ################################################/ ################################################/ ### Macro turn left ### select macro ${macro2} config macro repeat=1 slowdown=1 ### stop the other macros add step ptype=macro action=stop number=${macro0} add step ptype=macro action=stop number=${macro1} ### All powerports off add step ptype=switch action=off number=${Antrieb_A_gn} add step ptype=switch action=off number=${Antrieb_A_rt} add step ptype=switch action=off number=${Antrieb_B_gn} add step ptype=switch action=off number=${Antrieb_B_rt} ### ### turn left add step ptype=switch action=on number=${Antrieb_A_gn} add step delay=${switchDelay} ptype=switch action=on number=${Antrieb_B_rt} add step delay=${Delay} ptype=delay ### ### End Macro turn left ### ################################################/ ### Define Accessory select accessory ${my_accessory} config accessory startup aspect=1 add aspect 0 macroname="${AccessoryName}_${my_accessory}_rechts" add aspect 1 macroname="${AccessoryName}_${my_accessory}_gerade" add aspect 2 macroname="${AccessoryName}_${my_accessory}_links"




© 2015 - 2024 Weber Informatics LLC | Privacy Policy