I need to access data stored in binary files. In this case, it is an event log file from an old scada system. Each file contains a sqeuence of packets, and a packet contains, for example, 28 bytes of data. This data can be read on low-level like this:
- 18 chars containing the signal name as ISO 8859-1 String
- A 16 bit signed integer LE for signal value
- A 32 bit signed integer LE which describes unix datetime
- A 16 bit signed integer describing additional miliseconds to unix datetime
- 8 so called "status bits", each bit is an attribute or "signal flag"
- A 8 bit signed integer describing signal type (just another signal property)
There are also other files using the same method of storing data using these sequences of packets.
I'm looking for the correct approach for reading such files and reading those "packets". I have imported similar files which were already encoded as strings with textscan using formatSpec, is there anything similar on binary file read?
Your help is apprechiated.
Best Answer