Difference between revisions of "Component: Port Matrix (Misc)"
From Flowcode Help
Jump to navigationJump to searchLine 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Port_Matrix.fcfx FC_Comp_Source_Port_Matrix.fcfx] |
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 32: | Line 34: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Line 50: | Line 54: | ||
==Macro reference== | ==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;" | '''BarGraph''' | ||
+ | |- | ||
+ | | colspan="2" | Turns on the first N pins of the array - for generating bar graph meters etc. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Length | ||
+ | |- | ||
+ | | colspan="2" | How many pins to enable. | ||
+ | |- | ||
+ | | 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;" | '''AllOn''' | ||
+ | |- | ||
+ | | colspan="2" | Turn on all of the pins in the array (unused port pins are unaffected) | ||
+ | |- | ||
+ | |- | ||
+ | | 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;" | '''PinOn''' | ||
+ | |- | ||
+ | | colspan="2" | Turn on the selected pin of the port. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | Index of the pin to set within the port. | ||
+ | |- | ||
+ | | 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;" | '''PinOff''' | ||
+ | |- | ||
+ | | colspan="2" | Turn off the chosen pin of the port. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | Index of the pin to set within the port. | ||
+ | |- | ||
+ | | 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;" | '''PinToggle''' | ||
+ | |- | ||
+ | | colspan="2" | Toggles the state of the selected pin of the port. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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;" | '''GetPin''' | ||
+ | |- | ||
+ | | colspan="2" | Read the state of the selected pin of the port. Returns false if the index is out of range (0..7) | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | Index of the pin to read. | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | 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;" | '''GetHandle''' | ||
+ | |- | ||
+ | | colspan="2" | Retrieves the object handle of the indexed clone. Returns zero for out of range indexes. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | Index of the object to get a handle for. | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE | ||
+ | | 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;" | '''AllOff''' | ||
+ | |- | ||
+ | | colspan="2" | Turn off all used pins of the port (unused port pins are unaffected) | ||
+ | |- | ||
+ | |- | ||
+ | | 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;" | ||
+ | |- | ||
+ | | 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;" | Simulation | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-17-icon.png]] | ||
+ | | width="90%" | Target Object | ||
+ | |- | ||
+ | | colspan="2" | Choose an object that will be duplicated for each required pin of the chosen port. The object should have a property called 'pin' to which the pins of the port will automatically be attached. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Count | ||
+ | |- | ||
+ | | colspan="2" | Number of objects in the matrix. They will be assigned pins from the chosen port sequentially, beginning with pin0. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Alignment | ||
+ | |- | ||
+ | | colspan="2" | Which 3D axis the cloned objects will be arranged along. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-15-icon.png]] | ||
+ | | width="90%" | Spacing | ||
+ | |- | ||
+ | | colspan="2" | The distance between cloned objects in the matrix. | ||
+ | |- | ||
+ | | 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-4-icon.png]] | ||
+ | | width="90%" | Port | ||
+ | |- | ||
+ | | colspan="2" | Choose a port to connect the matrix of objects to. Each will be assigned a single pin of the port automatically by the Port Matrix component. | ||
+ | |}==Macro reference== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
Revision as of 15:16, 20 January 2023
Author | Matrix Ltd |
Version | 1.1 |
Category | Misc |
Contents
Port Matrix component
Create an accurately spaced array of up to eight components, each corresponding to a pin of the chosen port. If the cloned component has a property called 'pin', this will be set the the corresponding pin of the matrix port, and the component will behave as if it were connected directly to that pin. If there are less than eight clones, the unused upper bits of the port will be masked out to allow them to be used by other components.
Component Source Code
Please click here to view the component source code (Beta): FC_Comp_Source_Port_Matrix.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Industrial Tanks
A simple example showing the hoppers, valves and pipes working together. Each tank automatically empties in turn.
Macro reference
![]() |
BarGraph |
Turns on the first N pins of the array - for generating bar graph meters etc. | |
![]() |
Length |
How many pins to enable. | |
![]() |
Return |
![]() |
AllOn |
Turn on all of the pins in the array (unused port pins are unaffected) | |
![]() |
Return |
![]() |
PinOn |
Turn on the selected pin of the port. | |
![]() |
Index |
Index of the pin to set within the port. | |
![]() |
Return |
![]() |
PinOff |
Turn off the chosen pin of the port. | |
![]() |
Index |
Index of the pin to set within the port. | |
![]() |
Return |
![]() |
PinToggle |
Toggles the state of the selected pin of the port. | |
![]() |
Index |
![]() |
Return |
![]() |
GetPin |
Read the state of the selected pin of the port. Returns false if the index is out of range (0..7) | |
![]() |
Index |
Index of the pin to read. | |
![]() |
Return |
![]() |
GetHandle |
Retrieves the object handle of the indexed clone. Returns zero for out of range indexes. | |
![]() |
Index |
Index of the object to get a handle for. | |
![]() |
Return |
![]() |
AllOff |
Turn off all used pins of the port (unused port pins are unaffected) | |
![]() |
Return |
Property reference
==Macro reference==
![]() |
BarGraph |
Turns on the first N pins of the array - for generating bar graph meters etc. | |
![]() |
Length |
How many pins to enable. | |
![]() |
Return |
![]() |
AllOn |
Turn on all of the pins in the array (unused port pins are unaffected) | |
![]() |
Return |
![]() |
PinOn |
Turn on the selected pin of the port. | |
![]() |
Index |
Index of the pin to set within the port. | |
![]() |
Return |
![]() |
PinOff |
Turn off the chosen pin of the port. | |
![]() |
Index |
Index of the pin to set within the port. | |
![]() |
Return |
![]() |
PinToggle |
Toggles the state of the selected pin of the port. | |
![]() |
Index |
![]() |
Return |
![]() |
GetPin |
Read the state of the selected pin of the port. Returns false if the index is out of range (0..7) | |
![]() |
Index |
Index of the pin to read. | |
![]() |
Return |
![]() |
GetHandle |
Retrieves the object handle of the indexed clone. Returns zero for out of range indexes. | |
![]() |
Index |
Index of the object to get a handle for. | |
![]() |
Return |
![]() |
AllOff |
Turn off all used pins of the port (unused port pins are unaffected) | |
![]() |
Return |