Difference between revisions of "Component: Beam Breaker (Light)"

From Flowcode Help
Jump to navigationJump to search
 
(6 intermediate revisions by the same user not shown)
Line 17: Line 17:
 
==Component Source Code==
 
==Component Source Code==
  
Please click here to download the component source project: [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]
 
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]
Line 29: Line 29:
  
  
''No detailed description exists yet for this component''
 
  
==Examples==
 
  
  
Line 37: Line 35:
  
  
 +
''No detailed description exists yet for this component''
  
 +
==Examples==
  
''<span style="color:red;">No additional examples</span>''
 
  
==Macro reference==
 
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
 
| width="90%" | Target
 
|-
 
| colspan="2" | The object to test for collision with.&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
  
  
==Property reference==
 
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
''<span style="color:red;">No additional examples</span>''
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Pin
 
|-
 
| colspan="2" | Chip pin that the beam breaker is connected to,.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Polarity
 
|-
 
| 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="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Target
 
|-
 
| colspan="2" | 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!!&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Range
 
|-
 
| colspan="2" | Set the distance between the transmitter and receiver&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Show Beam
 
|-
 
| colspan="2" | Shows the 'light beam' on screen - arrow points from transmitter to receiver.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | Timer Interval (ms)
 
|-
 
| 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="90%" style="background-color:#EAE1EA; color:#4B008D;" | Notification
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Notify
 
|-
 
| colspan="2" | Whether or not to notify the component parent of any changes. Data will be zero or one (the current pin value).&nbsp;
 
|}==Macro reference==
 
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
 
| width="90%" | Target
 
|-
 
| colspan="2" | The object to test for collision with.&nbsp;
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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;
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
  
  
==Property reference==
+
==Macro reference==
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Pin
 
|-
 
| colspan="2" | Chip pin that the beam breaker is connected to,.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Polarity
 
|-
 
| 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="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Target
 
|-
 
| colspan="2" | 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!!&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
| width="90%" | Range
 
|-
 
| colspan="2" | Set the distance between the transmitter and receiver&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Show Beam
 
|-
 
| colspan="2" | Shows the 'light beam' on screen - arrow points from transmitter to receiver.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | Timer Interval (ms)
 
|-
 
| 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="90%" style="background-color:#EAE1EA; color:#4B008D;" | Notification
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Notify
 
|-
 
| colspan="2" | Whether or not to notify the component parent of any changes. Data will be zero or one (the current pin value).&nbsp;
 
|}==Macro reference==
 
  
 +
===ReadState===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 286: Line 79:
  
  
 +
===SetTarget===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 304: Line 98:
  
  
 +
===WaitUntilHigh===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 317: Line 112:
  
  
 +
===WaitUntilLow===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 328: Line 124:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  

Latest revision as of 13:08, 7 February 2023

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

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
Chip pin that the beam breaker is connected to,. 
Fc9-type-16-icon.png 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. 
Fc9-conn-icon.png Simulation
Fc9-type-17-icon.png 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!! 
Fc9-type-15-icon.png Range
Set the distance between the transmitter and receiver 
Fc9-type-7-icon.png Show Beam
Shows the 'light beam' on screen - arrow points from transmitter to receiver. 
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 or not to notify the component parent of any changes. Data will be zero or one (the current pin value).