Component: Port Matrix (Misc): Difference between revisions
Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd |- | width="20%" style="color:gray;" | Version | 1.1 |- | width="20%" style="color:gray..." |
Tag: Undo |
||
| (17 intermediate revisions by 2 users not shown) | |||
| Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
Please click here | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Port_Matrix.fcfx FC_Comp_Source_Port_Matrix.fcfx] | ||
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 28: | Line 42: | ||
==Examples== | ==Examples== | ||
| Line 41: | Line 67: | ||
{{Fcfile|Industrial_Tanks.fcsx|Industrial Tanks}} | {{Fcfile|Industrial_Tanks.fcsx|Industrial Tanks}} | ||
{| class="wikitable | |||
==Macro reference== | |||
===AllOff=== | |||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''AllOff''' | ||
|- | |- | ||
| colspan="2" | | | 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="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| Line 61: | Line 93: | ||
{| class="wikitable | ===AllOn=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''AllOn''' | ||
|- | |- | ||
| colspan="2" | Turn on all of the pins in the array (unused port pins are unaffected) | | colspan="2" | Turn on all of the pins in the array (unused port pins are unaffected) | ||
| Line 74: | Line 107: | ||
{| class="wikitable | ===BarGraph=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''BarGraph''' | ||
|- | |- | ||
| colspan="2" | | | 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="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | | | width="90%" | Length | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | How many pins to enable. | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| Line 92: | Line 126: | ||
{| class="wikitable | ===GetHandle=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetHandle''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Retrieves the object handle of the indexed clone. Returns zero for out of range indexes. | ||
|- | |- | ||
|- | |- | ||
| Line 103: | Line 138: | ||
| width="90%" | Index | | width="90%" | Index | ||
|- | |- | ||
| colspan="2" | Index of the | | colspan="2" | Index of the object to get a handle for. | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===GetPin=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetPin''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Read the state of the selected pin of the port. Returns false if the index is out of range (0..7) | ||
|- | |- | ||
|- | |- | ||
| Line 121: | Line 157: | ||
| width="90%" | Index | | width="90%" | Index | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Index of the pin to read. | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===PinOff=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''PinOff''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Turn off the chosen pin of the port. | ||
|- | |- | ||
|- | |- | ||
| Line 139: | Line 176: | ||
| width="90%" | Index | | width="90%" | Index | ||
|- | |- | ||
| colspan="2" | Index of the pin to | | colspan="2" | Index of the pin to set within the port. | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===PinOn=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''PinOn''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Turn on the selected pin of the port. | ||
|- | |- | ||
|- | |- | ||
| Line 157: | Line 195: | ||
| width="90%" | Index | | width="90%" | Index | ||
|- | |- | ||
| colspan="2" | Index of the | | colspan="2" | Index of the pin to set within the port. | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===PinToggle=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''PinToggle''' | ||
|- | |- | ||
| colspan="2" | | | 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="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
==Property reference== | ==Property reference== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Simulation | ||
|- | |- | ||
|- | |- | ||
| Line 211: | Line 253: | ||
| colspan="2" | The distance between cloned objects in the matrix. | | colspan="2" | The distance between cloned objects in the matrix. | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Connections | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 15:38, 13 July 2026
| Author | Matrix Ltd |
| Version | 1.1 |
| Category | Misc |
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 download the component source project: FC_Comp_Source_Port_Matrix.fcfx
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
AllOff
| AllOff | |
| Turn off all used pins of the port (unused port pins are unaffected) | |
| Return | |
AllOn
| AllOn | |
| Turn on all of the pins in the array (unused port pins are unaffected) | |
| Return | |
BarGraph
| BarGraph | |
| Turns on the first N pins of the array - for generating bar graph meters etc. | |
| Length | |
| How many pins to enable. | |
| Return | |
GetHandle
| 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 | |
GetPin
| 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 | |
PinOff
| PinOff | |
| Turn off the chosen pin of the port. | |
| Index | |
| Index of the pin to set within the port. | |
| Return | |
PinOn
| PinOn | |
| Turn on the selected pin of the port. | |
| Index | |
| Index of the pin to set within the port. | |
| Return | |
PinToggle
| PinToggle | |
| Toggles the state of the selected pin of the port. | |
| Index | |
| Return | |