Difference between revisions of "Bot test"

From Flowcode Help
Jump to navigationJump to search
Line 1: Line 1:
{| style="width:50%"
+
 
 +
 
 +
{| width="50%"
 
|-
 
|-
| width="20%" style="color:gray;" | Author
+
| width="20%" style="color: gray;" | Author
| Matrix TSL
+
| MatrixTSL
 
|-
 
|-
| width="20%" style="color:gray;" | Version
+
| width="20%" style="color: gray;" | Version
| 1.0
+
| 2.0 (Release)
 
|-
 
|-
| width="20%" style="color:gray;" | Category
+
| width="20%" style="color: gray;" | Category
 
| Comms: System
 
| Comms: System
 
|}
 
|}
  
  
==IO Expander component==
+
 
Provides 16 digital input/output pins arranged into two 8-bit ports using a SPI bus connection. Multiple expanders can be connected to the same SPI peripheral by means of individual chip select pins.
+
==[[File:Component Icon b4e10f9e_4ea9_4fbc_a584_a4d7d4d8fba6.png|Image]] DMX_512 Master component==
 +
A serial based communications protocol designed for controlling theatrical equipment such
 +
as dimmers, fog machines and intelligent lights. DMX-512 Slave devices are daisy chained
 +
together with a final 180R terminating resistor at the end of the chail. DMX requires the signal
 +
to be level shifted from VCC and GND to +2.5V and -2.5V.  
  
 
==Examples==
 
==Examples==
  
 +
DMX Master Example, reads the value of two ports using switch arrays to set the values and then transmits the data in a DMX packet.
  
''<span style="color:red;">No additional examples</span>''
+
{{Fcfile|DMX_Master_Example1.fcfx|DMX Master Example1}}
  
  
 +
DMX Slave Example, captures the first DMX data channel sent from the Master and outputs the value onto a Port using the LED array component.
  
 +
{{Fcfile|DMX_Slave_Example1.fcfx|DMX Slave Example1}}
  
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===<span style="font-weight: normal;"><u><tt>SetDataChannel</tt></u></span>===
|-
+
Sets the data byte in a data channel
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
+
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPort'''
+
'''Parameters'''
|-
+
 
| colspan="2" | Reads a value to one of the ports with a mask. Configures the masked bits to be inputs before reading the input value.&nbsp;
+
:[[Variable Types|UINT]] ''Channel''
|-
+
 
|-
+
:[[Variable Types|BYTE]] ''DataValue''
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
 
| width="90%" | Port
+
 
|-
+
'''Return value'''
| colspan="2" | 0=PortA, 1=PortB&nbsp;
+
 
|-
+
:''This call does not return a value''
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Mask
 
|-
 
| colspan="2" | Allows port bits to be modified without effecting other bits, 255 = write full port.&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;"
+
===<span style="font-weight: normal;"><u><tt>SendDataChain</tt></u></span>===
|-
+
Transmits the BREAK, MAB and StartCode followed by the contents of the data channels.
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ConfigureInversion'''
 
|-
 
| colspan="2" | Configures the pin inversion for the two ports.  Disabled on all pins by default.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | PortA
 
|-
 
| colspan="2" | Port A inversion sent as an 8-bit value, 0 = Disabled, 1 = Enabled&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | PortB
 
|-
 
| colspan="2" | Port B inversion sent as an 8-bit value, 0 = Disabled, 1 = Enabled&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''
 
|}
 
  
 +
'''Parameters'''
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
:[[Variable Types|BYTE]] ''StartCode''
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPortPin'''
 
|-
 
| colspan="2" | Reads a single port pin from one of the ports. Configures the pins to be an input before reading the input value. Returns 0 or 1 corresponding to the value on the port pin.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Port
 
|-
 
| colspan="2" | 0=PortA, 1=PortB&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Pin
 
|-
 
| colspan="2" | Port pin to read. Range: 0-7&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;"
+
'''Return value'''
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WritePortPin'''
 
|-
 
| colspan="2" | Writes a single port pin on one of the ports. Configures the pins to be an output before writing the input value. &nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Port
 
|-
 
| colspan="2" | 0=PortA, 1=PortB&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Pin
 
|-
 
| colspan="2" | Port pin to read. Range: 0-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Value
 
|-
 
| colspan="2" | Value to output on the selected pin. 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''
 
|}
 
  
 +
:''This call does not return a value''
  
{| 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;" | '''WritePort'''
 
|-
 
| colspan="2" | Writes a value to one of the ports with a mask. Configures the masked bits to be outputs before writing the output value.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Port
 
|-
 
| colspan="2" | 0=PortA, 1=PortB&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Mask
 
|-
 
| colspan="2" | Allows port bits to be modified without effecting other bits, 255 = write full port.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Value
 
|-
 
| colspan="2" | Value to write. Range 0-255&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''
 
|}
 
  
 +
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 +
Configures the UART serial interface.
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
'''Parameters'''
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ConfigurePullups'''
 
|-
 
| colspan="2" | Configures the pullups for the two ports. Disabled on all pins by default.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | PortA
 
|-
 
| colspan="2" | Port A pull ups sent as an 8-bit value, 0 = Disabled, 1 = Enabled&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | PortB
 
|-
 
| colspan="2" | Port B pull ups sent as an 8-bit value, 0 = Disabled, 1 = Enabled&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 macro has no parameters''
  
{| 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;" | '''ReadRegister'''
 
|-
 
| colspan="2" | Reads an 8-bit value from a register on the I/O expander device.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Address
 
|-
 
| colspan="2" | Register address to write to. Range: 0-15&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'''
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
:''This call does not return a value''
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''WriteRegister'''
 
|-
 
| colspan="2" | Writes an 8-bit value to a register on the I/O expander device.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Address
 
|-
 
| colspan="2" | Register address to write to. Range: 0-15&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Value
 
|-
 
| colspan="2" | Value to write. Range: 0-255&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;" | '''Initialise'''
 
|-
 
| 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==
  
 +
''This component does not contain any simulation macros''
  
  
 
==Property reference==
 
==Property reference==
 +
<span style="font-weight: normal;"><u>Channel</u></span>
 +
 +
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_uart::CHANNEL''.
 +
 +
UART Channel selector
 +
 +
Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels.
 +
 +
Hardware channels use the selected peripheral on-board the target microcontroller.
 +
 +
<span style="font-weight: normal;"><u>Baud Options</u></span>
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_uart::BAUD_LIST''.
|-
+
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
+
Baud rate option selector
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
+
 
|-
+
<span style="font-weight: normal;"><u>Baud Rate</u></span>
|-
+
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
+
This property is of type ''Signed integer'' and can be referenced with the variable name ''cal_uart::BAUD''.
| width="90%" | External Address
+
 
|-
+
''<span style="color:red;">No additional information</span>''
| colspan="2" | Selects the value of the three address pins for the MCP23S17.&nbsp;
+
 
|-
+
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
+
 
| width="90%" | Channel
+
<span style="font-weight: normal;"><u>TX</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_uart::TX''.
|-
+
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
+
Pin to be used for Transmit data
| width="90%" | Prescale
+
 
|-
+
<span style="font-weight: normal;"><u>Data Channels</u></span>
| colspan="2" | Prescale option selector&nbsp;
+
 
|-
+
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''DataChannels''.
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
+
 
| width="90%" | MOSI
+
Number of data bytes used by the DMX chain, Max 512 bytes per transmission.
|-
+
 
| colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.&nbsp;
+
24 Bytes minimum to match minimum 1204us timing requirements, not all channels need to be used.
|-
+
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
+
<span style="font-weight: normal;"><u>Scope Traces</u></span>
| width="90%" | MISO
+
 
|-
+
This property is of type ''True or false'' and can be referenced with the variable name ''cal_uart::ScopeTraces''.
| colspan="2" | SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.&nbsp;
+
 
|-
+
Selects if the scope traces are automatically added to the data recorder window or not.
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
+
 
| width="90%" | CLK
+
    Simulation - draws an approximation of the UART data onto the scope trace.
|-
+
 
| colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master.&nbsp;
+
    ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD.
|-
+
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
+
<span style="font-weight: normal;"><u>Console Data</u></span>
| width="90%" | CS / SS
+
 
|-
+
This property is of type ''True or false'' and can be referenced with the variable name ''cal_uart::ConsoleData''.
| 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;
+
 
|-
+
Selects if the console data is automatically generated or not
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
+
 
| width="90%" | Use Reset
+
<span style="font-weight: normal;"><u>Console Columns</u></span>
|-
+
 
| colspan="2" | &nbsp;
+
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''cal_uart::ConsoleColumns''.
|-
+
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
+
Number of characters that can be displayed on a single line of the console.
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''  
+
 
|-
+
<span style="font-weight: normal;"><u>Data Source</u></span>
|-
+
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
+
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_uart::DataSource''.
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''  
+
 
|-
+
Simulation data source used to allow the component to connect to various remote devices
|-
+
 
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
+
    Nothing - Simulation data is ignored
| width="90%" | Label
+
 
|-
+
    COM port - Routes the communication data to and from a physical or virtual COM port
| colspan="2" | &nbsp;
+
 
|-
+
    Injector - Routes the communication data via a data injector component on the Panel.
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Scope Traces
 
|-
 
| colspan="2" | Selects if the scope traces are automatically generated or not&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Console Data
 
|-
 
| colspan="2" | Selects if the console data is automatically generated or not&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | API
 
|-
 
| colspan="2" | &nbsp;
 
|}
 

Revision as of 15:38, 26 August 2021


Author MatrixTSL
Version 2.0 (Release)
Category Comms: System


Image DMX_512 Master component

A serial based communications protocol designed for controlling theatrical equipment such as dimmers, fog machines and intelligent lights. DMX-512 Slave devices are daisy chained together with a final 180R terminating resistor at the end of the chail. DMX requires the signal to be level shifted from VCC and GND to +2.5V and -2.5V.

Examples

DMX Master Example, reads the value of two ports using switch arrays to set the values and then transmits the data in a DMX packet.

FC6 Icon.png DMX Master Example1


DMX Slave Example, captures the first DMX data channel sent from the Master and outputs the value onto a Port using the LED array component.

FC6 Icon.png DMX Slave Example1

Downloadable macro reference

SetDataChannel

Sets the data byte in a data channel

Parameters

UINT Channel
BYTE DataValue


Return value

This call does not return a value


SendDataChain

Transmits the BREAK, MAB and StartCode followed by the contents of the data channels.

Parameters

BYTE StartCode


Return value

This call does not return a value


Initialise

Configures the UART serial interface.

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Channel

This property is of type Fixed list of ints and can be referenced with the variable name cal_uart::CHANNEL.

UART Channel selector

Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels.

Hardware channels use the selected peripheral on-board the target microcontroller.

Baud Options

This property is of type Fixed list of ints and can be referenced with the variable name cal_uart::BAUD_LIST.

Baud rate option selector

Baud Rate

This property is of type Signed integer and can be referenced with the variable name cal_uart::BAUD.

No additional information


TX

This property is of type Single digital pin and can be referenced with the variable name cal_uart::TX.

Pin to be used for Transmit data

Data Channels

This property is of type Unsigned integer and can be referenced with the variable name DataChannels.

Number of data bytes used by the DMX chain, Max 512 bytes per transmission.

24 Bytes minimum to match minimum 1204us timing requirements, not all channels need to be used.

Scope Traces

This property is of type True or false and can be referenced with the variable name cal_uart::ScopeTraces.

Selects if the scope traces are automatically added to the data recorder window or not.

   Simulation - draws an approximation of the UART data onto the scope trace.
   ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD.

Console Data

This property is of type True or false and can be referenced with the variable name cal_uart::ConsoleData.

Selects if the console data is automatically generated or not

Console Columns

This property is of type Unsigned integer and can be referenced with the variable name cal_uart::ConsoleColumns.

Number of characters that can be displayed on a single line of the console.

Data Source

This property is of type Fixed list of ints and can be referenced with the variable name cal_uart::DataSource.

Simulation data source used to allow the component to connect to various remote devices

   Nothing - Simulation data is ignored
   COM port - Routes the communication data to and from a physical or virtual COM port 
   Injector - Routes the communication data via a data injector component on the Panel.