Component: Temperature (DS18B20) (Environmental)

From Flowcode Help
Revision as of 13:22, 13 August 2021 by BenR (talk | contribs) (XML import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Author MatrixTSL
Version 1.0 (Release)
Category Environmental


Image Temperature (DS18B20) component

A rugged temperature sensor allowing one or more sensors to be addressed and read. Capable of reading temperatures from -55 to +125 degrees C. Requires a One Wire component to perform the bus operations.

Examples

No additional examples


Downloadable macro reference

SampleAllDevices

Performs a temperature conversion on all compatible devices.

The temperature can be read using the ReadTemperature macro.

Brefore calling ReadTemperature you need to use one of the Address macros.

Parameters

BOOL WaitForCompletion
0=Dont Wait, 1=Block and Wait To Complete


Return value

This call does not return a value


AddressSpecificDevice

Starts a temperature conversion on a specific device using a hex string identifier.

SerialNumber parameter should be 12 characters and contain the 48-bit Serial.

Parameters

<- STRING SerialNumber
48-bit Serial Number e.g. "32DF4A3C1901"
This parameter may be returned back to the caller


Return value

This call does not return a value


AddressNextDevice

Scans for the next connected device with a matching family code.

Goes through the device list generated by the ScanBus macro.

Parameters

This macro has no parameters


Return value

This call does not return a value


GetSerialString

Gets the Serial String for the current addressed device.

Parameters

This macro has no parameters


Return value

STRING


GetTemperature

Reads the temperature from the last sample on the selected device.

The selected device is set using the AddressNext or AddressSpecific macros.

Parameters

This macro has no parameters


Return value

FLOAT


SampleAddressedDevice

Performs a temperature conversion on the current addressed device.

Requires one of the Address component macros to be called.

The temperature can be read using the ReadTemperature macro.

Parameters

BOOL WaitForCompletion
0=Dont Wait, 1=Block and Wait To Complete


Return value

This call does not return a value


Initialise

Configures each matching sensor on the bus with the specified conversion bits.

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

One Wire Component

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

Link to the one wire component to host the bus.

Alarm High

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

The high byte of the alarm range

Alarm Low

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

The Low byte of the Alarm range

Conversion Bits

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

The number of bits used to perform a temperature sample.

Controls the conversion time and the resolution.

Max Conversion Time

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

The maximum amount of time in milliseconds it will take for a sample to complete.

Temperature Resolution

This property is of type Floating point and can be referenced with the variable name TempRes.

The maximum resolution steps that the temperature can be read in.

Simulate Comms

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

No - We use the panel GUI to perform the simulation.

Yes - We use OneWire comms via an API to communicate with real hardware.

Number Sensors

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

Sens the number of sensors we can communicate with during simulation

Serial 0

This property is of type Line of text and can be referenced with the variable name Serial0.

Serial number for simulated one wire device