Jump to content

Component: Beam Breaker (Light): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(14 intermediate revisions by 2 users not shown)
Line 17: Line 17:
==Component Source Code==
==Component Source Code==


Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_Beam_breaker.fcfx FC_Comp_Source_Beam_breaker.fcfx]
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Beam_breaker.fcfx FC_Comp_Source_Beam_breaker.fcfx]
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Beam_breaker.fcfx FC_Comp_Source_Beam_breaker.fcfx]


==Detailed description==
==Detailed description==




Line 26: Line 38:


==Examples==
==Examples==






''<span style="color:red;">No additional examples</span>''
''<span style="color:red;">No additional examples</span>''


==Macro reference==
==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ReadState===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadState'''
| width="90%" class="mtx-class-macrohead" | '''ReadState'''
|-
|-
| colspan="2" | Get the current collision state. The 'Polarity' property will affect whether a collision is represented by a high or low state.&nbsp;
| colspan="2" | Get the current collision state. The 'Polarity' property will affect whether a collision is represented by a high or low state.&nbsp;
Line 46: Line 79:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetTarget===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTarget'''
| width="90%" class="mtx-class-macrohead" | '''SetTarget'''
|-
|-
| colspan="2" | 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!!&nbsp;
| colspan="2" | 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!!&nbsp;
Line 64: Line 98:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===WaitUntilHigh===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WaitUntilHigh'''
| width="90%" class="mtx-class-macrohead" | '''WaitUntilHigh'''
|-
|-
| colspan="2" | 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!!&nbsp;
| colspan="2" | 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!!&nbsp;
Line 77: Line 112:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===WaitUntilLow===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WaitUntilLow'''
| width="90%" class="mtx-class-macrohead" | '''WaitUntilLow'''
|-
|-
| colspan="2" | 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!!&nbsp;
| colspan="2" | 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!!&nbsp;
Line 88: Line 124:
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
| 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%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
| width="90%" class="mtx-class-propfolder" | Connections
|-
|-
|-
|-
Line 114: Line 148:
| colspan="2" | Active High = Pin is on when beam is broken, off when beam is intact. Active Low = Pin is off when beam is broken, on when beam is intact.&nbsp;
| colspan="2" | Active High = Pin is on when beam is broken, off when beam is intact. Active Low = Pin is off when beam is broken, on when beam is intact.&nbsp;
|-
|-
| 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%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
|-
|-
Line 138: Line 172:
| colspan="2" | Time in milliseconds between collision scans. Small time = Greater CPU load Large time = More like to miss brief collisions.&nbsp;
| colspan="2" | Time in milliseconds between collision scans. Small time = Greater CPU load Large time = More like to miss brief collisions.&nbsp;
|-
|-
| 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%" style="background-color:#EAE1EA; color:#4B008D;" | Notification
| width="90%" class="mtx-class-propfolder" | Notification
|-
|-
|-
|-

Latest revision as of 14:36, 13 July 2026

Author Matrix Ltd
Version 1.1
Category Light


Beam Breaker component

Automatically sets and resets a pin depending on whether a panel object breaks the 'light beam'. Can also send simulation notification events.

Component Source Code

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

Please click here to view the component source code (Beta): FC_Comp_Source_Beam_breaker.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
Chip pin that the beam breaker is connected to,. 
Polarity
Active High = Pin is on when beam is broken, off when beam is intact. Active Low = Pin is off when beam is broken, on when beam is intact. 
Simulation
Target
Choose a specific object to test for breaking the beam. If none is chosen, will check against any other object with 'Solid' status - note, checking all objects increases the CPU load!! 
Range
Set the distance between the transmitter and receiver 
Show Beam
Shows the 'light beam' on screen - arrow points from transmitter to receiver. 
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 or not to notify the component parent of any changes. Data will be zero or one (the current pin value).