User manual

Appendix
ComTec GmbH 7-15
7.6.3. Listfile Format
Q: Could you help a little bit about the format? Here is what I understand :
FF FF FF FF is flag for next word to be data
FF FF 00 40 is ms or multiple time flag
After a FF FF FF FF flag, I find 01 00 00 80 (I deduce ADC 1) and then the value (FF FF 25 00)
(generator to channel 25) Is that correct?
Should data from ADC 2 coded like this 02 00 00 80 ?
A: Here is the description of the listfile format copied from the README file:
Every millisec there is a timer event. It is a 32 bit word containing 0x4000 as high word and as low
word for ADC 1 a 1 in bit 0 if it's "alive" and a 0 if its "dead", the same for ADC2 in bit 1 and so on.
Counting the corresponding set bits directly gives the live time in milliseconds for each ADC,
counting the timer words gives the realtime of the run in milliseconds. It is possible that the timer is
written only every 10, 100 or 1000 milliseconds. This is then indicated by a line "timerreduce=10"
(100, 1000, respectively) immediately preceding the [LISTDATA] tag in the header of the listfile.
After a timer event can follow either again a timer event or a synchron mark, i.e. a double word
containing 0xFFFFFFFF and then event data.
Event data start always with a event signal double word containing in the high word some flags and
a zero in bit 30 (to distinguish it from a timer event), and in the low word for each ADC that has
data a 1 in the corresponding bit (bit 0 for ADC1 ...). The ADC data are 16 bit and the data
structure is in a 32 bit raster, therefore there must be a 16 bit dummy word inserted for an odd
number of ADCs containing data to get an even number of 16 bit data words. If such a dummy was
inserted, this is marked in bit 31 of the event signal word.
RTC Option: If data of the 48 bit realtime clock (RTC) are in the event, this is marked in bit 28 of
the event signal word. If RTC data are signaled in the event signal double word, the three 16 bit
RTC data rtc0, rtc1 and rtc2 follow immediately after the signal word in the next low, high and low
words. The rtc value is (rtc2 * 65536 + rtc1) * 65536 + rtc0. It starts from a (preset) value that can
be set by software and counts down with 20 MHz (or extern clock). After rtc2 follows in a high word
the dummy word if bit 31 in the event signal double word was set, or ADC data.
If RTC data were not signaled, immediately after the signal dword follows in the next low word
either a dummy word (if signaled in bit 31) or ADC data (starting from the lowest ADC that has
data). From the signal dword it is clear how many ADC data follow and also that it is an even
number of 16 bit words, so after this set of data can either again follow a new set starting with a
new event signal dword, or a new livetime event.
So far the documentation. Here are some additional comments:
In the Intel world all bytes of a word come with the least significant byte at first.
FF FF FF FF is a synchron mark that is always after a timer event and before event data.
00 40 belongs to a double word 0x4000xxxx, i.e. a timer word.
If you find after a FF FF FF FF mark 01 00 00 80, it means an event signal double word 0x80000001. Bit
31 is on, it means a dummy word is inserted in the next low word after the event double word. Bit 0 is on,
it means that this event contains only 1 ADC word from the first ADC. Now you see (FF FF 25 00), it
means 0x0025FFFF. The low word FFFF is the dummy word, the high word 0x0025 means the ADC
value in ADC 1. If you would have data from ADC1 and ADC2 in an event, the event signal word would
be 0x00000003, and in the first double word after the event word you would have in the low word ADC1
and in the high word ADC2. If you would have only ADC2 data in the event, the event signal double word
would be 0x80000002, and the next double word would contain in the low word a dummy and in the high
word the ADC2 data.