Difference between revisions of "Component: Proximity switch base (Inputs)"
(XML import) |
(XML import) |
||
Line 15: | Line 15: | ||
− | ==[[ | + | ==[[File:Component Icon 92b44587_a7a8_444f_abe6_93e5d1669bc6.png|Image]] Proximity switch base component== |
Polls a chosen panel object to test it's distance from the component. | Polls a chosen panel object to test it's distance from the component. | ||
When the test object is within the detection range, the state of a pin is changed, and | When the test object is within the detection range, the state of a pin is changed, and | ||
Line 24: | Line 24: | ||
This component can be used as a base to create ''child'' components | This component can be used as a base to create ''child'' components | ||
− | [[ | + | [[File:Component Icon 1c8bc72f_4944_4456_af99_9686c237d6b3.png|Image]] The component Reed Switch is inherited from this. |
==Examples== | ==Examples== |
Revision as of 13:05, 16 January 2014
Author | Matrix Ltd |
Version | 1.1 |
Category | Inputs |
Contents
Proximity switch base component
Polls a chosen panel object to test it's distance from the component. When the test object is within the detection range, the state of a pin is changed, and a User event generated. User for building models of reed swicthes and hall sensors.
This component can be used as a base to create child components
The component Reed Switch is inherited from this.
Examples
No additional examples
Downloadable macro reference
ReadState
Get the current collision state.
The 'Polarity' property will affect whether a collision is represented by a high
or low state.
Parameters
- This macro has no parameters
Return value
WaitUntilHigh
Pause the program until the detector goes high.
'Polarity' will affect whether high value represents a collision or separation.
NB) In simulation, only use this macro if testing for collision with animated or
timer driven objects!!
Parameters
- This macro has no parameters
Return value
- This call does not return a value
WaitUntilLow
Pause the program until the detector goes low.
'Polarity' will affect whether low value represents a collision or separation.
NB) In simulation, only use this macro if testing for collision with animated or
timer driven objects!!
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Simulation macro reference
SetTarget
Set the object that you want to test for collision with.
If this is not called, or is called with handle = 0, collisions will be tested against
every panel object that has 'Solid' status.
NB) Specifying an object will save CPU power!!
Parameters
- HANDLE Target
- The object to test for collision with.
Return value
- This call does not return a value
Property reference
Pin
This property is of type Single digital pin and can be referenced with the variable name pin.
No additional information
Polarity
This property is of type Fixed list of ints and can be referenced with the variable name polarity.
No additional information
Datum Object
This property is of type Panel object and can be referenced with the variable name test_object.
The object within the component from which the distance to the target object will be measured.
If not set, the centre of the component as a whole will be assumed.
Range
This property is of type Floating point and can be referenced with the variable name range.
Distance within which the switch is activated.
NB) This is measured between the centre of the proximity switch and the centre of the target object.
Mouse Object
This property is of type Panel object and can be referenced with the variable name mouse_object.
Choose an object within the component that the user can click on to activate the switch for testing purposes.
Detector Ident
This property is of type Unsigned integer and can be referenced with the variable name event_id.
An ID value to identify this particular detector. Will be sent as the 'Ident' value for the notification
events sent out so that multiple detectors can be told apart.
The event value will be 1 for actiavted and 0 for de-activated,
Timer Interval (ms)
This property is of type Unsigned integer and can be referenced with the variable name timer_int.
Time in milliseconds between testing for proximity.
Small time = Greater CPU load
Large time = More like to miss activation if it is very brief.