开云体育

two scripts using one sensor


 

Can two scripts use the same sensor?
?
Sure i can include then in one script, but just asking.
?
I have one scripted finished controlling signals.
?
The other script I want to control the room lights, the sensor with trigger and API to turn on the room lights.


 

I use one to many connections for logic and scripts.
The only caveat is when you want multiple block connections.
For one to many block connections, I need to create more sensors and set those sensor states from the source with Logix or LogixNG.
--
Ken
NYNH&H, Old Colony Division, Cape Cod Branch (1949-1959)
Loconet * JMRI 5.11.4 * OSX,Win10,Ubuntu
Blog: ?
Youtube:


 

Canadian Locomotive Logistics (for lack of better info),
?
You have provided an open ended question, so the responses are going be like shotgun scatter guessing.
?
On Sun, Mar 30, 2025 at 06:59 PM, Canadian Locomotive Logistics wrote:
Can two scripts use the same sensor?
?
Sometimes, but circumstances and context are needed to make that decision.
?
?
Sure i can include then in one script, but just asking.
?
What is the reason behind this ask.? What are you intending to do and why??
?
Are you asking about Internal Sensors or DCC Hardware Sensors?
?
?
I have one scripted finished controlling signals.
?
Does this mean that there is a specific need for some sensor related to the control of your signals during the operation of trains that in turn controls the dynamic state of one or all of your signals??
?
Or does it mean that some sensor is dedicated to recognizing the startup condition and the state is changed to indicate when the initialization has been completed??
?
Or perhaps some other condition or status that we are not likely to surmise???
?
?
The other script I want to control the room lights, the sensor with trigger and API to turn on the room lights.
?
What is the relationship between controlling signals and controlling room lights??
?
Is there some timing constraint involved for the completion of one task before the initialization of some other task or am I missing the point altogether?
?
Or is there some need to limit the number of sensors of a particular type?? Back to internal vs hardware question.??
?
Also, since I am acronym adverse, double checking that API means "Application Programing Interface " in this context.??
?
Any clarification or other context details will be helpful for further replies.
?
Cliff in Baja SoCal
?


 

I have one script that uses sensors, NCE DB20 with AUI, to trigger the signals. Thanks to Dave,
?
I have LIFX strip lighting in my train room, and want to use the same sensor or getting yet, when my webthrottle pages is loaded up.
One step at the time.


 

I ended up using javascript to turn the room lights on when then webthrottle.html page is loaded by a user. The room light go off automatically is 10 minutes.?

long enough for a remote user to to have a spin around my layout.?