-
Notifications
You must be signed in to change notification settings - Fork 331
/
Sensors.shtml
210 lines (169 loc) · 8 KB
/
Sensors.shtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 31 October 2006 - Apple Inc. build 15.17), see www.w3.org">
<title>JMRI: Sensors Documentation</title>
<meta name="Author" content="Bob Jacobsen">
<meta name="keywords" content=
"sensor model railroad JMRI decoderpro panelpro">
<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii">
<!--#include virtual="/Style" -->
</head>
<body>
<div id="container">
<!--#include virtual="/Header.shtml" -->
<div id="mBody">
<!--#include virtual="Sidebar.shtml" -->
<div id="mainContent">
<h1>JMRI: Sensors Documentation</h1>
<h2>What are Sensors?</h2>
<p>A Sensor is JMRI's way of representing an input from the
layout.</p>
<p>JMRI uses a Sensor to represent the status of a block
occupancy detector, or a pushbutton on the fascia, or just
about anything else you can attach to an input on your DCC
or C/MRI system.</p>
<h3>Controlling a Sensor</h3>
<p>Generally, you don't control the state of a Sensor
object; JMRI, working with the hardware on your layout,
does.</p>
<p>But there are some occasions where you might like to
locally change the state of a Sensor: To debug some logic
that uses the Sensor as an input, etc. It can be very
convenient to temporarily change how a Sensor is set
without having to run out to the layout and push a button
or put a locomotive in a block.</p>
<p>Therefore, JMRI lets you change a Sensor via the Sensor
Table (see below), or by clicking on a sensor icon on a
panel (See the <a href=
"../apps/PanelPro/index.shtml">PanelPro pages</a> for
more on Panels).</p>
<p>The change takes effect immediately, unless a debounce
timer is configured (see below), but only lasts until the
next time you change it in the program, or the next time
the input hardware on the layout changes the value.</p>
<h2>Sensor Properties</h2>
<h3><a name="Debounce" id="Debounce"></a>Sensor
Debounce Delay</h3>
<p>The Sensor Debounce Delay facility is there to help prevent
false triggers of a Sensor being passed into the system and
triggering other events in the system.<br>
Such false triggers could be due to a dirty piece of track
or electrical interference.</p>
<p>The facility allows you to assign a delay in
milliseconds before the change is registered with the rest
of the system. If after that period the state has not
changed compared to the original state, the Sensor state will
be passed onto the rest the of the system.<br>
However if the Sensor's state is different after the delay
has passed, then the system will restart the process,
this time after the timer has finished it will check to see
if the sensor state is in the same state as it was before
it restarted the process. If not the process is re-started
again until the state is the same before and after the
delay has passed.</p>
<h2>How to set up Sensors</h2>
<h3>The Sensor Table</h3>Sensors can be viewed and
configured using the <a href=
"../../package/jmri/jmrit/beantable/SensorTable.shtml">Sensor
Table</a>. It contains the following columns:
<ul>
<li>System Name</li>
<li>User Name (optional)</li>
<li>State (either Active, Inactive, Inconsistent or - at
first - Unknown</li>
<li>Comment (optional, double click to edit)</li>
<li>Inverted (checkbox)</li>
</ul>
<h3>Sensor Table Controls</h3>
<p>Below the table is the <b>Add...</b> button<br>
and a check box to <b>Show Sensor Debounce
Information</b></p>
<p>The <b>Defaults</b> menu allows you to set 2 system wide
settings:</p>
<ul>
<li>Global Debounce Delay</li>
<li>Initial Sensor State</li>
</ul>
<h3>Saving Sensors to disk</h3>
<p>Sensors are kept in your <i>layout configuration</i>,
along with Turnouts, Lights, Signal Heads, control panel
setup etc. To store this information on disk, allowing to
<a href="../../package/jmri/jmrit/display/PanelMenuHelp.shtml">reload
it</a> next time you run JMRI, use <b>Store Configuration...</b>
in the <b>File</b> menu at the top of the Sensor Table (or
other tables from the Tools menu), or select <b>Store
Panel...</b> in the <b>Panel</b> menu.</p>
<a name="add" id="add"></a>
<h3>Adding a new Sensor</h3>
<p>To create a new Sensor, follow this procedure:</p>
<ol>
<li>
<p>Click the <b>Tools</b> -> <b>Tables</b> ->
<b>Sensors</b> menu to bring up the <a href=
"../../package/jmri/jmrit/beantable/SensorTable.shtml">Sensor
Table</a> pane. Next, click the <a href=
"../../package/jmri/jmrit/beantable/SensorAddEdit.shtml">
<b>Add...</b></a> button at the bottom of the pane to
bring up the Add/Edit Sensor window.</p>
</li>
<li>
<p>From the <b>System</b> drop down list select the
system to which the Sensor is connected. In the
<b>Hardware Address</b> field enter the <a href=
"../doc/Technical/Names.shtml#systeminfo">hardware
address of the input connection</a> being
referenced.<br>
The format of the Hardware Address can often be made in
the format of "board:channel" or "Cab Address:Pin"; you
will need to confirm the specifics of each system's
<a href=
"../doc/Technical/Names.shtml#systeminfo">Naming
Rules</a>.</p>
</li>
<li>
<p>Enter a User Name for the Sensor. Any string of
characters that is different from the User Name of
other Sensors will be accepted, but it's wise to use a
string that describes the intended use of the Sensor.
You can leave this field blank if you'd like.</p>
</li>
<li>
<p>If you wish to add a number of Sensors at once,
click on the <b>Add a Range</b> checkbox and then in
the <b>Number to Add</b> field enter the number of
Sensors that you wish to add. If you have entered a
User Name, then this will be appended with a number to
ensure that each User Name is unique. If a hardware
address already exists in the Sensors range that is
being added, then JMRI will skip that address and carry
on.</p>
</li>
<li>
<p>Click the <b>OK</b> button at the bottom of the
pane. If everything is fine, a message stating "New
Sensor added..." will be displayed in the notes area.
If there is trouble with anything, an error or warning
message will be displayed in the notes area; you should
then correct the error and click <b>OK</b> again.</p>
</li>
<li>
<p>Back in the main Sensor Table, you can then see the
current status of the Sensor.</p>
</li>
</ol>
<h3>Sensor Groups</h3>
<p>A group of sensors of which at most one can be active.
When a member of the group becomes active, all others are set to inactive.</p>
<p>Sensor Groups are configured via the <a
href="../../package/jmri/jmrit/sensorgroup/SensorGroupFrame.shtml"
>Sensor Group Tool</a>.</p>
<!--#include virtual="/Footer.shtml" -->
</div><!-- closes #mainContent-->
</div><!-- closes #mBody-->
</div><!-- closes #container -->
</body>
</html>