Difference between revisions of "Component: CAN Bus BL0140 (E-blocks 2)"
From Flowcode Help
Jump to navigationJump to search (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray;" | Categ...") |
|||
(10 intermediate revisions by the same user 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_EBlocks2_CAN_Bus_BL0140_2d.fcfx FC_Comp_Source_EBlocks2_CAN_Bus_BL0140_2d.fcfx] |
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EBlocks2_CAN_Bus_BL0140_2d.fcfx FC_Comp_Source_EBlocks2_CAN_Bus_BL0140_2d.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 26: | Line 38: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 31: | Line 53: | ||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
− | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Macro reference== | ||
+ | |||
+ | ===ChangeRate=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ChangeRate''' |
+ | |- | ||
+ | | colspan="2" | Simple attempt to alter the bus rate of the CAN. External CAN channels only, | ||
+ | |- | ||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | Rate | ||
|- | |- | ||
+ | | colspan="2" | Rate: 0-3 where 0=125, 1=250, 2=500, 3=1000 | ||
|- | |- | ||
− | | 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'' | ||
|} | |} | ||
+ | ===CheckRx=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckRx''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Checks to see if any messages are available for 'Buffer' specified |
|- | |- | ||
|- | |- | ||
Line 57: | Line 100: | ||
| width="90%" | Buffer | | width="90%" | Buffer | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Send buffer: 0 to 1 |
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
+ | |} | ||
+ | |||
+ | |||
+ | ===GetRxData=== | ||
+ | {| 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;" | '''GetRxData''' | ||
|- | |- | ||
− | | | + | | colspan="2" | Returns last received message data byte at position Index. Buffer parameter is currently ignored |
− | |||
|- | |- | ||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Buffer |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Index |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
+ | |} | ||
+ | |||
+ | |||
+ | ===GetRxDataCount=== | ||
+ | {| 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;" | '''GetRxDataCount''' | ||
|- | |- | ||
− | | | + | | colspan="2" | Returns last received message data length. Buffer parameter is currently ignored |
− | |||
|- | |- | ||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Buffer |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
− | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===GetRxIDHi=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRxIDHi''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Gets the Hi byte Rx ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous, |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Buffer |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Receive Buffer. Range 0-1 |
|- | |- | ||
− | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | |
− | |||
− | |||
− | |||
− | |||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===GetRxIDLo=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRxIDLo''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Gets the Lo byte Rx ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous, |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| width="90%" | Buffer | | width="90%" | Buffer | ||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
Line 155: | Line 188: | ||
+ | ===GetRxIDSimple=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRxIDSimple''' |
|- | |- | ||
− | | colspan="2" | Gets the | + | | colspan="2" | Gets the Rx ID as a Integer Standard ID only 0-2047. |
|- | |- | ||
|- | |- | ||
Line 168: | Line 202: | ||
| colspan="2" | Receive Buffer. Range 0-1 | | colspan="2" | Receive Buffer. Range 0-1 | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===GetRxIdent=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRxIdent''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Gets the Rx ID as a Integer Standard and Extended IDs. |
|- | |- | ||
|- | |- | ||
Line 184: | Line 219: | ||
| width="90%" | Buffer | | width="90%" | Buffer | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===Initialise=== | ||
+ | {| 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;" | '''Initialise''' | ||
|- | |- | ||
− | | | + | | colspan="2" | Must be called before any other CAN component macros to enable and initialise the CAN peripheral. |
− | |||
|- | |- | ||
− | |||
|- | |- | ||
| 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 196: | Line 240: | ||
+ | ===ReadSwitches=== | ||
+ | {| 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;" | '''ReadSwitches''' | ||
+ | |- | ||
+ | | colspan="2" | Returns switch input states from the external MCP2515 device. 0 = No Switch Pressed, 1 = Switch 1 Pressed, 2 = Switch 2 Pressed, 3 = Both Pressed (External CAN only) | ||
+ | |- | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===SendBuffer=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 214: | Line 273: | ||
+ | ===SetRxFilter=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxFilter''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Allows the receive ID filter to be configured on the fly allowing different ID ranges to be received. |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Filter |
+ | |- | ||
+ | | colspan="2" | Specifies which receive filter to modify. Range: 0-5 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | ||
+ | | width="90%" | ID | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | The ID filter value you wish to use |
|- | |- | ||
− | | 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'' | ||
|} | |} | ||
+ | ===SetRxFilterID=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 260: | Line 326: | ||
+ | ===SetRxMask=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetRxMask''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Allows the receive ID mask to be configured on the fly allowing different ID ranges to be received. |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Mask |
|- | |- | ||
− | + | | colspan="2" | Specifies which receive mask to modify. Range: 0-1 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | colspan="2" | Specifies which receive | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | ||
| width="90%" | ID | | width="90%" | ID | ||
|- | |- | ||
− | | colspan="2" | The ID | + | | colspan="2" | The ID mask value you wish to use |
|- | |- | ||
| 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 301: | Line 350: | ||
+ | ===SetRxMaskID=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 329: | Line 379: | ||
+ | ===SetTxData=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxData''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Assigns one of the outgoing transmit buffers with data ready to be sent. |
|- | |- | ||
|- | |- | ||
Line 340: | Line 391: | ||
| width="90%" | Buffer | | width="90%" | Buffer | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | | + | | width="90%" | Count |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
− | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90% | + | | width="90%" | d0 |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | colspan="2" | |
− | |||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | d1 | ||
|- | |- | ||
+ | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | d2 |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
− | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90% | + | | width="90%" | d3 |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | colspan="2" | |
− | |||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | d4 | ||
|- | |- | ||
+ | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | d5 |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
− | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
− | + | | width="90%" | d6 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | width="90% | ||
− | |||
− | |||
|- | |- | ||
+ | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | d7 |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
− | | 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'' | ||
|} | |} | ||
+ | ===SetTxID=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 434: | Line 472: | ||
+ | ===SetTxIDSimple=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxIDSimple''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Set the Tx CAN ID as a generic number. Standard IDs only 0-2047. |
|- | |- | ||
|- | |- | ||
Line 445: | Line 484: | ||
| width="90%" | Buffer | | width="90%" | Buffer | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Transmit buffer to load. Range: 0-2 |
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | ID | ||
+ | |- | ||
+ | | colspan="2" | The ID value you wish to use. Range: 0-2047 | ||
|- | |- | ||
− | | 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'' | ||
|} | |} | ||
+ | ===SetTxIdent=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTxIdent''' |
|- | |- | ||
− | | colspan="2" | Set | + | | colspan="2" | Set the Tx CAN ID as a generic number. Standard and extended IDs Standard 0-2047 Extended 2048-536870911 |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Buffer |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Transmit buffer to load. Range: 0-2 |
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG |
− | | width="90%" | | + | | width="90%" | ID |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | The ID or Extended ID value you wish to use. Range: 0-536870911 |
|- | |- | ||
| 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 475: | Line 520: | ||
+ | ===ShowLEDs=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ShowLEDs''' |
+ | |- | ||
+ | | colspan="2" | Set LED state (External CAN only) | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | led1 | ||
+ | |- | ||
+ | | colspan="2" | Controls LED 1. Range: 0-1 | ||
|- | |- | ||
− | | | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | led2 | ||
|- | |- | ||
+ | | colspan="2" | Controls LED 2. Range: 0-1 | ||
|- | |- | ||
| 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'' | ||
|} | |} | ||
− | |||
− | |||
Latest revision as of 10:26, 20 October 2023
Author | |
Version | 1.0 |
Category | E-blocks 2 |
Contents
- 1 CAN_Bus_BL0140 component
- 2 Component Source Code
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 ChangeRate
- 5.2 CheckRx
- 5.3 GetRxData
- 5.4 GetRxDataCount
- 5.5 GetRxIDHi
- 5.6 GetRxIDLo
- 5.7 GetRxIDSimple
- 5.8 GetRxIdent
- 5.9 Initialise
- 5.10 ReadSwitches
- 5.11 SendBuffer
- 5.12 SetRxFilter
- 5.13 SetRxFilterID
- 5.14 SetRxMask
- 5.15 SetRxMaskID
- 5.16 SetTxData
- 5.17 SetTxID
- 5.18 SetTxIDSimple
- 5.19 SetTxIdent
- 5.20 ShowLEDs
- 6 Property reference
CAN_Bus_BL0140 component
Component Source Code
Please click here to download the component source project: FC_Comp_Source_EBlocks2_CAN_Bus_BL0140_2d.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_EBlocks2_CAN_Bus_BL0140_2d.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
ChangeRate
![]() |
ChangeRate |
Simple attempt to alter the bus rate of the CAN. External CAN channels only, | |
![]() |
Rate |
Rate: 0-3 where 0=125, 1=250, 2=500, 3=1000 | |
![]() |
Return |
CheckRx
![]() |
CheckRx |
Checks to see if any messages are available for 'Buffer' specified | |
![]() |
Buffer |
Send buffer: 0 to 1 | |
![]() |
Return |
GetRxData
![]() |
GetRxData |
Returns last received message data byte at position Index. Buffer parameter is currently ignored | |
![]() |
Buffer |
![]() |
Index |
![]() |
Return |
GetRxDataCount
![]() |
GetRxDataCount |
Returns last received message data length. Buffer parameter is currently ignored | |
![]() |
Buffer |
![]() |
Return |
GetRxIDHi
![]() |
GetRxIDHi |
Gets the Hi byte Rx ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous, | |
![]() |
Buffer |
Receive Buffer. Range 0-1 | |
![]() |
Return |
GetRxIDLo
![]() |
GetRxIDLo |
Gets the Lo byte Rx ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous, | |
![]() |
Buffer |
![]() |
Return |
GetRxIDSimple
![]() |
GetRxIDSimple |
Gets the Rx ID as a Integer Standard ID only 0-2047. | |
![]() |
Buffer |
Receive Buffer. Range 0-1 | |
![]() |
Return |
GetRxIdent
![]() |
GetRxIdent |
Gets the Rx ID as a Integer Standard and Extended IDs. | |
![]() |
Buffer |
![]() |
Return |
Initialise
![]() |
Initialise |
Must be called before any other CAN component macros to enable and initialise the CAN peripheral. | |
![]() |
Return |
ReadSwitches
![]() |
ReadSwitches |
Returns switch input states from the external MCP2515 device. 0 = No Switch Pressed, 1 = Switch 1 Pressed, 2 = Switch 2 Pressed, 3 = Both Pressed (External CAN only) | |
![]() |
Return |
SendBuffer
![]() |
SendBuffer |
Transmits one of the transmit buffers which should have already been populated with an ID and data. | |
![]() |
Buffer |
Specifies which transmit buffer to send | |
![]() |
Return |
SetRxFilter
SetRxFilterID
SetRxMask
SetRxMaskID
SetTxData
SetTxID
SetTxIDSimple
![]() |
SetTxIDSimple |
Set the Tx CAN ID as a generic number. Standard IDs only 0-2047. | |
![]() |
Buffer |
Transmit buffer to load. Range: 0-2 | |
![]() |
ID |
The ID value you wish to use. Range: 0-2047 | |
![]() |
Return |
SetTxIdent
ShowLEDs
![]() |
ShowLEDs |
Set LED state (External CAN only) | |
![]() |
led1 |
Controls LED 1. Range: 0-1 | |
![]() |
led2 |
Controls LED 2. Range: 0-1 | |
![]() |
Return |