Difference between revisions of "Component: Thermocouple (MCP960X) (Environmental)"
From Flowcode Help
Jump to navigationJump to search (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 1.1 |- | width="20%" style="color:gray...") |
|||
(8 intermediate revisions by the same user not shown) | |||
Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_ThermocoupleMCP960X.fcfx FC_Comp_Source_ThermocoupleMCP960X.fcfx] |
+ | |||
+ | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ThermocoupleMCP960X.fcfx FC_Comp_Source_ThermocoupleMCP960X.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 38: | Line 50: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 62: | Line 84: | ||
[[File:Sim Demo.png]] | [[File:Sim Demo.png]] | ||
− | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Macro reference== | ||
+ | |||
+ | ===Initialise=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Configures the I2C bus ready for communications. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===ReadRawDataADC=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 90: | Line 124: | ||
+ | ===ReadReference_Float=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 103: | Line 138: | ||
+ | ===ReadReference_Int=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadReference_Int''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Returns the Reference (IC die) temperature from the last sample as an integer value. Use Sample first, which samples both reference & themocouple temperatures. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===ReadThermocouple_Float=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadThermocouple_Float''' |
|- | |- | ||
− | | colspan="2" | Returns the thermocouple temperature from the last sample as | + | | colspan="2" | Returns the thermocouple temperature from the last sample as a floating point value. Use Sample first, which samples both reference & themocouple temperatures. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===ReadThermocouple_Int=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadThermocouple_Int''' |
|- | |- | ||
− | | colspan="2" | Returns the thermocouple temperature from the last sample as | + | | colspan="2" | Returns the thermocouple temperature from the last sample as an integer value. Use Sample first, which samples both reference & themocouple temperatures. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT |
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
+ | ===Sample=== | ||
{| 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;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Sample''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Must be called before any of the Read functions. Reads the memory of the MCP9600/1 IC. Returns 0 for 9600. Checks for errors, MCP9601 only. Returns: 0 = OK, 1 = O/ C Themocouple & 2=S/C Themocouple. |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
Latest revision as of 13:13, 7 February 2023
Author | Matrix TSL |
Version | 1.1 |
Category | Environmental |
Contents
Thermocouple (MCP960X) component
Component to interface the MCP960X IC from Microchip. Uses a standard 2-wire I2C interface to connect to the IC and collect the temperature. IC available in different versions to suit different thermocouple types.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_ThermocoupleMCP960X.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_ThermocoupleMCP960X.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Here is a basic example to display both the thermocouple temperature and IC surface temperature.
Sim Demo
Macro reference
Initialise
Initialise | |
Configures the I2C bus ready for communications. | |
- VOID | Return |
ReadRawDataADC
ReadRawDataADC | |
Returns the thermocouple temperature from the last sample as an integer value in Degrees C. | |
- LONG | Return |
ReadReference_Float
ReadReference_Float | |
Returns the reference (IC die) temperature from the last sample as a floating point. Use Sample first, which samples both reference & themocouple temperatures. | |
- FLOAT | Return |
ReadReference_Int
ReadReference_Int | |
Returns the Reference (IC die) temperature from the last sample as an integer value. Use Sample first, which samples both reference & themocouple temperatures. | |
- INT | Return |
ReadThermocouple_Float
ReadThermocouple_Float | |
Returns the thermocouple temperature from the last sample as a floating point value. Use Sample first, which samples both reference & themocouple temperatures. | |
- FLOAT | Return |
ReadThermocouple_Int
ReadThermocouple_Int | |
Returns the thermocouple temperature from the last sample as an integer value. Use Sample first, which samples both reference & themocouple temperatures. | |
- INT | Return |
Sample