12
Annex: Data communication
Examples of data logger codes
12-16
S
TERI-CYCLE
i160
/
i250
Thermo Scientific
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++)
if (a == hexa[i])
return (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 ++)
bcc = (bcc^string[i]);
// copy checksum
string[11] = hexa(bcc/16);
string[12] = hexa(bcc%16);
Содержание STERI-CYCLE i160
Страница 8: ...Table of Contents 6 STERI CYCLE i160 i250 Thermo Scientific ...
Страница 12: ...Figures 4 STERI CYCLE i160 i250 Thermo Scientific ...
Страница 76: ...5 Operation Starting operation 5 6 STERI CYCLE i160 i250 Thermo Scientific ...
Страница 128: ...6 Handling and control Measures after power outage 6 52 STERI CYCLE i160 i250 Thermo Scientific ...
Страница 154: ...9 Maintenance Replacing the Door Seal 9 12 STERI CYCLE i160 i250 Thermo Scientific ...
Страница 166: ...11 Specifications STERI CYCLE i250 11 10 STERI CYCLE i160 i250 Thermo Scientific ...
Страница 196: ...13 Device log 13 2 STERI CYCLE i160 i250 Thermo Scientific ...