0% found this document useful (0 votes)
23 views33 pages

sfc6000d-20slm Manual

Uploaded by

baklaciarmagan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views33 pages

sfc6000d-20slm Manual

Uploaded by

baklaciarmagan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

SFC6xxx and SFM6xxx RS485

SHDLC Interface

Document Summary
This document describes the SHDLC RS485 communication interface of the Sensirion SFC6xxx mass
flow controller and SFM6xxx mass flow meter.
The intention of defining the SHDLC protocol was to have a single protocol for different Sensirion
devices such as mass flow controllers, meters, and other microcontroller devices. The protocol is
based on serial communication and is easy to implement. It allows communication between a single
master and several connected slave devices.

In the following, there are some of the SHDLC protocol key features:

• Based on an byte orientated hardware (like UART,. . . )

• Half-duplex system, which allows to use half-duplex hardware

• Single Master/Multiple Slaves protocol without the need for bus arbitration

• Allows up to 255 bytes payload data for read or write transfers

• Broadcasting allows to safe bus load and synchronize devices


SFC6xxx and SFM6xxx RS485 SHDLC Interface

Contents

1 Hardware ...............................................................................................................................................................4

1.1 RS485/RS422 .............................................................................................................................. 4

2 Frame Definition..................................................................................................................................................5

2.2 Type of Frames ........................................................................................................................... 5

2.2.1 MOSI Frame ................................................................................................................................ 5

2.2.2 MISO Frame ................................................................................................................................ 5

2.3 Start and Stop ............................................................................................................................ 6

2.4 Address Field .............................................................................................................................. 6

2.5 Command.................................................................................................................................... 6

2.6 State ............................................................................................................................................. 7

2.7 Length .......................................................................................................................................... 7

2.7.1 Execution Error Code ................................................................................................................ 7

2.7.2 Device Error Code ...................................................................................................................... 7

2.8 Data .............................................................................................................................................. 7

2.9 Checksum .................................................................................................................................... 8

3 Protocol Definition .............................................................................................................................................9

3.1 Transfer Types ............................................................................................................................ 9

3.1.1 Standard Transfer ...................................................................................................................... 9

3.1.2 Broadcast Transfer..................................................................................................................... 9

3.2 Error Response ......................................................................................................................... 10

4 Protocol Timings ...............................................................................................................................................11

4.1 Interbyte Timeout.................................................................................................................... 11

4.2 Slave Response Timeout ........................................................................................................ 11

5 Data Types and Representation ......................................................................... Error! Bookmark not defined.

5.1 Integer ....................................................................................................................................... 12

5.2 Boolean...................................................................................................................................... 12
www.sensirion.com 2 / 26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

5.3 Float (32 bit single precision) ................................................................................................ 12

5.4 String ......................................................................................................................................... 13

6 Commands ..........................................................................................................................................................14

6.1 [0x00] Setpoint......................................................................................................................... 14

6.1.1 Get/Set Setpoint ...................................................................................................................... 14

6.2 [0x08] Read Measured Value................................................................................................. 15

6.2.1 Read Measured Value ............................................................................................................. 15

6.2.2 Read Averaged Measured Value........................................................................................... 15

6.3 [0x03] Set Setpoint And Read Measured Value ................................................................. 16

6.3.1 Set Setpoint And Read Measured Value ................................ Error! Bookmark not defined.

6.4 [0x22] Controller Configuration............................................................................................ 17

6.4.1 Get/Set User Controller Gain ................................................................................................. 17

6.4.2 Get/Set User Init Step ............................................................................................................. 18

6.5 [0x30] Advanced Measurements .......................................................................................... 19

6.5.1 Measure Raw Flow................................................................................................................... 19

6.5.2 Measure Raw Thermal Conductivity With Closed Valve .................................................. 19

6.5.3 Measure Temperature ............................................................................................................ 19

6.6 [0x40] Get Calibration Information ...................................................................................... 19

6.6.1 Get Number Of Calibrations .................................................................................................. 20

6.6.2 Get Calibration Validity .......................................................................................................... 20

6.6.3 Get Calibration Gas Id ............................................................................................................. 21

6.6.4 Get Calibration Gas Unit......................................................................................................... 22

6.6.5 Get Calibration Fullscale ......................................................................................................... 22

6.7 [0x44] Get Current Calibration Information ....................................................................... 22

6.7.1 Get Current Gas Id ................................................................................................................... 23

6.7.2 Get Current Gas Unit ............................................................................................................... 23

6.7.3 Get Current Fullscale ............................................................................................................... 23


www.sensirion.com 3 / 26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6.8 [0x45] Get/Set Calibration ..................................................................................................... 24

6.9 [0x46] Set Calibration Volatile .............................................................................................. 24

6.10 [0x90] Get/Set Slave Address ................................................................................................ 25

6.11 [0x91] Get/Set Baudrate ......................................................................................................... 26

6.12 [0xD0] Device Information..................................................................................................... 27

6.12.1 Get Product Type ..................................................................................................................... 27

6.12.2 Get Product Name ................................................................................................................... 27

6.12.3 Get Article Code ....................................................................................................................... 27

6.12.4 Get Serial Number ................................................................................................................... 28

6.13 [0xD1] Get Version ................................................................................................................... 28

6.14 [0xD3] Device Reset ................................................................................................................ 28

7 Appendix..............................................................................................................................................................30

7.1 Gas unit decoding ................................................................................................................... 30

7.1.1 Prefix .......................................................................................................................................... 30

7.1.2 Unit............................................................................................................................................. 31

7.1.3 Time Base .................................................................................................................................. 31

7.2 State Response Error Codes................................................................................................... 32

www.sensirion.com 4 / 26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

1 Hardware

1.1 RS485/RS422

As shown in the picture above, the RS485/422 setup combined with the SHLDC addressing allows to
connect several SHDLC devices on the same bus. Due to the differential signals, the communication is
robust against disturbances and allows long distance data transmission. For long distance data lines a
termination resistor of 120 Ohm is recommended on both ends of the bus. The logic behind the
protocol is based on a UART hardware, using the following settings:

• Baudrate as defined in datasheet (default: 115’200 baud)

• 8 Data bits (LSb first)

• No Parity

• 1 Stop Bit

www.sensirion.com 4 / 26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

2 Frame Definition

Every transfer in SHDLC is based on MOSI (Master Out Slave In) and MISO (Master In Slave Out)
frames. In the following chapter, the composition of the frames and the meaning of the different
frame parts is shown.

2.1.1.1 Note
In the following, the order of the bytes in frames is defined. The order of the bits inside
a byte (MSb/LSb) is defined by the used hardware.

2.2 Type of Frames

2.2.1 MOSI Frame

The MOSI frame is the message sent from master to slave as a request. Communication on the SHDLC
bus is always initiated by the master. Therefore, this frame is always the begin of communication on the
bus:

The begin and end of the frame is marked by start and stop bytes, which are unique bytes (0x7E) in the
frame (guaran- teed by byte suffing, see Section 5.2). After the start byte, the address field defines the
receiver of the frame, followed by the command which tells the slave what to do with the data. Before
the payload data is sent, there is a length information (L) and after the data a checksum to guarantee
the validity of the data.

2.2.2 MISO Frame

The MISO frame is the response from a slave device after reception of the MOSI frame. The SHDLC
protocol guarantees an answer on any master request (except broadcast commands). This allows
the master to ensure his request was correctly transferred and processed. The MISO frame looks
as follows:

It is similar to the MOSI frame, except the additional state byte. In this field, the slave reports any
problem during command execution and additional general health information. In the address field,
the slave fills in his own address and in the command field the command which was received and
executed.

www.sensirion.com 5 / 26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

2.3 Start and Stop

Since SHDLC does not use hardware handshaking, we are using special bytes in the data stream to
mark the begin and end of a frame:

• Start: 0x7E (01111110b)

• Stop: 0x7E (01111110b)

To make this work properly, we have to avoid this byte (0x7E) inside the frame. For this reason, byte
stuffing is used, which means we are replacing 0x7E anywhere inside the frame with a sequence of
two other bytes. This will also be done for Escape (0x7D), XON (0x11) and XOFF (0x13) bytes. The
following table shows how the original data bytes are replaced in the sent data. All other data bytes
are sent 1:1.

Original data byte Transferred data


bytes
0x7E 0x7D, 0x5E
0x7D 0x7D, 0x5D
0x11 0x7D, 0x31
0x13 0x7D, 0x33

2.4 Address Field

The address field in the MOSI frame (1 Byte) defines the receiver of the frame (slave device
address). The address range is divided as follows:

• 0. . . 254: Slave addresses (All device addresses are initially set to 0x0, and can be changed with the
get/set slave address command)

• 255: Broadcast address

In a MISO frame the address field contains the slave address (address of the slave which has sent the
MISO frame).

2.5 Command

Typically (in a MOSI frame), this field contains the application command which defines for the specific
application what to do with the given data. There are some reserved commands which are used for
special frame transfers. In a MISO frame the slave will return the received and processed command in
the CMD field.

The following table shows the organization of the available command space:

Command ID Size Usage


(Hex)
0x00 .. 0x7F 128 Individual, device specific commands. The meaning and
payload data of these commands depend on the type of
device.
0x80 .. 0xEF 112 Common commands. The meaning and payload data of
these commands are identical for all device types. However,
not all commands are supported by each device type, i.e. the
commands are optional.
0xF0 .. 0xFF 16 Special frame identifiers.

www.sensirion.com 6 / 26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

The size of the command is 1 byte.


2.6 State

The MISO frame contains a state byte, which allows the master to detect errors on slave side. There
are two kinds of errors signalized in the state byte:

• Execution Errors

• Device Error Flag

The following table shows the composition of the state byte:

b7 b6 b5 b4 b3 b2 b1 b0
Device
Error Execution error
Flag code

2.7 Length

The length byte defines the number of transferred bytes in the data field (Rx or Tx). It is the length
of the data field before byte stuffing, not the number of bytes which are transferred (because they
contain stuffed bytes).

Example: The sender wants to transmit data [0xA7, 0xB4, 0x7E, 0x24]. Because of byte stuffing, it
needs to transmit the stream [0xA7, 0xB4, 0x7D, 0x5E, 0x24]. The transmitted length information
in this case is 0x04.

2.7.1 Execution Error Code

The execution error code signalizes all errors which occured while processing the frame or executing
the command. The errors are binary encoded in 7 bits with the following meaning:

Error Code Meaning


0x00 No Error. Processing and execution of the command was successful.
0x01 . . . Common error codes, which have the same meaning on every SHDLC
0x1F device.
0x20 . . . Error codes which are specific for every device. See appendix for
0x7F definition.

2.7.2 Device Error Code

Device Error Flag is not used in SFx6xxx, this flag is always zero.

2.8 Data

The data has a usable size of [0. . . 255] bytes (original data, before byte stuffing). The meaning of
the data content is defined in the command section.

www.sensirion.com 7 / 26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

2.9 Checksum

The checksum is built before byte stuffing and checked after removing stuffed bytes from the frame.
It is calculated as follows:

1. Sum all bytes between start and stop (without start and stop bytes)

2. Take the LSB of the result and invert it. This will be the checksum.

2.9.1.1 Length

Consider this MOSI frame (without start/stop and without byte stuffing):

The checksum calculates as follows:

ADR 0x02
CMD 0x43
L 0x04
Data 0 0x64
Data 1 0xA0
Data 2 0x22
Data 3 0xFC
Sum of all Bytes 0x26B
LSB of the Sum 0x6B
Inverted (=Checksum) 0x94

www.sensirion.com 8 / 26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

3 Protocol Definition

This chapter describes the frame communication protocol in a SHDLC system. There are some basic
rules:

1. On every master request (MOSI frame), the slave will respond with a slave response (MISO
frame). There are two exclusions where the slave will not send a response:

• If the checksum of a MOSI frame did not match


• If the MOSI frame was a broadcast

2. Between receiving a MOSI frame and sending slave response, the slave will not accept any
other frame from master. In case of a broadcast, the master must wait for the specified
command execution time.

3.1 Transfer Types

By default, the master sends a standard frame which contains up to 255 bytes Tx data. This is called a
standard frame transfer. Additionally, there are some special frame transfers defined. They are marked
with a special frame identifier in the CMD field of the frame. The following chapters describe the
different transfer types.

3.1.1 Standard Transfer

In this transfer, the master initiates a transfer with a MOSI frame containing command ID and up to 255
bytes of Tx data. After executing the command, the slave will respond with a MISO frame containing
state and up to 255 bytes of Rx data. The command field of the frame is used for an application
command.
The transfer looks as follows:

3.1.2 Broadcast Transfer

After sending a broadcast command (ADR = 0xFF), the slave executes the command but does not send
the generated response. The “Get Broadcast Response” frame allows the master to get the slave
response on a previously sent broadcast command.
The following shows an example with two slaves:

www.sensirion.com 9 / 26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

If the broadcast transfer is followed by a “Get Broadcast Response” frame, the slave will send the
buffered answer. If any other frame is sent, the buffered response is discarded.
The frame to get the broadcast response (MOSI) looks as follows and has to be addressed to a
specific slave device:

The slave answers with the same response as on an addressed command.

3.2 Error Response

In case of a command execution error, the device will return an error response. This response is
transmitted without data (L=0). That means that a simple error response looks alike for any transfer
type:

www.sensirion.com 10 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

4 Protocol Timings

4.1 Interbyte Timeout

The interbyte time defines the time between two bytes in the same frame. After reception of a frame
byte, the receiver waits for the next frame byte. This time is limited by the interbyte timeout. See the
following timing diagram which defines the interbyte time:

The interbyte timeout is set to 200ms. If a timeout occurs on slave side, the received data is discarded, and
no response frame will be sent to the master.

4.2 Slave Response Timeout

The slave response time is the time between the MOSI frame has left the master port and the begin of
the reception of the MISO frame. This time is defined in the command reference.

The timeout should be at least twice the specified maximum response time of the corresponding
command and in non real time systems it should not be smaller than 200ms due to possible system
side delays.

www.sensirion.com 11 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

5 Data Types and Representation

The data in the frames is transmitted in big-endian order (MSB first).

5.1 Integer

Integers can be transmitted as signed or unsigned integers. If signed, use the two’s complement. The
following types of integers are known:

Integer Size Range


Type
u8t 1 Byte 0 . . . 28-1
u16t 2 Byte 0 . . . 216-1
u32t 4 Byte 0 . . . 232-1
u64t 8 Byte 0 . . . 264-1
i8t 1 Byte -27 . . . 27-1
i16t 2 Byte -215 . . .
215-1
i32t 4 Byte -231 . . .
231-1
i64t 8 Byte -263 . . .
263-1

5.2 Boolean

A boolean is represented by 1 byte:

• False = 0

• True = 1. . . 255

5.3 Float (32 bit single precision)

For floating-point representation, the IEEE 754 format is used which has the following structure:

Use the following coding to signal invalid float, positive or negative infinity:

Value Coding (hex)


invalid float 0xFFFFFFFF
(NaN)
+ infinity 0x7F800000
- infinity 0xFF800000

www.sensirion.com 12 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

5.4 String

Strings are transferred as C-strings. This means in ASCII coding, one byte per character and
terminated with a final null-character (0x00). The first letter will be sent first.

To make string handling as safe and robust as possible, it’s highly recommended to follow these rules
when implementing an SHDLC master:
• When sending strings to the slave (MOSI data), always terminate the string with exactly one null-
character (0x00). In case a fixed data length is specified for a particular string (e.g. if more MOSI
parameters are following that string), fill all unused data bytes after the null-termination with 0x00
as well. But usually, string parameters are specified with a variable data length, i.e. no such padding
is needed.

• When receiving strings from the slave (MISO data), parse the string up to the first null-character
(0x00) in the received data and discard all the following data bytes (if any). In case no null-
character is contained in the whole frame data, take the received data length into account to
determine the string length, i.e. abort string parsing after the last data byte to accept strings which
are not null-terminated.

www.sensirion.com 13 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6 Commands

6.1 [0x00] Setpoint

6.1.1 Get/Set Setpoint

Get Setpoint
Description Get the current flow setpoint as a physical value.
Command ID 0x00
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x01.
MISO Data Byte # Description
0 ... Setpoint: float
3 The current setpoint.

Set Setpoint
Description Set the flow setpoint as a physical value which is used by the flow
controller as
reference input.

Note
the setpoint is set to 0 if calibration is changed
0
Command ID 0x00
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x01.
1 ... Setpoint: float
4 The new setpoint
MISO Data None

www.sensirion.com 14 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6.2 [0x08] Read Measured Value

6.2.1 Read Measured Value

The command returns the latest measured flow as physical value.

Read Measured Value


Command ID 0x08
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x01.
MISO Data Byte # Description
0 ... Measured Value: float
3 The latest measured flow.

6.2.2 Read Averaged Measured Value

The command returns the average of given numbers of flow measurement as a physical value. A
single measurement has a duration of 1ms, so the command response time depends on the given
number of measurements to average.

Read Averaged Measured Value


Command ID 0x08
Max. Response Time 200 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x11.
1 Measurements: uint8
number of measurements to average(1..100)
MISO Data Byte # Description
0 ... Averaged Measured Value: float
3 The averaged flow measurement.

www.sensirion.com 15 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6.3 [0x03] Set Setpoint and Read Measured Value

This command is a combination of the two commands "Set Setpoint (0x00)" and "Read Measured
Value (0x08)". It is intended for process data exchange (setpoint and flow) and saves a lot of protocol
overhead compared to separate command usage.

Set Setpoint And Read Measured Value


Command ID 0x03
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x01.
1 ... Setpoint: float
4 The new setpoint as physical value.
MISO Data Byte # Description
0 ... Measured Value: float
3 The latest measured flow as physical value.

www.sensirion.com 16 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6.4 [0x22] Controller Configuration

Get and set user settings of the flow controller.

6.4.1 Get/Set User Controller Gain

Get User Controller Gain


Description Get the user controller gain.
Command ID 0x22
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x00.

Get User Controller Gain


MISO Data Byte # Description
0 ... 3 Gain: float
The current user controller gain.

Set User Controller Gain


Description Set the user controller gain.

Note
This configuration is not stored in non-volatile memory
of the device and this not persists after a device reset.
Command ID 0x22
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x00.
1 ... Gain: float
4 The user controller gain to set.
MISO Data None

www.sensirion.com 17 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6.4.2 Get/Set User Init Ste

Get User Init Step


Description Get the user init step of flow controller
Command ID 0x22
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x03.
MISO Data Byte # Description
0 ... Init Step: float
3 The current user init step.

Set User Init Step


Description Set the init step of flow controller

Note
This configuration is not stored in non-volatile memory
of the device, and this does not persist after a device
reset.
Command ID 0x22
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x03.
1 ... Init Step: float
4 the user init step to set.
MISO Data None

www.sensirion.com 18 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6.5 [0x30] Advanced Measurements

Advanced measurements for get more information about gas characteristics

6.5.1 Measure Raw Flow

Return the measured raw flow ticks from the sensor.

Measure Raw Flow


Command ID 0x30
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x00.
MISO Data Byte # Description
0 ... Flow: uint16
1 Measured raw flow in ticks.

6.5.2 Measure Raw Thermal Conductivity With Closed Valve

Perform a thermal conductivity measurement and return the measured raw tick value. The valve is
automatically closed during the measurement.

Measure Raw Thermal Conductivity With Closed Valve


Command ID 0x30
Max. Response Time 600 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x02.
MISO Data Byte # Description
0 ... Thermal Conductivity: uint16
1 Measured raw thermal conductivity in ticks.

6.5.3 Measure Temperature

Return the temperature of flow sensor.

Measure Temperature
Command ID 0x30
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x10.
MISO Data Byte # Description
0 ... Temperature: float
3 Measured temperature [°C].

6.6 [0x40] Get Calibration Information

This command allows to read information about all available gas calibrations on the device.
www.sensirion.com 19 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6.6.1 Get Number of Calibrations

Get the number of calibrations, i.e. how many calibration the device memory is able to hold.

6.6.1.1 Note
Not all calibrations actually contain a valid gas calibration. Use the command Get
0 Calibration Validity to check which calibrations are valid and thus can be activated.

Get Number Of Calibrations


Command ID 0x40
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x00.
MISO Data Byte # Description
0 ... Number Of Calibrations: uint32
3 Number of calibrations.

6.6.2 Get Calibration Validity

Check whether there exists a valid calibration at a specific index or not.

Get Calibration Validity


Command ID 0x40
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x10.
1 ... Index: uint32
4 The index to check whether there is a valid calibration
or not.
MISO Data Byte # Description
0 Validity: bool
Whether there exists a valid calibration at the specified
index or
not.

www.sensirion.com 20 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6.6.3 Get Calibration Gas Id

Get the gas ID of a specific calibration index.

Get Calibration Gas Id


Command ID 0x40
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x12.
1 ... Index: uint32
4 The calibration index to read the requested information
from.
MISO Data Byte # Description
0 ... Gas Id: uint32
3 The read gas ID.

www.sensirion.com 21 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6.6.4 Get Calibration Gas Unit

Get the gas unit of a specific calibration index.

Get Calibration Gas Unit


Command ID 0x40
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x13.
1 ... Index: uint32
4 The calibration index to read the requested information
from.
MISO Data Byte # Description
0 Prefix: int8
Medium unit prefix, see appendix for encoding.
1 Unit: uint8
Medium unit, see appendix for encoding.
2 Timebase: uint8
Timebase, see appendix for encoding.

6.6.5 Get Calibration Full scale

Get the full scale flow of a specific calibration index.

Get Calibration Fullscale


Command ID 0x40
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x14.
1 ... Index: uint32
4 The calibration index to read the requested information
from.
MISO Data Byte # Description
0 ... Fullscale: float
3 The read fullscale flow in the unit of the corresponding
calibration.

6.7 [0x44] Get Current Calibration Information

Returns calibration information of the current (active) calibration.

www.sensirion.com 22 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6.7.1 Get Current Gas Id

Get the gas ID of the currently active calibration.

Get Current Gas Id


Command ID 0x44
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x12.
MISO Data Byte # Description
0 ... 3 Gas Id: uint32
The read gas ID.

6.7.2 Get Current Gas Unit

Get the gas unit of the currently active calibration.

Get Current Gas Unit


Command ID 0x44
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x13.
MISO Data Byte # Description
0 Prefix: int8
Medium unit prefix, see appendix for encoding.
1 Unit: uint8
Medium unit, see appendix for encoding.
2 Timebase: uint8
Timebase, see appendix for encoding.

6.7.3 Get Current Full scale

Get the full scale flow of the currently active calibration.

Get Current Full scale


Command ID 0x44
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x14.
MISO Data Byte # Description
0 ... Full scale: float
3 The read full scale flow in the unit of the corresponding
calibration.

www.sensirion.com 23 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6.8 [0x45] Get/Set Calibration

Get Calibration
Description This command returns the actual set calibration number of Flow
controller.
Command ID 0x45
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data None
MISO Data Byte # Description
0 ... 3 Calibration Number: uint32
The current activated calibration number.

Set Calibration
Description This command stops the controller, changes the used calibration of
the flow controller and starts the controller. The selected calibration is
stored and also used after a power-on or reset.
Note
Because of the limited write cycles of the flash, this
command should not be called periodically with new
calibration (max. 50’000 times). If calibration is already
0 selected the function will not do a write cycle to flash.

Command ID 0x45
Max. Response Time 50 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 ... 3 Calibration Number: uint32
The calibration number to activate.
MISO Data None

6.9 [0x46] Set Calibration Volatile

This command stops the controller, changes the used calibration of the flow controller and starts
the controller. The selected calibration is not stored to non volatile memory.

Set Calibration Volatile


Command ID 0x46
Max. Response Time 20 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 ... 3 Calibration Number: uint32
The calibration number to activate.
MISO Data None

www.sensirion.com 24 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6.10 [0x90] Get/Set Slave Address

This command changes the device address.

Get Slave Address


Description Gets the SHDLC slave address of the device.
Command ID 0x90
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data None
MISO Data Byte # Description
0 Slave Address: uint8
The current slave address of the device.

Set Slave Address


Description Sets the SHDLC slave address of the device.

Note
The slave address is stored in non-volatile memory of
the device and thus persists after a device reset. So the
next time connecting to the device, you have to use
the new address. When changing the address of a
slave, make sure there isn’t already a slave with that
address on the same bus! In that case you would get
communication issues which can only be fixed by
disconnecting one of the slaves.
Command ID 0x90
Max. Response Time 50 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Slave Address: uint8
The new slave address to set.
Allowed range: 0 . . . 254
MISO Data None

www.sensirion.com 25 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface

6.11 [0x91] Get/Set Baudrate

Get Baudrate
Description Gets the SHDLC baudrate of the device.
Command ID 0x91
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data None
MISO Data Byte # Description
0 ... 3 Baudrate: uint32
Current baudrate in bit/s.

Set Baudrate
Description Sets the SHDLC baudrate of the device.

Note
The baudrate is stored in non-volatile memory of the
device and thus persists after a device reset. The next
time you connect to the device, you have to use the
new baudrate.
Command ID 0x91
Max. Response Time 50 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 ... 3 Baudrate: uint32
The new baudrate in bit/s. Allowed values are 9600,
19200,
38400, 57600 and 115200 (default)
MISO Data None

www.sensirion.com 26 /
26
SFC6xxx and SFM6xxx RS485 SHDLC Interface
6.12 [0xD0] Device Information

6.12.1 Get Product Type

Gets the product type from the device.

Get Product Type


Command ID 0xD0
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x00.
MISO Data Byte # Description
0 ... Product Type: string
n String containing the product type.

6.12.2 Get Product Name

Get Product Name


Description Gets the product name from the device.
Command ID 0xD0
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x01.
MISO Data Byte # Description
0 ... Product Name: string
n String containing the product name.

6.12.3 Get Article Code

Get Article Code


Description Get the article code of the device. This information is also contained
on the product label.
Command ID 0xD0
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x02.
MISO Data Byte # Description
0 ... Article Code: string
n The article code as an ASCII string.

© Copyright Sensirion AG, Switzerland 27/33


SFC6xxx and SFM6xxx RS485 SHDLC Interface
6.12.4 Get Serial Number

Get Serial Number


Description Gets the serial number of the SFC6xxx sensor.
Command ID 0xD0
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data Byte # Description
0 Subcommand: uint8
Must be set to 0x03.
MISO Data Byte # Description
0 . . .n Serial Number: string
String containing the serial number of the SFC6xxx
sensor.

6.13 [0xD1] Get Version

Gets the version information for the hardware, firmware and SHDLC protocol.

Get Version
Command ID 0xD1
Max. Response Time 10 ms
Post Processing Time 0 ms
MOSI Data None
MISO Data Byte # Description
0 Firmware Major: uint8
Firmware major version number.
1 Firmware Minor: uint8
Firmware minor version number.
2 Firmware Debug: bool
Firmware debug state. If the debug state is set, the
firmware is
in development.
3 Hardware Major: uint8
Hardware major version number.
4 Hardware Minor: uint8
Hardware minor version number.
5 Protocol Major: uint8
Protocol major version number.
6 Protocol Minor: uint8
Protocol minor version number.

6.14 [0xD3] Device Reset

Executes a reset on the device. This has the same effect as a power cycle.

1.1.1.1 Note
The device will reply before executing the reset.

Device Reset
Command ID 0xD3
Max. Response Time 100 ms
© Copyright Sensirion AG, Switzerland 28/33
SFC6xxx and SFM6xxx RS485 SHDLC Interface
Post Processing Time 300 ms
MOSI Data None
MISO Data None

© Copyright Sensirion AG, Switzerland 29/33


SFC6xxx and SFM6xxx RS485 SHDLC Interface

7 Appendix

7.1 Gas unit decoding

The following tables show the encoding of the gas unit:

7.1.1 Prefix

Prefix Code Prefix Symbol 10ˆn


(i8t)
-24 yocto y 10-24
-21 zepto z 10-21
-18 atto a 10-18
-15 femto f 10-15
-12 pico p 10-12
-9 nano n 10-9
-6 micro u 10-6
-3 milli m 10-3
-2 centi c 10-2
-1 deci d 10-1
0 100
1 deca da 101
2 hecto h 102
3 kilo k 103
6 mega M 106
9 giga G 109
12 tera T 1012
15 peta P 1015
18 exa E 1018
21 zetta Z 1021
24 yotta Y 1024
127 undefined - -

© Copyright Sensirion AG, Switzerland 30/33


SFC6xxx and SFM6xxx RS485 SHDLC Interface

7.1.2 Unit

Unit Code (u8t) Description Symbol


0 norm liter (0°C, 1013 hPa) l
1 standard Liter (20°C, 1013 l
hPa)
8 liter (liqui) l
9 gram g
16 pascal Pa
17 bar bar
18 meter H2O mH2O
19 inch H2O iH2O
255 undefined -

7.1.3 Time Base

Time Base Code Description Symbol


(u8t)
0 no time base
1 per microsecond /us
2 per millisecond /ms
3 per second /s
4 per minute /min
5 per hour /h
6 per day /day
255 undefined -

© Copyright Sensirion AG, Switzerland 31/33


SFC6xxx and SFM6xxx RS485 SHDLC Interface

7.2 State Response Error Codes

The state response error codes describe the meaning of the lower 7 bits of the ’state’ byte which is
returned in each MISO frame. See Section 5.6.1 for details.

Code Nam Description


e
0 0x00 Success Command successfully executed (no error
occurred).
1 0x01 Data Size Error Illegal data size of the MOSI frame. Either an
invalid frame
was sent or the firmware on the device does not
support the requested feature.
2 0x02 Unknown Command Error The device does not know this command. Either
an invalid
command ID was sent or the firmware on the
device doesn’t support it.
4 0x04 Parameter Error A sent parameter is out of range. Check if you
sent the
correct command parameters and if the firmware
on the device supports them.
41 0x29 I2c Nack Error NACK received from I2C device.
42 0x2A I2c Master Hold Error Master hold not released in I2C.
43 0x2B I2c Crc Error I2C CRC mismatch.
44 0x2C Sensor Data Write Error Sensor data read back differs from written value.
45 0x2D Sensor Measure Loop Not Sensor measure loop is not running or runs on
Running Error wrong gas number.
51 0x33 Invalid Calibration Index No valid gas calibration at given index.
Error
66 0x42 Sensor Busy Error The sensor is busy at the moment. Please note
that the
power-up time after a reset is 300ms.
67 0x43 Command Not Allowed In Command is not allowed in the current state.
Current State
127 0x7F Fatal Error An error without specific error code occurred.

8 Revision History

Date Version Pages Changes

Mar 2023 1.0 all Initial version

Sept 2023 1.1 6 Addendum regarding default address of device added

© Copyright Sensirion AG, Switzerland 32/33

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy