Functions For Data Logger Queries; Example Of A Code For A A Data Logger Query - Thermo Scientific STERI-CYCLE i160 User Manual

Co2 incubator
Table of Contents

Advertisement

12
Annex: Data communication
Examples of data logger codes

Functions for data logger queries

The following code example for reading the data logger uses six functions:
• ahex
// converts the received ASCII character into a hexadecimal number,
• send_telegramm
// sends a query to the data logger,
• get_telegramm
// receives a response data the data logger,
• time_2_str
// uses a hexadecimal value to create ASCII characters in time format,
• num_2_string
// uses hexadecimal values to create ASCII characters to be entered into a file,
• read_datalogger
// edits the received data and writes them into a file.

Example of a code for a a data logger query

char ahex (char a)
char ahex(char a)
{
char i;
char hexa[16]="0123456789abcdef";
for (i = 0; i < 16; i++)
return 0;
}
send_telegramm
void send_telegramm(char *p)
{
char string [15];
unsigned char bcc = 0xFF;
char i;
// copy telegram together
strncpy (&string[0], „?:xxxx:00::00\r", 14);
// insert 4-digit address
strncpy (&string[2], p, 4);
// calculate checksum: inverted XOR of all bytes
// without checksum and <CR>
for (i = 0; i < 11; i ++)
// copy checksum
string[11] = hexa(bcc/16);
string[12] = hexa(bcc%16);
i160 / i250
S
12-16
TERI-CYCLE
if (a == hexa[i])
return (i);
bcc = (bcc^string[i]);
Thermo Scientific

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Steri-cycle i250

Table of Contents