Difference between revisions of "Component: DALI Slave (Comms: System)"

From Flowcode Help
Jump to navigationJump to search
 
(7 intermediate revisions by one other user not shown)
Line 16: Line 16:
  
 
==Component Source Code==
 
==Component Source Code==
 +
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_DALI_Slave.fcfx FC_Comp_Source_DALI_Slave.fcfx]
  
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_DALI_Slave.fcfx FC_Comp_Source_DALI_Slave.fcfx]
 
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_DALI_Slave.fcfx FC_Comp_Source_DALI_Slave.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
 +
 +
 +
 +
  
  
Line 31: Line 39:
  
  
 +
An example that shows how to use the Dali Slave to receive packets then take actions accordingly
  
 
+
{{Fcfile|DALI_Slave.fcfx|DALI Slave Example}}
''<span style="color:red;">No additional examples</span>''
 
  
 
==Macro reference==
 
==Macro reference==
  
 +
===CheckForGroupAddress===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveForwardFrame'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckForGroupAddress'''
 
|-
 
|-
| colspan="2" | Attempts to receive an 16-bit command from the master controller.  0xFFFF indicates timeout or no reply&nbsp;
+
| colspan="2" | Tests the 16-bit incoming data for the defined group address Returns 0 for no match, returns 1 for a match&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''
 
|}
 
 
 
 
 
{| 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;" | '''CheckForIndividualAddress'''
 
|-
 
| colspan="2" | Tests the 16-bit incoming data for the defined individual address Returns 0 for no match, returns 1 for a match&nbsp;
 
 
|-
 
|-
 
|-
 
|-
Line 68: Line 64:
  
  
 +
===CheckForIndividualAddress===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CollectDataByte'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckForIndividualAddress'''
 
|-
 
|-
| colspan="2" | Returns the data byte from a 16-bit data packet&nbsp;
+
| colspan="2" | Tests the 16-bit incoming data for the defined individual address Returns 0 for no match, returns 1 for a match&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 86: Line 83:
  
  
 +
===CollectDataByte===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckForGroupAddress'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CollectDataByte'''
 
|-
 
|-
| colspan="2" | Tests the 16-bit incoming data for the defined group address Returns 0 for no match, returns 1 for a match&nbsp;
+
| colspan="2" | Returns the data byte from a 16-bit data packet&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 104: Line 102:
  
  
 +
===CollectPacketType===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 122: Line 121:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===Initialise===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''TransmitBackwardFrame'''
 
|-
 
| colspan="2" | Send out a 8-bit frame consisting of a data byte.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | Data Byte&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''
 
|}
 
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 153: Line 135:
  
  
 
+
===ReceiveForwardFrame===
 
 
==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" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Serial Properties
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | TX Pin
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | RX Pin
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | DALI Slave Properties
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | Individual Address
 
|-
 
| colspan="2" | Address ranging from 0-63&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | Group Address
 
|-
 
| colspan="2" | Address ranging from 0-15&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-16-icon.png]]
 
| width="90%" | API
 
|-
 
| colspan="2" | &nbsp;
 
|}==Macro reference==
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 214: Line 149:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===TransmitBackwardFrame===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckForIndividualAddress'''
 
|-
 
| colspan="2" | Tests the 16-bit incoming data for the defined individual address Returns 0 for no match, returns 1 for a match&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-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;" | '''CollectDataByte'''
 
|-
 
| colspan="2" | Returns the data byte from a 16-bit data packet&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-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;" | '''CheckForGroupAddress'''
 
|-
 
| colspan="2" | Tests the 16-bit incoming data for the defined group address Returns 0 for no match, returns 1 for a match&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-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;" | '''CollectPacketType'''
 
|-
 
| colspan="2" | Returns if the incoming packet was data or a command. Return of 0 = Data Return of 1 = Command&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-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 302: Line 166:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| 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" | Configures the UART serial interface.&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''
 
|}
 
 
 
  
  

Latest revision as of 07:56, 23 September 2024

Author MatrixTSL
Version 1.0
Category Comms: System


DALI Slave component

A serial based communications protocol designed for controlling lighting, specifically digitally controlled dimmable fluorescent ballasts. DALI requires the signals to be level shifted from VCC and GND to +9.5V - +25.5V and GND using external circuitry.

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

An example that shows how to use the Dali Slave to receive packets then take actions accordingly

FC6 Icon.png DALI Slave Example

Macro reference

CheckForGroupAddress

Fc9-comp-macro.png CheckForGroupAddress
Tests the 16-bit incoming data for the defined group address Returns 0 for no match, returns 1 for a match 
Fc9-u16-icon.png - UINT Data
 
Fc9-u8-icon.png - BYTE Return


CheckForIndividualAddress

Fc9-comp-macro.png CheckForIndividualAddress
Tests the 16-bit incoming data for the defined individual address Returns 0 for no match, returns 1 for a match 
Fc9-u16-icon.png - UINT Data
 
Fc9-u8-icon.png - BYTE Return


CollectDataByte

Fc9-comp-macro.png CollectDataByte
Returns the data byte from a 16-bit data packet 
Fc9-u16-icon.png - UINT Data
 
Fc9-u8-icon.png - BYTE Return


CollectPacketType

Fc9-comp-macro.png CollectPacketType
Returns if the incoming packet was data or a command. Return of 0 = Data Return of 1 = Command 
Fc9-u16-icon.png - UINT Data
 
Fc9-u8-icon.png - BYTE Return


Initialise

Fc9-comp-macro.png Initialise
Configures the UART serial interface. 
Fc9-void-icon.png - VOID Return


ReceiveForwardFrame

Fc9-comp-macro.png ReceiveForwardFrame
Attempts to receive an 16-bit command from the master controller. 0xFFFF indicates timeout or no reply 
Fc9-u16-icon.png - UINT Return


TransmitBackwardFrame

Fc9-comp-macro.png TransmitBackwardFrame
Send out a 8-bit frame consisting of a data byte. 
Fc9-u8-icon.png - BYTE Data
Data Byte 
Fc9-u8-icon.png - BYTE Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Serial Properties
Fc9-type-5-icon.png TX Pin
 
Fc9-type-5-icon.png RX Pin
 
Fc9-conn-icon.png DALI Slave Properties
Fc9-type-21-icon.png Individual Address
Address ranging from 0-63 
Fc9-type-21-icon.png Group Address
Address ranging from 0-15 
Fc9-conn-icon.png Simulation
Fc9-type-16-icon.png API