Jump to content

Component: Injector (DS1307 RTC) (): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(12 intermediate revisions by 2 users 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_InjectorDS1307.fcfx FC_Comp_Source_InjectorDS1307.fcfx]


Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_InjectorDS1307.fcfx FC_Comp_Source_InjectorDS1307.fcfx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_InjectorDS1307.fcfx FC_Comp_Source_InjectorDS1307.fcfx]


==Detailed description==
==Detailed description==




Line 42: Line 50:


==Examples==
==Examples==




Line 78: Line 92:
[[File:DS1307Ram.jpg]]
[[File:DS1307Ram.jpg]]


==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;" | '''InitialiseInjector'''
|-
| colspan="2" | Sets up the injector ready to receive commands or send data 
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | InjectorName
|-
| colspan="2" | Name of the console that will be created 
|-
| 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;" | '''RxByteCount'''
|-
| colspan="2" | Returns the number of bytes currently sat in the receive buffer. 
|-
|-
| 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;" | '''TxByte'''
|-
| colspan="2" | Puts a byte onto the comms channel. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | DataByte
|-
| 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;" | '''RxByte'''
|-
| colspan="2" | Attempt to receive a byte back from the injector 0 - 255 = Valid data 256 = RX timeout no data available 
|-
|-
| 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;" | '''GetConsoleHandle'''
|-
| colspan="2" | Gets the handle to the console allowing data displaying on the panel etc. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ChangeState===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ChangeState'''
| width="90%" class="mtx-class-macrohead" | '''ChangeState'''
|-
|-
| colspan="2" | Changes the state for I2C or SPI type comms where the data bytes along are not enough to go on. 
| colspan="2" | Changes the state for I2C or SPI type comms where the data bytes along are not enough to go on. 
Line 173: Line 123:




 
===GetConsoleHandle===
 
{| class="mtx-class-macrotable wikitable"
==Property reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''GetConsoleHandle'''
|-
|-
| colspan="2" | Gets the handle to the console allowing data displaying on the panel etc. 
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | DS1307 Injector Settings
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" | Circular Buffer Size
|}
|-
 
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Termination Character
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Device Address
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Day Setting
|-
| colspan="2" | Configures how the day of the week is calculated. 
|}==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===InitialiseInjector===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''InitialiseInjector'''
| width="90%" class="mtx-class-macrohead" | '''InitialiseInjector'''
|-
|-
| colspan="2" | Sets up the injector ready to receive commands or send data 
| colspan="2" | Sets up the injector ready to receive commands or send data 
Line 226: Line 156:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===RxByte===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RxByteCount'''
| width="90%" class="mtx-class-macrohead" | '''RxByte'''
|-
|-
| colspan="2" | Returns the number of bytes currently sat in the receive buffer. 
| colspan="2" | Attempt to receive a byte back from the injector 0 - 255 = Valid data 256 = RX timeout no data available 
|-
|-
|-
|-
Line 239: Line 170:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===RxByteCount===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''TxByte'''
| width="90%" class="mtx-class-macrohead" | '''RxByteCount'''
|-
|-
| colspan="2" | Puts a byte onto the comms channel. 
| colspan="2" | Returns the number of bytes currently sat in the receive buffer. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | DataByte
|-
| 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;" | '''RxByte'''
|-
| colspan="2" | Attempt to receive a byte back from the injector 0 - 255 = Valid data 256 = RX timeout no data available 
|-
|-
|-
|-
Line 270: Line 184:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===TxByte===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetConsoleHandle'''
| width="90%" class="mtx-class-macrohead" | '''TxByte'''
|-
|-
| colspan="2" | Gets the handle to the console allowing data displaying on the panel etc. 
| colspan="2" | Puts a byte onto the comms channel. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE
| 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;" | '''ChangeState'''
|-
| colspan="2" | Changes the state for I2C or SPI type comms where the data bytes along are not enough to go on. 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | NewState
| width="90%" | DataByte
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 299: Line 201:
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | DS1307 Injector Settings
| width="90%" class="mtx-class-propfolder" | DS1307 Injector Settings
|-
|-
|-
|-

Latest revision as of 14:37, 13 July 2026

Author Matrix Ltd
Version 1.1
Category


Injector (DS1307 RTC) component

Comms data injector to allow simulation of a DS1307 Real Time Clock and RAM.

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

This example uses the I2C master component combined with the DS1307 injector to simulate an I2C communications bus between the target Microcontroller and the virtual DS1307 device. I2C DS1307 Example The panel displays the current time from the DS1307 RAM which is populated to match the system time.


The I2C console shows the communications between the target microcontroller and simulated I2C device.


The DS1307 console shows the contents of RAM memory on the simulated I2C device.






Macro reference

ChangeState

ChangeState
Changes the state for I2C or SPI type comms where the data bytes along are not enough to go on. 
- BYTE NewState
 
- VOID Return


GetConsoleHandle

GetConsoleHandle
Gets the handle to the console allowing data displaying on the panel etc. 
- HANDLE Return


InitialiseInjector

InitialiseInjector
Sets up the injector ready to receive commands or send data 
- STRING InjectorName
Name of the console that will be created 
- BYTE Return


RxByte

RxByte
Attempt to receive a byte back from the injector 0 - 255 = Valid data 256 = RX timeout no data available 
- UINT Return


RxByteCount

RxByteCount
Returns the number of bytes currently sat in the receive buffer. 
- UINT Return


TxByte

TxByte
Puts a byte onto the comms channel. 
- BYTE DataByte
 
- VOID Return


Property reference

Properties
DS1307 Injector Settings
Circular Buffer Size
 
Termination Character
 
Device Address
 
Day Setting
Configures how the day of the week is calculated.