Difference between revisions of "Component: CAN (Internal, MCP2515) (Comms: Interface)"

From Flowcode Help
Jump to navigationJump to search
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_CAN.fcfx FC_Comp_Source_CAN.fcfx]
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_CAN.fcfx FC_Comp_Source_CAN.fcfx]
  
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_CAN.fcfx FC_Comp_Source_CAN.fcfx]
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_CAN.fcfx FC_Comp_Source_CAN.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 32: Line 34:
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 42: Line 46:
  
 
==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;" | '''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''
 +
|}
 +
 +
 +
{| 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;" | '''SetTxData'''
 +
|-
 +
| colspan="2" | Assigns one of the outgoing transmit buffers with data ready to be sent. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Buffer
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Count
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| 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="90%" | d2
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| 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="90%" | d5
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | d6
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | d7
 +
|-
 +
| 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;" | '''SetRxMask'''
 +
|-
 +
| 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="90%" | Mask
 +
|-
 +
| colspan="2" | Specifies which receive mask to modify. Range: 0-1 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 +
| width="90%" | 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="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;" | '''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="90%" | Buffer
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| 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-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;" | '''GetRxIDHi'''
 +
|-
 +
| 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="90%" | Buffer
 +
|-
 +
| colspan="2" | Receive Buffer. Range 0-1 
 +
|-
 +
| 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;" | '''SetTxIDSimple'''
 +
|-
 +
| colspan="2" | Set the Tx CAN ID as a generic number. Standard IDs only 0-2047.  
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Buffer
 +
|-
 +
| 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-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;" | '''SendBuffer'''
 +
|-
 +
| colspan="2" | Transmits one of the transmit buffers which should have already been populated with an ID and data. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Buffer
 +
|-
 +
| colspan="2" | Specifies which transmit buffer to send 
 +
|-
 +
| 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;" | '''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="90%" | Buffer
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| 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;" | '''SetRxFilterID'''
 +
|-
 +
| colspan="2" | sets the Filter Standard mode only  (for V5 compatibility only) 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Filter
 +
|-
 +
| colspan="2" | Specifies which filter to modify. Range: 0-5 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Hi
 +
|-
 +
| colspan="2" | ID bits 3-10 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Lo
 +
|-
 +
| colspan="2" | ID bits 0-2 stored in the upper 3 bits of the byte 
 +
|-
 +
| 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;" | '''GetRxIDLo'''
 +
|-
 +
| 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="90%" | Buffer
 +
|-
 +
| colspan="2" |  
 +
|-
 +
| 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;" | '''SetRxMaskID'''
 +
|-
 +
| colspan="2" | set the Mask Standard ID mode only (for V5 compatibility)  
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Mask
 +
|-
 +
| colspan="2" | Specifies which receive mask to modify. Range: 0-1 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Hi
 +
|-
 +
| colspan="2" | ID bits 3-10 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Lo
 +
|-
 +
| colspan="2" | ID bits 0-2 stored in the upper 3 bits of the byte 
 +
|-
 +
| 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;" | '''SetRxFilter'''
 +
|-
 +
| 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="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" | The ID filter value you wish to use 
 +
|-
 +
| 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;" | '''SetTxIdent'''
 +
|-
 +
| 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="90%" | Buffer
 +
|-
 +
| colspan="2" | Transmit buffer to load. Range: 0-2 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 +
| width="90%" | ID
 +
|-
 +
| 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="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;" | '''CheckRx'''
 +
|-
 +
| colspan="2" | Checks to see if any messages are available for 'Buffer' specified  
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Buffer
 +
|-
 +
| colspan="2" | Send buffer: 0  to 1 
 +
|-
 +
| 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;" | '''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-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;" | '''GetRxIDSimple'''
 +
|-
 +
| colspan="2" | Gets the Rx ID as a Integer Standard ID only 0-2047. 
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Buffer
 +
|-
 +
| colspan="2" | Receive Buffer. Range 0-1 
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| 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;" | '''SetTxID'''
 +
|-
 +
| colspan="2" | Set the Tx CAN 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="90%" | Buffer
 +
|-
 +
| colspan="2" | Transmit buffer to load. Range: 0-2 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Hi
 +
|-
 +
| colspan="2" | ID bits 3-10 e.g. ((ID & 0x7F8) >> 3) 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Lo
 +
|-
 +
| colspan="2" | ID bits 0-2 stored in the upper 3 bits of the byte e.g. ((ID & 0x7) << 5)&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;" | '''ShowLEDs'''
 +
|-
 +
| colspan="2" | Set LED state (External CAN only) &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | led1
 +
|-
 +
| colspan="2" | Controls LED 1. Range: 0-1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | led2
 +
|-
 +
| colspan="2" | Controls LED 2. Range: 0-1&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;" | '''GetRxIdent'''
 +
|-
 +
| colspan="2" | Gets the Rx ID as a Integer Standard and Extended IDs.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Buffer
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| 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''
 +
|}
 +
 +
 +
{| 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. &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;"
 +
|-
 +
| 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" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Switches between Internal CAN peripheral and External CAN controller IC MCP2515.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Controller Osc
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Bus Rate
 +
|-
 +
| colspan="2" | Data rate of the bus specified in thousand bits per second, Kbps.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Sync Jump Width
 +
|-
 +
| colspan="2" | Defines how far a resyncronisation may move the sample point&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Sample Point
 +
|-
 +
| colspan="2" | Point in each bit period where the incoming data is sampled.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | ID Type
 +
|-
 +
| colspan="2" | Switches between using Standard, or Standard and Extended CAN&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | One Shot Mode
 +
|-
 +
| colspan="2" | Disabled. Messages will reattempt transmission Enabled. Message will only attempt to transmit once&nbsp;
 +
|-
 +
| 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" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | SPI
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | CHANNEL
 +
|-
 +
| colspan="2" | SPI Channel selector&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | MOSI
 +
|-
 +
| colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | MISO
 +
|-
 +
| colspan="2" | SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | CLK
 +
|-
 +
| colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 +
| width="90%" | SS
 +
|-
 +
| colspan="2" | Chip Select / Slave Select Pin  Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device. &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Prescale
 +
|-
 +
| colspan="2" | Prescale option selector&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Sample Point
 +
|-
 +
| colspan="2" | Data bit read sample point&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Config Delay
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | TX Buffer 0
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | Message ID
 +
|-
 +
| colspan="2" | TX Buffer 0 Message Identifier&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | Length
 +
|-
 +
| colspan="2" | TX Buffer 0 Number of data bytes&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D0
 +
|-
 +
| colspan="2" | TX Buffer 0 Data Byte 0&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D1
 +
|-
 +
| colspan="2" | TX Buffer 0 Data Byte 1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D2
 +
|-
 +
| colspan="2" | TX Buffer 0 Data Byte 2&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D3
 +
|-
 +
| colspan="2" | TX Buffer 0 Data Byte 3&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D4
 +
|-
 +
| colspan="2" | TX Buffer 0 Data Byte 4&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D5
 +
|-
 +
| colspan="2" | TX Buffer 0 Data Byte 5&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D6
 +
|-
 +
| colspan="2" | TX Buffer 0 Data Byte 6&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D7
 +
|-
 +
| colspan="2" | TX Buffer 0 Data Byte 7&nbsp;
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | TX Buffer 1
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | Message ID
 +
|-
 +
| colspan="2" | TX Buffer 1 Message Identifier&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | Length
 +
|-
 +
| colspan="2" | TX Buffer 1 Number of data bytes&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D0
 +
|-
 +
| colspan="2" | TX Buffer 1 Data Byte 0&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D1
 +
|-
 +
| colspan="2" | TX Buffer 1 Data Byte 1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D2
 +
|-
 +
| colspan="2" | TX Buffer 1 Data Byte 2&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D3
 +
|-
 +
| colspan="2" | TX Buffer 1 Data Byte 3&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D4
 +
|-
 +
| colspan="2" | TX Buffer 1 Data Byte 4&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D5
 +
|-
 +
| colspan="2" | TX Buffer 1 Data Byte 5&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D6
 +
|-
 +
| colspan="2" | TX Buffer 1 Data Byte 6&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D7
 +
|-
 +
| colspan="2" | TX Buffer 1 Data Byte 7&nbsp;
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | TX Buffer 2
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | Message ID
 +
|-
 +
| colspan="2" | TX Buffer 2 Message Identifier&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | Length
 +
|-
 +
| colspan="2" | TX Buffer 2 Number of data bytes&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D0
 +
|-
 +
| colspan="2" | TX Buffer 2 Data Byte 0&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D1
 +
|-
 +
| colspan="2" | TX Buffer 2 Data Byte 1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D2
 +
|-
 +
| colspan="2" | TX Buffer 2 Data Byte 2&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D3
 +
|-
 +
| colspan="2" | TX Buffer 2 Data Byte 3&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D4
 +
|-
 +
| colspan="2" | TX Buffer 2 Data Byte 4&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D5
 +
|-
 +
| colspan="2" | TX Buffer 2 Data Byte 5&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D6
 +
|-
 +
| colspan="2" | TX Buffer 2 Data Byte 6&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | D7
 +
|-
 +
| colspan="2" | TX Buffer 2 Data Byte 7&nbsp;
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | RX Buffer 0
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Settings
 +
|-
 +
| colspan="2" | RX Buffer 0 Message Receive Mode&nbsp;
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | RX Buffer 1
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | Settings
 +
|-
 +
| colspan="2" | RX Buffer 1 Message Receive Mode&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-10-icon.png]]
 +
| width="90%" | Label
 +
|-
 +
| colspan="2" | Comms Flasher Identification Label&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 +
| width="90%" | Simulate SPI Comms
 +
|-
 +
| colspan="2" | &nbsp;
 +
|}==Macro reference==
  
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"

Revision as of 09:52, 27 January 2023

Author Matrix Ltd
Version 2.10
Category Comms: Interface


CAN (Internal, MCP2515) component

Low level routines for controling the CAN interface either using an external MCP2515 IC and a SPI bus connection or using an internal CAN peripheral if available on your device. Both methods will require a CAN driver IC like the MCP2551 to drive the CAN signals on the bus.

Component Source Code

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

Please click here to view the component source code (Beta): FC_Comp_Source_CAN.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples

Macro reference

Fc9-comp-macro.png 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)  
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetTxData
Assigns one of the outgoing transmit buffers with data ready to be sent. 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Count
 
Fc9-u8-icon.png - BYTE d0
 
Fc9-u8-icon.png - BYTE d1
 
Fc9-u8-icon.png - BYTE d2
 
Fc9-u8-icon.png - BYTE d3
 
Fc9-u8-icon.png - BYTE d4
 
Fc9-u8-icon.png - BYTE d5
 
Fc9-u8-icon.png - BYTE d6
 
Fc9-u8-icon.png - BYTE d7
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRxMask
Allows the receive ID mask to be configured on the fly allowing different ID ranges to be received. 
Fc9-u8-icon.png - BYTE Mask
Specifies which receive mask to modify. Range: 0-1 
Fc9-u32-icon.png - ULONG ID
The ID mask value you wish to use 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxData
Returns last received message data byte at position Index. Buffer parameter is currently ignored 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Index
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetRxIDHi
Gets the Hi byte Rx ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous,  
Fc9-u8-icon.png - BYTE Buffer
Receive Buffer. Range 0-1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetTxIDSimple
Set the Tx CAN ID as a generic number. Standard IDs only 0-2047.  
Fc9-u8-icon.png - BYTE Buffer
Transmit buffer to load. Range: 0-2 
Fc9-u16-icon.png - UINT ID
The ID value you wish to use. Range: 0-2047 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SendBuffer
Transmits one of the transmit buffers which should have already been populated with an ID and data. 
Fc9-u8-icon.png - BYTE Buffer
Specifies which transmit buffer to send 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxDataCount
Returns last received message data length. Buffer parameter is currently ignored 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetRxFilterID
sets the Filter Standard mode only (for V5 compatibility only) 
Fc9-u8-icon.png - BYTE Filter
Specifies which filter to modify. Range: 0-5 
Fc9-u8-icon.png - BYTE Hi
ID bits 3-10 
Fc9-u8-icon.png - BYTE Lo
ID bits 0-2 stored in the upper 3 bits of the byte 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxIDLo
Gets the Lo byte Rx ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous,  
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetRxMaskID
set the Mask Standard ID mode only (for V5 compatibility)  
Fc9-u8-icon.png - BYTE Mask
Specifies which receive mask to modify. Range: 0-1 
Fc9-u8-icon.png - BYTE Hi
ID bits 3-10 
Fc9-u8-icon.png - BYTE Lo
ID bits 0-2 stored in the upper 3 bits of the byte 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRxFilter
Allows the receive ID filter to be configured on the fly allowing different ID ranges to be received. 
Fc9-u8-icon.png - BYTE Filter
Specifies which receive filter to modify. Range: 0-5 
Fc9-u32-icon.png - ULONG ID
The ID filter value you wish to use 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetTxIdent
Set the Tx CAN ID as a generic number. Standard and extended IDs Standard 0-2047 Extended 2048-536870911  
Fc9-u8-icon.png - BYTE Buffer
Transmit buffer to load. Range: 0-2 
Fc9-u32-icon.png - ULONG ID
The ID or Extended ID value you wish to use. Range: 0-536870911 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CheckRx
Checks to see if any messages are available for 'Buffer' specified  
Fc9-u8-icon.png - BYTE Buffer
Send buffer: 0 to 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ChangeRate
Simple attempt to alter the bus rate of the CAN. External CAN channels only, 
Fc9-u8-icon.png - BYTE Rate
Rate: 0-3 where 0=125, 1=250, 2=500, 3=1000 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxIDSimple
Gets the Rx ID as a Integer Standard ID only 0-2047. 
Fc9-u8-icon.png - BYTE Buffer
Receive Buffer. Range 0-1 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png SetTxID
Set the Tx CAN ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous, 
Fc9-u8-icon.png - BYTE Buffer
Transmit buffer to load. Range: 0-2 
Fc9-u8-icon.png - BYTE Hi
ID bits 3-10 e.g. ((ID & 0x7F8) >> 3) 
Fc9-u8-icon.png - BYTE Lo
ID bits 0-2 stored in the upper 3 bits of the byte e.g. ((ID & 0x7) << 5) 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ShowLEDs
Set LED state (External CAN only)  
Fc9-u8-icon.png - BYTE led1
Controls LED 1. Range: 0-1 
Fc9-u8-icon.png - BYTE led2
Controls LED 2. Range: 0-1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxIdent
Gets the Rx ID as a Integer Standard and Extended IDs. 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u32-icon.png - ULONG Return


Fc9-comp-macro.png Initialise
Must be called before any other CAN component macros to enable and initialise the CAN peripheral.  
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Channel
Switches between Internal CAN peripheral and External CAN controller IC MCP2515. 
Fc9-type-16-icon.png Controller Osc
 
Fc9-type-16-icon.png Bus Rate
Data rate of the bus specified in thousand bits per second, Kbps. 
Fc9-type-16-icon.png Sync Jump Width
Defines how far a resyncronisation may move the sample point 
Fc9-type-16-icon.png Sample Point
Point in each bit period where the incoming data is sampled. 
Fc9-type-16-icon.png ID Type
Switches between using Standard, or Standard and Extended CAN 
Fc9-type-16-icon.png One Shot Mode
Disabled. Messages will reattempt transmission Enabled. Message will only attempt to transmit once 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png SPI
Fc9-type-16-icon.png CHANNEL
SPI Channel selector 
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-5-icon.png SS
Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
Fc9-type-16-icon.png Prescale
Prescale option selector 
Fc9-type-16-icon.png Sample Point
Data bit read sample point 
Fc9-type-16-icon.png Config Delay
 
Fc9-conn-icon.png TX Buffer 0
Fc9-type-14-icon.png Message ID
TX Buffer 0 Message Identifier 
Fc9-type-14-icon.png Length
TX Buffer 0 Number of data bytes 
Fc9-type-14-icon.png D0
TX Buffer 0 Data Byte 0 
Fc9-type-14-icon.png D1
TX Buffer 0 Data Byte 1 
Fc9-type-14-icon.png D2
TX Buffer 0 Data Byte 2 
Fc9-type-14-icon.png D3
TX Buffer 0 Data Byte 3 
Fc9-type-14-icon.png D4
TX Buffer 0 Data Byte 4 
Fc9-type-14-icon.png D5
TX Buffer 0 Data Byte 5 
Fc9-type-14-icon.png D6
TX Buffer 0 Data Byte 6 
Fc9-type-14-icon.png D7
TX Buffer 0 Data Byte 7 
Fc9-conn-icon.png TX Buffer 1
Fc9-type-14-icon.png Message ID
TX Buffer 1 Message Identifier 
Fc9-type-14-icon.png Length
TX Buffer 1 Number of data bytes 
Fc9-type-14-icon.png D0
TX Buffer 1 Data Byte 0 
Fc9-type-14-icon.png D1
TX Buffer 1 Data Byte 1 
Fc9-type-14-icon.png D2
TX Buffer 1 Data Byte 2 
Fc9-type-14-icon.png D3
TX Buffer 1 Data Byte 3 
Fc9-type-14-icon.png D4
TX Buffer 1 Data Byte 4 
Fc9-type-14-icon.png D5
TX Buffer 1 Data Byte 5 
Fc9-type-14-icon.png D6
TX Buffer 1 Data Byte 6 
Fc9-type-14-icon.png D7
TX Buffer 1 Data Byte 7 
Fc9-conn-icon.png TX Buffer 2
Fc9-type-14-icon.png Message ID
TX Buffer 2 Message Identifier 
Fc9-type-14-icon.png Length
TX Buffer 2 Number of data bytes 
Fc9-type-14-icon.png D0
TX Buffer 2 Data Byte 0 
Fc9-type-14-icon.png D1
TX Buffer 2 Data Byte 1 
Fc9-type-14-icon.png D2
TX Buffer 2 Data Byte 2 
Fc9-type-14-icon.png D3
TX Buffer 2 Data Byte 3 
Fc9-type-14-icon.png D4
TX Buffer 2 Data Byte 4 
Fc9-type-14-icon.png D5
TX Buffer 2 Data Byte 5 
Fc9-type-14-icon.png D6
TX Buffer 2 Data Byte 6 
Fc9-type-14-icon.png D7
TX Buffer 2 Data Byte 7 
Fc9-conn-icon.png RX Buffer 0
Fc9-type-16-icon.png Settings
RX Buffer 0 Message Receive Mode 
Fc9-conn-icon.png RX Buffer 1
Fc9-type-16-icon.png Settings
RX Buffer 1 Message Receive Mode 
Fc9-conn-icon.png Simulation
Fc9-type-10-icon.png Label
Comms Flasher Identification Label 
Fc9-type-7-icon.png Simulate SPI Comms
 

==Macro reference==

Fc9-comp-macro.png 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)  
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetTxData
Assigns one of the outgoing transmit buffers with data ready to be sent. 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Count
 
Fc9-u8-icon.png - BYTE d0
 
Fc9-u8-icon.png - BYTE d1
 
Fc9-u8-icon.png - BYTE d2
 
Fc9-u8-icon.png - BYTE d3
 
Fc9-u8-icon.png - BYTE d4
 
Fc9-u8-icon.png - BYTE d5
 
Fc9-u8-icon.png - BYTE d6
 
Fc9-u8-icon.png - BYTE d7
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRxMask
Allows the receive ID mask to be configured on the fly allowing different ID ranges to be received. 
Fc9-u8-icon.png - BYTE Mask
Specifies which receive mask to modify. Range: 0-1 
Fc9-u32-icon.png - ULONG ID
The ID mask value you wish to use 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxData
Returns last received message data byte at position Index. Buffer parameter is currently ignored 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Index
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetRxIDHi
Gets the Hi byte Rx ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous,  
Fc9-u8-icon.png - BYTE Buffer
Receive Buffer. Range 0-1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetTxIDSimple
Set the Tx CAN ID as a generic number. Standard IDs only 0-2047.  
Fc9-u8-icon.png - BYTE Buffer
Transmit buffer to load. Range: 0-2 
Fc9-u16-icon.png - UINT ID
The ID value you wish to use. Range: 0-2047 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SendBuffer
Transmits one of the transmit buffers which should have already been populated with an ID and data. 
Fc9-u8-icon.png - BYTE Buffer
Specifies which transmit buffer to send 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxDataCount
Returns last received message data length. Buffer parameter is currently ignored 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetRxFilterID
sets the Filter Standard mode only (for V5 compatibility only) 
Fc9-u8-icon.png - BYTE Filter
Specifies which filter to modify. Range: 0-5 
Fc9-u8-icon.png - BYTE Hi
ID bits 3-10 
Fc9-u8-icon.png - BYTE Lo
ID bits 0-2 stored in the upper 3 bits of the byte 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxIDLo
Gets the Lo byte Rx ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous,  
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetRxMaskID
set the Mask Standard ID mode only (for V5 compatibility)  
Fc9-u8-icon.png - BYTE Mask
Specifies which receive mask to modify. Range: 0-1 
Fc9-u8-icon.png - BYTE Hi
ID bits 3-10 
Fc9-u8-icon.png - BYTE Lo
ID bits 0-2 stored in the upper 3 bits of the byte 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRxFilter
Allows the receive ID filter to be configured on the fly allowing different ID ranges to be received. 
Fc9-u8-icon.png - BYTE Filter
Specifies which receive filter to modify. Range: 0-5 
Fc9-u32-icon.png - ULONG ID
The ID filter value you wish to use 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetTxIdent
Set the Tx CAN ID as a generic number. Standard and extended IDs Standard 0-2047 Extended 2048-536870911  
Fc9-u8-icon.png - BYTE Buffer
Transmit buffer to load. Range: 0-2 
Fc9-u32-icon.png - ULONG ID
The ID or Extended ID value you wish to use. Range: 0-536870911 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CheckRx
Checks to see if any messages are available for 'Buffer' specified  
Fc9-u8-icon.png - BYTE Buffer
Send buffer: 0 to 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ChangeRate
Simple attempt to alter the bus rate of the CAN. External CAN channels only, 
Fc9-u8-icon.png - BYTE Rate
Rate: 0-3 where 0=125, 1=250, 2=500, 3=1000 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxIDSimple
Gets the Rx ID as a Integer Standard ID only 0-2047. 
Fc9-u8-icon.png - BYTE Buffer
Receive Buffer. Range 0-1 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png SetTxID
Set the Tx CAN ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous, 
Fc9-u8-icon.png - BYTE Buffer
Transmit buffer to load. Range: 0-2 
Fc9-u8-icon.png - BYTE Hi
ID bits 3-10 e.g. ((ID & 0x7F8) >> 3) 
Fc9-u8-icon.png - BYTE Lo
ID bits 0-2 stored in the upper 3 bits of the byte e.g. ((ID & 0x7) << 5) 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ShowLEDs
Set LED state (External CAN only)  
Fc9-u8-icon.png - BYTE led1
Controls LED 1. Range: 0-1 
Fc9-u8-icon.png - BYTE led2
Controls LED 2. Range: 0-1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxIdent
Gets the Rx ID as a Integer Standard and Extended IDs. 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u32-icon.png - ULONG Return


Fc9-comp-macro.png Initialise
Must be called before any other CAN component macros to enable and initialise the CAN peripheral.  
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Channel
Switches between Internal CAN peripheral and External CAN controller IC MCP2515. 
Fc9-type-16-icon.png Controller Osc
 
Fc9-type-16-icon.png Bus Rate
Data rate of the bus specified in thousand bits per second, Kbps. 
Fc9-type-16-icon.png Sync Jump Width
Defines how far a resyncronisation may move the sample point 
Fc9-type-16-icon.png Sample Point
Point in each bit period where the incoming data is sampled. 
Fc9-type-16-icon.png ID Type
Switches between using Standard, or Standard and Extended CAN 
Fc9-type-16-icon.png One Shot Mode
Disabled. Messages will reattempt transmission Enabled. Message will only attempt to transmit once 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png SPI
Fc9-type-16-icon.png CHANNEL
SPI Channel selector 
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-5-icon.png SS
Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
Fc9-type-16-icon.png Prescale
Prescale option selector 
Fc9-type-16-icon.png Sample Point
Data bit read sample point 
Fc9-type-16-icon.png Config Delay
 
Fc9-conn-icon.png TX Buffer 0
Fc9-type-14-icon.png Message ID
TX Buffer 0 Message Identifier 
Fc9-type-14-icon.png Length
TX Buffer 0 Number of data bytes 
Fc9-type-14-icon.png D0
TX Buffer 0 Data Byte 0 
Fc9-type-14-icon.png D1
TX Buffer 0 Data Byte 1 
Fc9-type-14-icon.png D2
TX Buffer 0 Data Byte 2 
Fc9-type-14-icon.png D3
TX Buffer 0 Data Byte 3 
Fc9-type-14-icon.png D4
TX Buffer 0 Data Byte 4 
Fc9-type-14-icon.png D5
TX Buffer 0 Data Byte 5 
Fc9-type-14-icon.png D6
TX Buffer 0 Data Byte 6 
Fc9-type-14-icon.png D7
TX Buffer 0 Data Byte 7 
Fc9-conn-icon.png TX Buffer 1
Fc9-type-14-icon.png Message ID
TX Buffer 1 Message Identifier 
Fc9-type-14-icon.png Length
TX Buffer 1 Number of data bytes 
Fc9-type-14-icon.png D0
TX Buffer 1 Data Byte 0 
Fc9-type-14-icon.png D1
TX Buffer 1 Data Byte 1 
Fc9-type-14-icon.png D2
TX Buffer 1 Data Byte 2 
Fc9-type-14-icon.png D3
TX Buffer 1 Data Byte 3 
Fc9-type-14-icon.png D4
TX Buffer 1 Data Byte 4 
Fc9-type-14-icon.png D5
TX Buffer 1 Data Byte 5 
Fc9-type-14-icon.png D6
TX Buffer 1 Data Byte 6 
Fc9-type-14-icon.png D7
TX Buffer 1 Data Byte 7 
Fc9-conn-icon.png TX Buffer 2
Fc9-type-14-icon.png Message ID
TX Buffer 2 Message Identifier 
Fc9-type-14-icon.png Length
TX Buffer 2 Number of data bytes 
Fc9-type-14-icon.png D0
TX Buffer 2 Data Byte 0 
Fc9-type-14-icon.png D1
TX Buffer 2 Data Byte 1 
Fc9-type-14-icon.png D2
TX Buffer 2 Data Byte 2 
Fc9-type-14-icon.png D3
TX Buffer 2 Data Byte 3 
Fc9-type-14-icon.png D4
TX Buffer 2 Data Byte 4 
Fc9-type-14-icon.png D5
TX Buffer 2 Data Byte 5 
Fc9-type-14-icon.png D6
TX Buffer 2 Data Byte 6 
Fc9-type-14-icon.png D7
TX Buffer 2 Data Byte 7 
Fc9-conn-icon.png RX Buffer 0
Fc9-type-16-icon.png Settings
RX Buffer 0 Message Receive Mode 
Fc9-conn-icon.png RX Buffer 1
Fc9-type-16-icon.png Settings
RX Buffer 1 Message Receive Mode 
Fc9-conn-icon.png Simulation
Fc9-type-10-icon.png Label
Comms Flasher Identification Label 
Fc9-type-7-icon.png Simulate SPI Comms
 

==Macro reference==

Fc9-comp-macro.png 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)  
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetTxData
Assigns one of the outgoing transmit buffers with data ready to be sent. 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Count
 
Fc9-u8-icon.png - BYTE d0
 
Fc9-u8-icon.png - BYTE d1
 
Fc9-u8-icon.png - BYTE d2
 
Fc9-u8-icon.png - BYTE d3
 
Fc9-u8-icon.png - BYTE d4
 
Fc9-u8-icon.png - BYTE d5
 
Fc9-u8-icon.png - BYTE d6
 
Fc9-u8-icon.png - BYTE d7
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRxMask
Allows the receive ID mask to be configured on the fly allowing different ID ranges to be received. 
Fc9-u8-icon.png - BYTE Mask
Specifies which receive mask to modify. Range: 0-1 
Fc9-u32-icon.png - ULONG ID
The ID mask value you wish to use 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxData
Returns last received message data byte at position Index. Buffer parameter is currently ignored 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Index
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetRxIDHi
Gets the Hi byte Rx ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous,  
Fc9-u8-icon.png - BYTE Buffer
Receive Buffer. Range 0-1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetTxIDSimple
Set the Tx CAN ID as a generic number. Standard IDs only 0-2047.  
Fc9-u8-icon.png - BYTE Buffer
Transmit buffer to load. Range: 0-2 
Fc9-u16-icon.png - UINT ID
The ID value you wish to use. Range: 0-2047 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SendBuffer
Transmits one of the transmit buffers which should have already been populated with an ID and data. 
Fc9-u8-icon.png - BYTE Buffer
Specifies which transmit buffer to send 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxDataCount
Returns last received message data length. Buffer parameter is currently ignored 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetRxFilterID
sets the Filter Standard mode only (for V5 compatibility only) 
Fc9-u8-icon.png - BYTE Filter
Specifies which filter to modify. Range: 0-5 
Fc9-u8-icon.png - BYTE Hi
ID bits 3-10 
Fc9-u8-icon.png - BYTE Lo
ID bits 0-2 stored in the upper 3 bits of the byte 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxIDLo
Gets the Lo byte Rx ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous,  
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetRxMaskID
set the Mask Standard ID mode only (for V5 compatibility)  
Fc9-u8-icon.png - BYTE Mask
Specifies which receive mask to modify. Range: 0-1 
Fc9-u8-icon.png - BYTE Hi
ID bits 3-10 
Fc9-u8-icon.png - BYTE Lo
ID bits 0-2 stored in the upper 3 bits of the byte 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRxFilter
Allows the receive ID filter to be configured on the fly allowing different ID ranges to be received. 
Fc9-u8-icon.png - BYTE Filter
Specifies which receive filter to modify. Range: 0-5 
Fc9-u32-icon.png - ULONG ID
The ID filter value you wish to use 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetTxIdent
Set the Tx CAN ID as a generic number. Standard and extended IDs Standard 0-2047 Extended 2048-536870911  
Fc9-u8-icon.png - BYTE Buffer
Transmit buffer to load. Range: 0-2 
Fc9-u32-icon.png - ULONG ID
The ID or Extended ID value you wish to use. Range: 0-536870911 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CheckRx
Checks to see if any messages are available for 'Buffer' specified  
Fc9-u8-icon.png - BYTE Buffer
Send buffer: 0 to 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ChangeRate
Simple attempt to alter the bus rate of the CAN. External CAN channels only, 
Fc9-u8-icon.png - BYTE Rate
Rate: 0-3 where 0=125, 1=250, 2=500, 3=1000 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxIDSimple
Gets the Rx ID as a Integer Standard ID only 0-2047. 
Fc9-u8-icon.png - BYTE Buffer
Receive Buffer. Range 0-1 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png SetTxID
Set the Tx CAN ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous, 
Fc9-u8-icon.png - BYTE Buffer
Transmit buffer to load. Range: 0-2 
Fc9-u8-icon.png - BYTE Hi
ID bits 3-10 e.g. ((ID & 0x7F8) >> 3) 
Fc9-u8-icon.png - BYTE Lo
ID bits 0-2 stored in the upper 3 bits of the byte e.g. ((ID & 0x7) << 5) 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ShowLEDs
Set LED state (External CAN only)  
Fc9-u8-icon.png - BYTE led1
Controls LED 1. Range: 0-1 
Fc9-u8-icon.png - BYTE led2
Controls LED 2. Range: 0-1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxIdent
Gets the Rx ID as a Integer Standard and Extended IDs. 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u32-icon.png - ULONG Return


Fc9-comp-macro.png Initialise
Must be called before any other CAN component macros to enable and initialise the CAN peripheral.  
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Channel
Switches between Internal CAN peripheral and External CAN controller IC MCP2515. 
Fc9-type-16-icon.png Controller Osc
 
Fc9-type-16-icon.png Bus Rate
Data rate of the bus specified in thousand bits per second, Kbps. 
Fc9-type-16-icon.png Sync Jump Width
Defines how far a resyncronisation may move the sample point 
Fc9-type-16-icon.png Sample Point
Point in each bit period where the incoming data is sampled. 
Fc9-type-16-icon.png ID Type
Switches between using Standard, or Standard and Extended CAN 
Fc9-type-16-icon.png One Shot Mode
Disabled. Messages will reattempt transmission Enabled. Message will only attempt to transmit once 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png SPI
Fc9-type-16-icon.png CHANNEL
SPI Channel selector 
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-5-icon.png SS
Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
Fc9-type-16-icon.png Prescale
Prescale option selector 
Fc9-type-16-icon.png Sample Point
Data bit read sample point 
Fc9-type-16-icon.png Config Delay
 
Fc9-conn-icon.png TX Buffer 0
Fc9-type-14-icon.png Message ID
TX Buffer 0 Message Identifier 
Fc9-type-14-icon.png Length
TX Buffer 0 Number of data bytes 
Fc9-type-14-icon.png D0
TX Buffer 0 Data Byte 0 
Fc9-type-14-icon.png D1
TX Buffer 0 Data Byte 1 
Fc9-type-14-icon.png D2
TX Buffer 0 Data Byte 2 
Fc9-type-14-icon.png D3
TX Buffer 0 Data Byte 3 
Fc9-type-14-icon.png D4
TX Buffer 0 Data Byte 4 
Fc9-type-14-icon.png D5
TX Buffer 0 Data Byte 5 
Fc9-type-14-icon.png D6
TX Buffer 0 Data Byte 6 
Fc9-type-14-icon.png D7
TX Buffer 0 Data Byte 7 
Fc9-conn-icon.png TX Buffer 1
Fc9-type-14-icon.png Message ID
TX Buffer 1 Message Identifier 
Fc9-type-14-icon.png Length
TX Buffer 1 Number of data bytes 
Fc9-type-14-icon.png D0
TX Buffer 1 Data Byte 0 
Fc9-type-14-icon.png D1
TX Buffer 1 Data Byte 1 
Fc9-type-14-icon.png D2
TX Buffer 1 Data Byte 2 
Fc9-type-14-icon.png D3
TX Buffer 1 Data Byte 3 
Fc9-type-14-icon.png D4
TX Buffer 1 Data Byte 4 
Fc9-type-14-icon.png D5
TX Buffer 1 Data Byte 5 
Fc9-type-14-icon.png D6
TX Buffer 1 Data Byte 6 
Fc9-type-14-icon.png D7
TX Buffer 1 Data Byte 7 
Fc9-conn-icon.png TX Buffer 2
Fc9-type-14-icon.png Message ID
TX Buffer 2 Message Identifier 
Fc9-type-14-icon.png Length
TX Buffer 2 Number of data bytes 
Fc9-type-14-icon.png D0
TX Buffer 2 Data Byte 0 
Fc9-type-14-icon.png D1
TX Buffer 2 Data Byte 1 
Fc9-type-14-icon.png D2
TX Buffer 2 Data Byte 2 
Fc9-type-14-icon.png D3
TX Buffer 2 Data Byte 3 
Fc9-type-14-icon.png D4
TX Buffer 2 Data Byte 4 
Fc9-type-14-icon.png D5
TX Buffer 2 Data Byte 5 
Fc9-type-14-icon.png D6
TX Buffer 2 Data Byte 6 
Fc9-type-14-icon.png D7
TX Buffer 2 Data Byte 7 
Fc9-conn-icon.png RX Buffer 0
Fc9-type-16-icon.png Settings
RX Buffer 0 Message Receive Mode 
Fc9-conn-icon.png RX Buffer 1
Fc9-type-16-icon.png Settings
RX Buffer 1 Message Receive Mode 
Fc9-conn-icon.png Simulation
Fc9-type-10-icon.png Label
Comms Flasher Identification Label 
Fc9-type-7-icon.png Simulate SPI Comms
 

==Macro reference==

Fc9-comp-macro.png 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)  
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetTxData
Assigns one of the outgoing transmit buffers with data ready to be sent. 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Count
 
Fc9-u8-icon.png - BYTE d0
 
Fc9-u8-icon.png - BYTE d1
 
Fc9-u8-icon.png - BYTE d2
 
Fc9-u8-icon.png - BYTE d3
 
Fc9-u8-icon.png - BYTE d4
 
Fc9-u8-icon.png - BYTE d5
 
Fc9-u8-icon.png - BYTE d6
 
Fc9-u8-icon.png - BYTE d7
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRxMask
Allows the receive ID mask to be configured on the fly allowing different ID ranges to be received. 
Fc9-u8-icon.png - BYTE Mask
Specifies which receive mask to modify. Range: 0-1 
Fc9-u32-icon.png - ULONG ID
The ID mask value you wish to use 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxData
Returns last received message data byte at position Index. Buffer parameter is currently ignored 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Index
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetRxIDHi
Gets the Hi byte Rx ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous,  
Fc9-u8-icon.png - BYTE Buffer
Receive Buffer. Range 0-1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetTxIDSimple
Set the Tx CAN ID as a generic number. Standard IDs only 0-2047.  
Fc9-u8-icon.png - BYTE Buffer
Transmit buffer to load. Range: 0-2 
Fc9-u16-icon.png - UINT ID
The ID value you wish to use. Range: 0-2047 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SendBuffer
Transmits one of the transmit buffers which should have already been populated with an ID and data. 
Fc9-u8-icon.png - BYTE Buffer
Specifies which transmit buffer to send 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxDataCount
Returns last received message data length. Buffer parameter is currently ignored 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetRxFilterID
sets the Filter Standard mode only (for V5 compatibility only) 
Fc9-u8-icon.png - BYTE Filter
Specifies which filter to modify. Range: 0-5 
Fc9-u8-icon.png - BYTE Hi
ID bits 3-10 
Fc9-u8-icon.png - BYTE Lo
ID bits 0-2 stored in the upper 3 bits of the byte 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxIDLo
Gets the Lo byte Rx ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous,  
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SetRxMaskID
set the Mask Standard ID mode only (for V5 compatibility)  
Fc9-u8-icon.png - BYTE Mask
Specifies which receive mask to modify. Range: 0-1 
Fc9-u8-icon.png - BYTE Hi
ID bits 3-10 
Fc9-u8-icon.png - BYTE Lo
ID bits 0-2 stored in the upper 3 bits of the byte 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetRxFilter
Allows the receive ID filter to be configured on the fly allowing different ID ranges to be received. 
Fc9-u8-icon.png - BYTE Filter
Specifies which receive filter to modify. Range: 0-5 
Fc9-u32-icon.png - ULONG ID
The ID filter value you wish to use 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetTxIdent
Set the Tx CAN ID as a generic number. Standard and extended IDs Standard 0-2047 Extended 2048-536870911  
Fc9-u8-icon.png - BYTE Buffer
Transmit buffer to load. Range: 0-2 
Fc9-u32-icon.png - ULONG ID
The ID or Extended ID value you wish to use. Range: 0-536870911 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CheckRx
Checks to see if any messages are available for 'Buffer' specified  
Fc9-u8-icon.png - BYTE Buffer
Send buffer: 0 to 1 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ChangeRate
Simple attempt to alter the bus rate of the CAN. External CAN channels only, 
Fc9-u8-icon.png - BYTE Rate
Rate: 0-3 where 0=125, 1=250, 2=500, 3=1000 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxIDSimple
Gets the Rx ID as a Integer Standard ID only 0-2047. 
Fc9-u8-icon.png - BYTE Buffer
Receive Buffer. Range 0-1 
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png SetTxID
Set the Tx CAN ID in register format. Standard ID only 0-2047. Compatible with v5 component and previous, 
Fc9-u8-icon.png - BYTE Buffer
Transmit buffer to load. Range: 0-2 
Fc9-u8-icon.png - BYTE Hi
ID bits 3-10 e.g. ((ID & 0x7F8) >> 3) 
Fc9-u8-icon.png - BYTE Lo
ID bits 0-2 stored in the upper 3 bits of the byte e.g. ((ID & 0x7) << 5) 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ShowLEDs
Set LED state (External CAN only)  
Fc9-u8-icon.png - BYTE led1
Controls LED 1. Range: 0-1 
Fc9-u8-icon.png - BYTE led2
Controls LED 2. Range: 0-1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetRxIdent
Gets the Rx ID as a Integer Standard and Extended IDs. 
Fc9-u8-icon.png - BYTE Buffer
 
Fc9-u32-icon.png - ULONG Return


Fc9-comp-macro.png Initialise
Must be called before any other CAN component macros to enable and initialise the CAN peripheral.  
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Channel
Switches between Internal CAN peripheral and External CAN controller IC MCP2515. 
Fc9-type-16-icon.png Controller Osc
 
Fc9-type-16-icon.png Bus Rate
Data rate of the bus specified in thousand bits per second, Kbps. 
Fc9-type-16-icon.png Sync Jump Width
Defines how far a resyncronisation may move the sample point 
Fc9-type-16-icon.png Sample Point
Point in each bit period where the incoming data is sampled. 
Fc9-type-16-icon.png ID Type
Switches between using Standard, or Standard and Extended CAN 
Fc9-type-16-icon.png One Shot Mode
Disabled. Messages will reattempt transmission Enabled. Message will only attempt to transmit once 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png SPI
Fc9-type-16-icon.png CHANNEL
SPI Channel selector 
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-5-icon.png SS
Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
Fc9-type-16-icon.png Prescale
Prescale option selector 
Fc9-type-16-icon.png Sample Point
Data bit read sample point 
Fc9-type-16-icon.png Config Delay
 
Fc9-conn-icon.png TX Buffer 0
Fc9-type-14-icon.png Message ID
TX Buffer 0 Message Identifier 
Fc9-type-14-icon.png Length
TX Buffer 0 Number of data bytes 
Fc9-type-14-icon.png D0
TX Buffer 0 Data Byte 0 
Fc9-type-14-icon.png D1
TX Buffer 0 Data Byte 1 
Fc9-type-14-icon.png D2
TX Buffer 0 Data Byte 2 
Fc9-type-14-icon.png D3
TX Buffer 0 Data Byte 3 
Fc9-type-14-icon.png D4
TX Buffer 0 Data Byte 4 
Fc9-type-14-icon.png D5
TX Buffer 0 Data Byte 5 
Fc9-type-14-icon.png D6
TX Buffer 0 Data Byte 6 
Fc9-type-14-icon.png D7
TX Buffer 0 Data Byte 7 
Fc9-conn-icon.png TX Buffer 1
Fc9-type-14-icon.png Message ID
TX Buffer 1 Message Identifier 
Fc9-type-14-icon.png Length
TX Buffer 1 Number of data bytes 
Fc9-type-14-icon.png D0
TX Buffer 1 Data Byte 0 
Fc9-type-14-icon.png D1
TX Buffer 1 Data Byte 1 
Fc9-type-14-icon.png D2
TX Buffer 1 Data Byte 2 
Fc9-type-14-icon.png D3
TX Buffer 1 Data Byte 3 
Fc9-type-14-icon.png D4
TX Buffer 1 Data Byte 4 
Fc9-type-14-icon.png D5
TX Buffer 1 Data Byte 5 
Fc9-type-14-icon.png D6
TX Buffer 1 Data Byte 6 
Fc9-type-14-icon.png D7
TX Buffer 1 Data Byte 7 
Fc9-conn-icon.png TX Buffer 2
Fc9-type-14-icon.png Message ID
TX Buffer 2 Message Identifier 
Fc9-type-14-icon.png Length
TX Buffer 2 Number of data bytes 
Fc9-type-14-icon.png D0
TX Buffer 2 Data Byte 0 
Fc9-type-14-icon.png D1
TX Buffer 2 Data Byte 1 
Fc9-type-14-icon.png D2
TX Buffer 2 Data Byte 2 
Fc9-type-14-icon.png D3
TX Buffer 2 Data Byte 3 
Fc9-type-14-icon.png D4
TX Buffer 2 Data Byte 4 
Fc9-type-14-icon.png D5
TX Buffer 2 Data Byte 5 
Fc9-type-14-icon.png D6
TX Buffer 2 Data Byte 6 
Fc9-type-14-icon.png D7
TX Buffer 2 Data Byte 7 
Fc9-conn-icon.png RX Buffer 0
Fc9-type-16-icon.png Settings
RX Buffer 0 Message Receive Mode 
Fc9-conn-icon.png RX Buffer 1
Fc9-type-16-icon.png Settings
RX Buffer 1 Message Receive Mode 
Fc9-conn-icon.png Simulation
Fc9-type-10-icon.png Label
Comms Flasher Identification Label 
Fc9-type-7-icon.png Simulate SPI Comms