Jump to content

Component: EtherCAT Slave (EasyCAT) (Comms: IoT/Cloud): Difference between revisions

From Flowcode Help
XML import
 
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{| style="width:50%"
 
{| width="50%"
|-
|-
| width="20%" style="color: gray;" | Author
| width="20%" style="color:gray;" | Author
| Matrix TSL
| Matrix TSL
|-
|-
| width="20%" style="color: gray;" | Version
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
| 1.0
|-
|-
| width="20%" style="color: gray;" | Category
| width="20%" style="color:gray;" | Category
| Comms: IoT/Cloud
| Comms: IoT/Cloud
|}
|}




==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.


==[[File:Component Icon 947089aa_ca9f_4e6f_9f86_7d49a1ae6f86.png|Image]] EtherCAT Slave (EasyCAT) component==
==Component Source Code==
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.


==Examples==
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]
''<span style="color:red;">No additional examples</span>''


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]


==Downloadable macro reference==
==Detailed description==


===<span style="font-weight: normal;"><u><tt>SetInt</tt></u></span>===
Write a 16-bit value to the In receive buffer


'''Parameters'''


:[[Variable Types|BYTE]] ''Index''
::Data Index


:[[Variable Types|UINT]] ''Data''




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>MainTask</tt></u></span>===
Must be called as part of the application main program loop.


'''Parameters'''


:''This macro has no parameters''




'''Return value'''


:[[Variable Types|BYTE]]




===<span style="font-weight: normal;"><u><tt>SetLong</tt></u></span>===
Write a 32-bit value to the In receive buffer


'''Parameters'''


:[[Variable Types|BYTE]] ''Index''
::Data Index


:[[Variable Types|ULONG]] ''Data''




'''Return value'''


:''This call does not return a value''


''No detailed description exists yet for this component''


===<span style="font-weight: normal;"><u><tt>GetFloat</tt></u></span>===
==Examples==
Read a 32-bit floating point value from the Out receive buffer


'''Parameters'''


:[[Variable Types|BYTE]] ''Index''
::Data Index




'''Return value'''


:[[Variable Types|FLOAT]]




===<span style="font-weight: normal;"><u><tt>GetLong</tt></u></span>===
Read a 32-bit value from the Out receive buffer


'''Parameters'''


:[[Variable Types|BYTE]] ''Index''
::Data Index




'''Return value'''


:[[Variable Types|ULONG]]




===<span style="font-weight: normal;"><u><tt>GetInt</tt></u></span>===
Read a 16-bit value from the Out receive buffer


'''Parameters'''


:[[Variable Types|BYTE]] ''Index''
::Data Index




'''Return value'''


:[[Variable Types|UINT]]




===<span style="font-weight: normal;"><u><tt>SetByte</tt></u></span>===
Write an 8-bit value to the In receive buffer


'''Parameters'''


:[[Variable Types|BYTE]] ''Index''
::Data Index


:[[Variable Types|BYTE]] ''Data''
''<span style="color:red;">No additional examples</span>''




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>GetByte</tt></u></span>===
Read a 8-bit value from the Out receive buffer


'''Parameters'''


:[[Variable Types|BYTE]] ''Index''
::Data Index




'''Return value'''


:[[Variable Types|BYTE]]




===<span style="font-weight: normal;"><u><tt>SetFloat</tt></u></span>===
==Macro reference==
Write a 32-bit floating point value to the In receive buffer


'''Parameters'''
===GetByte===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''GetByte'''
|-
| colspan="2" | Read a 8-bit value from the Out receive buffer&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | Data Index&nbsp;
|-
| 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''
|}


:[[Variable Types|BYTE]] ''Index''
::Data Index


:[[Variable Types|FLOAT]] ''Data''
===GetFloat===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''GetFloat'''
|-
| colspan="2" | Read a 32-bit floating point value from the Out receive buffer&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | Data Index&nbsp;
|-
| 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''
|}




'''Return value'''
===GetInt===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''GetInt'''
|-
| colspan="2" | Read a 16-bit value from the Out receive buffer&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | Data Index&nbsp;
|-
| 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''
|}


:''This call does not return a value''


===GetLong===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''GetLong'''
|-
| colspan="2" | Read a 32-bit value from the Out receive buffer&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | Data Index&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''
|}


===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
Starts up the SPI connection to the EasyCAT board and configures the board.


Returns 1 for a sucessful initialise.
===Initialise===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
| colspan="2" | Starts up the SPI connection to the EasyCAT board and configures the board. Returns 1 for a sucessful initialise.&nbsp;
|-
|-
| 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''
|}


'''Parameters'''


:''This macro has no parameters''
===MainTask===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''MainTask'''
|-
| colspan="2" | Must be called as part of the application main program loop.&nbsp;
|-
|-
| 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''
|}




'''Return value'''
===SetByte===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''SetByte'''
|-
| colspan="2" | Write an 8-bit value to the In receive buffer&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | Data Index&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data
|-
| colspan="2" | &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''
|}


:[[Variable Types|BOOL]] : Returns true if the operation is a success, else false


===SetFloat===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''SetFloat'''
|-
| colspan="2" | Write a 32-bit floating point value to the In receive buffer&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | Data Index&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" | Data
|-
| colspan="2" | &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''
|}




==Simulation macro reference==
===SetInt===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''SetInt'''
|-
| colspan="2" | Write a 16-bit value to the In receive buffer&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | Data Index&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Data
|-
| colspan="2" | &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''
|}


''This component does not contain any simulation macros''
 
===SetLong===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''SetLong'''
|-
| colspan="2" | Write a 32-bit value to the In receive buffer&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | Data Index&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
| width="90%" | Data
|-
| colspan="2" | &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==
==Property reference==
<span style="font-weight: normal;"><u>Synchronisation Mode</u></span>


This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''SyncMode''.
{| class="mtx-class-macrotable wikitable"
 
|-
ASYNC = free running i.e. no synchronization between master and slave (default)  
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
 
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
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-16-icon.png]]
 
| width="90%" | Synchronisation Mode
<span style="font-weight: normal;"><u>Header File</u></span>
|-
 
| 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&nbsp;
This property is of type ''Filename'' and can be referenced with the variable name ''HeaderFile''.
|-
 
| width="10%" align="center" | [[File:Fc9-type-13-icon.png]]
Used to load a header file from Easy CAT Configurator tool to describe the units inputs and outputs
| width="90%" | Header File
 
|-
<span style="font-weight: normal;"><u>Total Byte Num Out</u></span>
| colspan="2" | Used to load a header file from Easy CAT Configurator tool to describe the units inputs and outputs&nbsp;
 
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''TotalByteNumOut''.
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
 
| width="90%" class="mtx-class-propfolder" | Data Rx
Total number of bytes to come out from the EtherCAT master
|-
 
|-
<span style="font-weight: normal;"><u>Total Byte Num In</u></span>
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | Total Byte Num Out
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''TotalByteNumIn''.
|-
 
| colspan="2" | Total number of bytes to come out from the EtherCAT master&nbsp;
Total bytes to come in from the EtherCAT master
|-
 
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
<span style="font-weight: normal;"><u>Channel</u></span>
| width="90%" class="mtx-class-propfolder" | Data Tx
 
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::CHANNEL''.
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
SPI Channel selector
| width="90%" | Total Byte Num In
 
|-
<span style="font-weight: normal;"><u>MOSI</u></span>
| colspan="2" | Total bytes to come in from the EtherCAT master&nbsp;
 
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::MOSI''.
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
 
| width="90%" class="mtx-class-propfolder" | SPI Properties
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.
|-
 
|-
<span style="font-weight: normal;"><u>MISO</u></span>
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
 
| width="90%" class="mtx-class-propfolder" | Connections
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::MISO''.
|-
 
|-
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-16-icon.png]]
 
| width="90%" | Channel
<span style="font-weight: normal;"><u>CLK</u></span>
|-
 
| colspan="2" | SPI Channel selector&nbsp;
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::CLK''.
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
SPI Clock Pin CLK - The Clock signal is driven by the SPI master.
| width="90%" | MOSI
 
|-
<span style="font-weight: normal;"><u>CS / SS</u></span>
| colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.&nbsp;
 
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::SS''.
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | MISO
Chip Select / Slave Select Pin  
|-
 
| colspan="2" | SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.&nbsp;
Master Mode: General purpose output pin used to select the remote SPI device.
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
Slave Mode: Hardware chip select pin input used to select the SPI device.
| width="90%" | CLK
 
|-
<span style="font-weight: normal;"><u>Prescale</u></span>
| colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master.&nbsp;
 
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::PR_SCALE''.
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | CS / SS
Prescale option selector
|-
 
| 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;
<span style="font-weight: normal;"><u>Scope Traces</u></span>
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi1::ScopeTraces''.
| width="90%" | Prescale
 
|-
Selects if the scope traces are automatically generated or not
| colspan="2" | Prescale option selector&nbsp;
 
|-
<span style="font-weight: normal;"><u>Console Data</u></span>
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
 
| width="90%" class="mtx-class-propfolder" | Simulation
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi1::ConsoleData''.
|-
 
|-
Selects if the console data is automatically generated or not
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Simulation Comms
<span style="font-weight: normal;"><u>Injector</u></span>
|-
 
| colspan="2" | &nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::Injector''.
|}
 
''<span style="color:red;">No additional information</span>''

Latest revision as of 14:36, 13 July 2026

Author Matrix TSL
Version 1.0
Category Comms: IoT/Cloud


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

GetByte

GetByte
Read a 8-bit value from the Out receive buffer 
- BYTE Index
Data Index 
- BYTE Return


GetFloat

GetFloat
Read a 32-bit floating point value from the Out receive buffer 
- BYTE Index
Data Index 
- FLOAT Return


GetInt

GetInt
Read a 16-bit value from the Out receive buffer 
- BYTE Index
Data Index 
- UINT Return


GetLong

GetLong
Read a 32-bit value from the Out receive buffer 
- BYTE Index
Data Index 
- ULONG Return


Initialise

Initialise
Starts up the SPI connection to the EasyCAT board and configures the board. Returns 1 for a sucessful initialise. 
- BOOL Return


MainTask

MainTask
Must be called as part of the application main program loop. 
- BYTE Return


SetByte

SetByte
Write an 8-bit value to the In receive buffer 
- BYTE Index
Data Index 
- BYTE Data
 
- VOID Return


SetFloat

SetFloat
Write a 32-bit floating point value to the In receive buffer 
- BYTE Index
Data Index 
- FLOAT Data
 
- VOID Return


SetInt

SetInt
Write a 16-bit value to the In receive buffer 
- BYTE Index
Data Index 
- UINT Data
 
- VOID Return


SetLong

SetLong
Write a 32-bit value to the In receive buffer 
- BYTE Index
Data Index 
- ULONG Data
 
- VOID Return


Property reference

Properties
Synchronisation Mode
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 
Header File
Used to load a header file from Easy CAT Configurator tool to describe the units inputs and outputs 
Data Rx
Total Byte Num Out
Total number of bytes to come out from the EtherCAT master 
Data Tx
Total Byte Num In
Total bytes to come in from the EtherCAT master 
SPI Properties
Connections
Channel
SPI Channel selector 
MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
CS / 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.  
Prescale
Prescale option selector 
Simulation
Simulation Comms