Component: Switch (Microswitch) (Switch)

From Flowcode Help
Jump to navigationJump to search
Author Matrix Ltd
Version 1.2
Category Switch


Switch (Microswitch) component

Industry standard V3 size microswitch fitter with a roller arm - activated by other panel objects coming into contact with the roller. Changes the state of a chip pin, and sends a simulation notification message when its state changes.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_sw_micro_roller.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_sw_micro_roller.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples






Macro reference

ReadState

Fc9-comp-macro.png ReadState
Get the current collision state. The 'Polarity' property will affect whether a collision is represented by a high or low state. 
Fc9-u8-icon.png - BYTE Return


SetTarget

Fc9-comp-macro.png 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!! 
Fc9-h32-icon.png - HANDLE Target
The object to test for collision with. 
Fc9-void-icon.png - VOID Return


WaitUntilHigh

Fc9-comp-macro.png 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!! 
Fc9-void-icon.png - VOID Return


WaitUntilLow

Fc9-comp-macro.png 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!! 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Connections
Fc9-type-5-icon.png Pin
The chip pin that will change state when the switch is activated. 
Fc9-type-16-icon.png Polarity
The state that the pin should take when the switch is pressed. 
Fc9-conn-icon.png Simulation
Fc9-type-17-icon.png Target Object
Choose a specific other object to test for collision with. If left unconnected, the test object will be tested against every object on the panel. Choose a specific object to check against wherever possible - checking all objects requires much more time and computing power! 
Fc9-type-21-icon.png Timer Interval (ms)
Time in milliseconds between collision scans. Small time = Greater CPU load Large time = More like to miss brief collisions. 
Fc9-conn-icon.png Notification
Fc9-type-7-icon.png Notify
Whether to send a notification event to the component's parent. When enabled, set a message ID below to aid identification of events. Data will be one or zero, representing the microswitch state.