Author
|
Matrix Ltd
|
Version
|
1.2
|
Category
|
Sensors
|
Proximity Switch Template component
Polls a chosen panel object to test it's distance from this component. When the test object is within the detection range, the state of a pin is changed, and a User event generated. Used for building models of reed swicthes and hall sensors.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Proximity_base.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Proximity_base.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Simple example showing the proximity detector component at work, when a proximity is detected the direction of the motor is reversed.
Detector
Macro reference
ReadState
|
ReadState
|
Get the current collision state. The 'Polarity' property will affect whether a collision is represented by a high or low state.
|
- BYTE
|
Return
|
SetTarget
|
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!!
|
- HANDLE
|
Target
|
The object to test for collision with.
|
- VOID
|
Return
|
WaitUntilHigh
|
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!!
|
- VOID
|
Return
|
WaitUntilLow
|
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!!
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Connections
|
|
Pin
|
The chip pin that will receive the switch state.
|
|
Polarity
|
Select the state that the switch will take when an object triggers the switch.
|
|
Simulation
|
|
Datum 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
|
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
|
Choose an object within the component that the user can click on to activate the switch for testing purposes.
|
|
Detector Ident
|
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)
|
Time in milliseconds between testing for proximity. Small time = Greater CPU load Large time = More like to miss activation if it is very brief.
|