<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.flowcode.co.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Component%3A_Proximity_Analog_Template_%28Sensors%29</id>
	<title>Component: Proximity Analog Template (Sensors) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.flowcode.co.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Component%3A_Proximity_Analog_Template_%28Sensors%29"/>
	<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Component:_Proximity_Analog_Template_(Sensors)&amp;action=history"/>
	<updated>2026-04-05T19:45:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://www.flowcode.co.uk/wiki/index.php?title=Component:_Proximity_Analog_Template_(Sensors)&amp;diff=21491&amp;oldid=prev</id>
		<title>BenR: XML import</title>
		<link rel="alternate" type="text/html" href="https://www.flowcode.co.uk/wiki/index.php?title=Component:_Proximity_Analog_Template_(Sensors)&amp;diff=21491&amp;oldid=prev"/>
		<updated>2018-05-09T10:31:34Z</updated>

		<summary type="html">&lt;p&gt;XML import&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;50%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; style=&amp;quot;color: gray;&amp;quot; | Author&lt;br /&gt;
| Matrix Ltd&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; style=&amp;quot;color: gray;&amp;quot; | Version&lt;br /&gt;
| 1.2 (Release)&lt;br /&gt;
|-&lt;br /&gt;
| width=&amp;quot;20%&amp;quot; style=&amp;quot;color: gray;&amp;quot; | Category&lt;br /&gt;
| Sensors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[File:Component Icon 34acebbe_e6e3_4284_94d1_ce0b77dd8083.png|Image]] Proximity Analog Template component==&lt;br /&gt;
Polls a chosen panel object to test it's distance from this component.&lt;br /&gt;
When the test object is within the detection range, the state of a pin is changed, and&lt;br /&gt;
a User event generated.&lt;br /&gt;
Used for building models of reed swicthes and hall sensors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
''&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;No additional examples&amp;lt;/span&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Downloadable macro reference==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;font-weight: normal;&amp;quot;&amp;gt;&amp;lt;u&amp;gt;&amp;lt;tt&amp;gt;ReadState&amp;lt;/tt&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;===&lt;br /&gt;
Get the current collision state.&lt;br /&gt;
&lt;br /&gt;
The 'Polarity' property will affect whether a collision is represented by a high&lt;br /&gt;
&lt;br /&gt;
or low state.&lt;br /&gt;
&lt;br /&gt;
'''Parameters'''&lt;br /&gt;
&lt;br /&gt;
:''This macro has no parameters''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Return value'''&lt;br /&gt;
&lt;br /&gt;
:[[Variable Types|BYTE]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;font-weight: normal;&amp;quot;&amp;gt;&amp;lt;u&amp;gt;&amp;lt;tt&amp;gt;WaitUntilHigh&amp;lt;/tt&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;===&lt;br /&gt;
Pause the program until the detector goes high.&lt;br /&gt;
&lt;br /&gt;
 'Polarity' will affect whether high value represents a collision or separation.&lt;br /&gt;
&lt;br /&gt;
NB) In simulation, only use this macro if testing for collision with animated or&lt;br /&gt;
&lt;br /&gt;
timer driven objects!!&lt;br /&gt;
&lt;br /&gt;
'''Parameters'''&lt;br /&gt;
&lt;br /&gt;
:''This macro has no parameters''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Return value'''&lt;br /&gt;
&lt;br /&gt;
:''This call does not return a value''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;font-weight: normal;&amp;quot;&amp;gt;&amp;lt;u&amp;gt;&amp;lt;tt&amp;gt;WaitUntilLow&amp;lt;/tt&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;===&lt;br /&gt;
Pause the program until the detector goes low.&lt;br /&gt;
&lt;br /&gt;
 'Polarity' will affect whether low value represents a collision or separation.&lt;br /&gt;
&lt;br /&gt;
NB) In simulation, only use this macro if testing for collision with animated or&lt;br /&gt;
&lt;br /&gt;
timer driven objects!!&lt;br /&gt;
&lt;br /&gt;
'''Parameters'''&lt;br /&gt;
&lt;br /&gt;
:''This macro has no parameters''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Return value'''&lt;br /&gt;
&lt;br /&gt;
:''This call does not return a value''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Simulation macro reference==&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;font-weight: normal;&amp;quot;&amp;gt;&amp;lt;u&amp;gt;&amp;lt;tt&amp;gt;SetTarget&amp;lt;/tt&amp;gt;&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;===&lt;br /&gt;
Set the object that you want to test for collision with.&lt;br /&gt;
&lt;br /&gt;
If this is not called, or is called with handle = 0, collisions will be tested against&lt;br /&gt;
&lt;br /&gt;
every panel object that has 'Solid' status.&lt;br /&gt;
&lt;br /&gt;
NB) Specifying an object will save CPU power!!&lt;br /&gt;
&lt;br /&gt;
'''Parameters'''&lt;br /&gt;
&lt;br /&gt;
:[[Variable Types|HANDLE]] ''Target''&lt;br /&gt;
::The object to test for collision with.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Return value'''&lt;br /&gt;
&lt;br /&gt;
:''This call does not return a value''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Property reference==&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-weight: normal;&amp;quot;&amp;gt;&amp;lt;u&amp;gt;Pin&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This property is of type ''Single digital pin'' and can be referenced with the variable name ''pin''.&lt;br /&gt;
&lt;br /&gt;
The chip pin that will receive the switch state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-weight: normal;&amp;quot;&amp;gt;&amp;lt;u&amp;gt;Polarity&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''polarity''.&lt;br /&gt;
&lt;br /&gt;
Select the state that the switch will take when an object triggers the switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-weight: normal;&amp;quot;&amp;gt;&amp;lt;u&amp;gt;Datum Object&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This property is of type ''Panel object'' and can be referenced with the variable name ''test_object''.&lt;br /&gt;
&lt;br /&gt;
The object within the component from which the distance to the target object will be measured.&lt;br /&gt;
&lt;br /&gt;
If not set, the centre of the component as a whole will be assumed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-weight: normal;&amp;quot;&amp;gt;&amp;lt;u&amp;gt;Range&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This property is of type ''Floating point'' and can be referenced with the variable name ''range''.&lt;br /&gt;
&lt;br /&gt;
Distance within which the switch is activated.&lt;br /&gt;
&lt;br /&gt;
NB)  This is measured between the centre of the proximity switch and the centre of the target object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-weight: normal;&amp;quot;&amp;gt;&amp;lt;u&amp;gt;Mouse Object&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This property is of type ''Panel object'' and can be referenced with the variable name ''mouse_object''.&lt;br /&gt;
&lt;br /&gt;
Choose an object within the component  that the user can click on to activate the switch for testing purposes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-weight: normal;&amp;quot;&amp;gt;&amp;lt;u&amp;gt;Detector Ident&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''event_id''.&lt;br /&gt;
&lt;br /&gt;
An ID value to identify this particular detector.  Will be sent as the 'Ident' value for the notification&lt;br /&gt;
&lt;br /&gt;
events sent out so that multiple detectors can be told apart.&lt;br /&gt;
&lt;br /&gt;
The event value will be 1 for actiavted and 0 for de-activated,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-weight: normal;&amp;quot;&amp;gt;&amp;lt;u&amp;gt;Timer Interval (ms)&amp;lt;/u&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''timer_int''.&lt;br /&gt;
&lt;br /&gt;
Time in milliseconds between testing for proximity.&lt;br /&gt;
&lt;br /&gt;
Small time = Greater CPU load&lt;br /&gt;
&lt;br /&gt;
Large time = More like to miss activation if it is very brief.&lt;/div&gt;</summary>
		<author><name>BenR</name></author>
		
	</entry>
</feed>