Operating Instructions | HERAcell® 150i / 240i
13
Annex: Data communication
13
Annex: Data communication
50115191 A / 08.2009
143
// length of sent payload
len = (ahex(buffer[7]) * 0x10 + ahex(buffer[8])) / 2;
// converting ASCII string into usable numeric string
for (i = 0; i < (len); i++)
zahlenstring [i] = (ahex(buffer[10 + (2*i)]) * 0x10 +
ahex(buffer[11 + (2*i)]));
// calculation of the sent data packages
data = ((len) / SIZE_DATA2);
// evaluation of all data packages
for (i = 0; i < data; i++)9{
len = 0;
// write time and date into file
len += time_2_str (zahlenstring[1+i*SIZE_DATA2],
&excelstring[len]);
excelstring[len ++] = '.';
len += time_2_str (zahlenstring[2+i*SIZE_DATA2],
&excelstring[len]);
excelstring[len ++] = '.';
len += time_2_str (zahlenstring[3+i*SIZE_DATA2],
&excelstring[len]);
excelstring[len ++] = ';';
len += time_2_str (zahlenstring[4+i*SIZE_DATA2],
&excelstring[len]);
excelstring[len ++] = ':';
len += time_2_str (zahlenstring[5+i*SIZE_DATA2],
&excelstring[len]);
excelstring[len ++] = ':';
len += time_2_str (0, &excelstring[len]);
excelstring[len ++] = ';';
switch (zahlenstring[i*SIZE_DATA2]){
case EVENT_STATUS:
// check cyclic entries for device errors
status = zahlenstring[6+i*SIZE_DATA2]*0x100+
zahlenstring[7+i*SIZE_DATA2];
if (status & INFO_ERROR){
str_cpy (&excelstring[len], "Error active;", 13);
len += 13;
}
else{
// query all device errors
(see chap. 13.6.2‚ pg. 138)
if (status & DOOR_LONG){
str_cpy (&excelstring[len], "Door open too long;",
19);
len += 19;
else {
if (status & DOOR_OPEN){
str_cpy (&excelstring[len], "Door open;", 10);
len += 10;
}
}
// query remaining device errors now
//
·
//
·
//
·
//
·
//
·
// and finally query cyclic nominal values entries without device
// errors
Содержание Heracell 150i
Страница 156: ......