Difference between revisions of "Component: EtherCAT Slave (EasyCAT) (Comms: IoT/Cloud)"
From Flowcode Help
Jump to navigationJump to searchLine 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here to download the component source project: [https://www.flowcode.co.uk/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_EasyCat.fcfx FC_Comp_Source_EasyCat.fcfx] |
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EasyCat.fcfx FC_Comp_Source_EasyCat.fcfx] | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EasyCat.fcfx FC_Comp_Source_EasyCat.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 44: | Line 46: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Line 68: | Line 72: | ||
==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;" | '''SetInt''' | ||
+ | |- | ||
+ | | colspan="2" | Write a 16-bit value to the In receive buffer | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | Data Index | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | 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;" | '''MainTask''' | ||
+ | |- | ||
+ | | colspan="2" | Must be called as part of the application main program loop. | ||
+ | |- | ||
+ | |- | ||
+ | | 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;" | '''SetLong''' | ||
+ | |- | ||
+ | | colspan="2" | Write a 32-bit value to the In receive buffer | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | Data Index | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | 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;" | '''GetFloat''' | ||
+ | |- | ||
+ | | colspan="2" | Read a 32-bit floating point value from the Out receive buffer | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | Data Index | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | 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;" | '''GetLong''' | ||
+ | |- | ||
+ | | colspan="2" | Read a 32-bit value from the Out receive buffer | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | Data Index | ||
+ | |- | ||
+ | | 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;" | '''GetInt''' | ||
+ | |- | ||
+ | | colspan="2" | Read a 16-bit value from the Out receive buffer | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | Data Index | ||
+ | |- | ||
+ | | 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;" | '''SetByte''' | ||
+ | |- | ||
+ | | colspan="2" | Write an 8-bit value to the In receive buffer | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | Data Index | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | 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;" | '''GetByte''' | ||
+ | |- | ||
+ | | colspan="2" | Read a 8-bit value from the Out receive buffer | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | Data Index | ||
+ | |- | ||
+ | | 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;" | '''SetFloat''' | ||
+ | |- | ||
+ | | colspan="2" | Write a 32-bit floating point value to the In receive buffer | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Index | ||
+ | |- | ||
+ | | colspan="2" | Data Index | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | 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;" | '''Initialise''' | ||
+ | |- | ||
+ | | colspan="2" | Starts up the SPI connection to the EasyCAT board and configures the board. Returns 1 for a sucessful initialise. | ||
+ | |- | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==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%" | Synchronisation Mode | ||
+ | |- | ||
+ | | colspan="2" | ASYNC = free running i.e. no synchronization between master and slave (default) DC_SYNC = interrupt is generated from the distributed clock unit SM_SYNC = interrupt is generated from the syncronisation manager | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-13-icon.png]] | ||
+ | | width="90%" | Header File | ||
+ | |- | ||
+ | | colspan="2" | Used to load a header file from Easy CAT Configurator tool to describe the units inputs and outputs | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Data Rx | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Total Byte Num Out | ||
+ | |- | ||
+ | | colspan="2" | Total number of bytes to come out from the EtherCAT master | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Data Tx | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Total Byte Num In | ||
+ | |- | ||
+ | | colspan="2" | Total bytes to come in from the EtherCAT master | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | SPI Properties | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | SPI Channel selector | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
+ | | width="90%" | CS / 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. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
+ | | width="90%" | Prescale | ||
+ | |- | ||
+ | | colspan="2" | Prescale option selector | ||
+ | |- | ||
+ | | 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-7-icon.png]] | ||
+ | | width="90%" | Simulation Comms | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |}==Macro reference== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
Revision as of 09:56, 27 January 2023
Author | Matrix TSL |
Version | 1.0 |
Category | Comms: IoT/Cloud |
Contents
EtherCAT Slave (EasyCAT) component
Provides support for the EtherCAT Slave industrial protocol using an EasyCAT Arduino shield. The shield can be driven from a Flowcode compatible Arduino type board or can be driven using an Arduino using the SCADA Slave firmware to drive EtherCAT from the Flowcode simulation runtime. Compatible with the EasyCAT Easy Configurator tool.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_EasyCat.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_EasyCat.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
![]() |
SetInt |
Write a 16-bit value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
MainTask |
Must be called as part of the application main program loop. | |
![]() |
Return |
![]() |
SetLong |
Write a 32-bit value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
GetFloat |
Read a 32-bit floating point value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
GetLong |
Read a 32-bit value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
GetInt |
Read a 16-bit value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
SetByte |
Write an 8-bit value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
GetByte |
Read a 8-bit value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
SetFloat |
Write a 32-bit floating point value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
Initialise |
Starts up the SPI connection to the EasyCAT board and configures the board. Returns 1 for a sucessful initialise. | |
![]() |
Return |
Property reference
==Macro reference==
![]() |
SetInt |
Write a 16-bit value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
MainTask |
Must be called as part of the application main program loop. | |
![]() |
Return |
![]() |
SetLong |
Write a 32-bit value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
GetFloat |
Read a 32-bit floating point value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
GetLong |
Read a 32-bit value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
GetInt |
Read a 16-bit value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
SetByte |
Write an 8-bit value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
GetByte |
Read a 8-bit value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
SetFloat |
Write a 32-bit floating point value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
Initialise |
Starts up the SPI connection to the EasyCAT board and configures the board. Returns 1 for a sucessful initialise. | |
![]() |
Return |
Property reference
==Macro reference==
![]() |
SetInt |
Write a 16-bit value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
MainTask |
Must be called as part of the application main program loop. | |
![]() |
Return |
![]() |
SetLong |
Write a 32-bit value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
GetFloat |
Read a 32-bit floating point value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
GetLong |
Read a 32-bit value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
GetInt |
Read a 16-bit value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
SetByte |
Write an 8-bit value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
GetByte |
Read a 8-bit value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
SetFloat |
Write a 32-bit floating point value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
Initialise |
Starts up the SPI connection to the EasyCAT board and configures the board. Returns 1 for a sucessful initialise. | |
![]() |
Return |
Property reference
==Macro reference==
![]() |
SetInt |
Write a 16-bit value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
MainTask |
Must be called as part of the application main program loop. | |
![]() |
Return |
![]() |
SetLong |
Write a 32-bit value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
GetFloat |
Read a 32-bit floating point value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
GetLong |
Read a 32-bit value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
GetInt |
Read a 16-bit value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
SetByte |
Write an 8-bit value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
GetByte |
Read a 8-bit value from the Out receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Return |
![]() |
SetFloat |
Write a 32-bit floating point value to the In receive buffer | |
![]() |
Index |
Data Index | |
![]() |
Data |
![]() |
Return |
![]() |
Initialise |
Starts up the SPI connection to the EasyCAT board and configures the board. Returns 1 for a sucessful initialise. | |
![]() |
Return |