Jump to content

Component: Switch (Microswitch) (Switch): Difference between revisions

From Flowcode Help
m Text replacement - "style="background-color:#EAE1EA; color:#4B008D;"" to "class="mtx-class-propfolder""
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
Line 138: Line 138:
|-
|-
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | Connections
| width="90%" class="mtx-class-propfolder" | Connections
|-
|-
Line 152: Line 152:
| colspan="2" | The state that the pin should take when the switch is pressed. 
| colspan="2" | The state that the pin should take when the switch is pressed. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
Line 166: Line 166:
| colspan="2" | Time in milliseconds between collision scans. Small time = Greater CPU load Large time = More like to miss brief collisions. 
| colspan="2" | Time in milliseconds between collision scans. Small time = Greater CPU load Large time = More like to miss brief collisions. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | Notification
| width="90%" class="mtx-class-propfolder" | Notification
|-
|-

Latest revision as of 14:37, 13 July 2026

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

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 change state when the switch is activated. 
Polarity
The state that the pin should take when the switch is pressed. 
Simulation
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! 
Timer Interval (ms)
Time in milliseconds between collision scans. Small time = Greater CPU load Large time = More like to miss brief collisions. 
Notification
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.