المثال: صيغة ASCII
أول ثلاثة أسطر من ملف DAT لعطل أرضي (Earth fault) على الفاز A، من الملفات النموذجية (محاكاة):
1,0,142,-27739,24173,30,-26365,26728,0,0,1 2,312,317,-29085,22375,3111,-27770,25084,0,0,1 3,625,509,-30632,20258,6254,-28834,23194,0,0,1
- الحقل الأول رقم العينة، يبدأ من 1.
- الثاني الزمن بالميكروثانية من أول عينة، مضروبًا في معامل الزمن (Time multiplier)، وهو السطر الأخير في CFG وقيمته 1 هنا. معدل العينات 3200 في الثانية، فالفاصل 312.5 ميكروثانية، ولذلك يظهر 312 ثم 625.
- بعده ست قيم تماثلية بترتيب القنوات في CFG: IA وIB وIC ثم VA وVB وVC. ولاحظ أنها أعداد خام (Raw)، لا أمبير ولا كيلوفولت.
- آخر ثلاث قيم القنوات الرقمية PICKUP وTRIP و52A: صفر أو واحد. هنا 52A تساوي 1، أي أن القاطع (Circuit Breaker) مغلق قبل العطل.
من القيمة الخام إلى الوحدة
القيمة الفعلية = a × الخام + b، حيث a وb الحقلان السادس والسابع في سطر القناة بملف CFG. في السطر الثاني من المثال:
- IA: الخام 317، وa = 0.136259735 وb = 0، فالتيار
317 × 0.136259735 ≈ 43.19أمبير. - VA: الخام 3111، وa = 0.00336671418، فالجهد
≈ 10.47كيلوفولت.
وتذكّر أن القيمة هنا لحظية (Instantaneous)، أي عينة من الموجة، لا قيمة فعالة (RMS). وإذا كان الحقل الأخير في سطر القناة P فالقيمة على جانب الابتدائي (Primary)، وإن كان S فهي على الثانوي (Secondary)، وتحوَّل بنسبة المحول في الحقلين الحادي عشر والثاني عشر.
الصيغ الثنائية
يحدد السطر قبل الأخير في CFG الصيغة. في الصيغ الثنائية كل عينة سجل ثابت الطول، والبايت الأدنى أولًا (little-endian):
- BINARY: رقم العينة 4 بايتات، والزمن 4 بايتات، ثم كل قناة تماثلية عدد صحيح بإشارة من 2 بايت، ثم القنوات الرقمية مجمّعة في كلمات من 16 بتًّا (أول قناة في أدنى بت). في المثال:
4 + 4 + 6×2 + 2 = 22بايتًا لكل عينة. - BINARY32: مثلها، لكن القناة التماثلية 4 بايتات (إصدار 2013).
- FLOAT32: القناة التماثلية عدد عشري من 4 بايتات (إصدار 2013)، ويبقى تطبيق a وb كما هو.
وطول الملف إذن يُتوقع من CFG: عدد العينات مضروبًا في طول السجل. ومن ثم فأي فرق يعني ملفًا مقطوعًا أو صيغة غير التي في CFG، وهذا من أول ما تفحصه أداة الفحص.
القيم الناقصة
- في ASCII يُترك الحقل فارغًا (وكانت 99999 في إصدار 1991).
- في BINARY القيمة
-32768(0x8000) تعني قيمة ناقصة، ولذلك يكون مدى القنوات عادةً من -32767 إلى 32767 كما في المثال. - الزمن الناقص
0xFFFFFFFFفي الثنائي أو حقل فارغ في ASCII، وعندها يُحسب الزمن من معدل العينات في CFG.
جرّبه
حوّل هذا الملف إلى CSV لترى القيم بعد التحويل، أو افحصه لترى الصيغة وطول السجل كما قُرئا.
The example: ASCII format
The first three lines of the DAT for a phase-A earth fault, from the sample files (simulated):
1,0,142,-27739,24173,30,-26365,26728,0,0,1 2,312,317,-29085,22375,3111,-27770,25084,0,0,1 3,625,509,-30632,20258,6254,-28834,23194,0,0,1
- The first field is the sample number, starting at 1.
- The second is the time in microseconds from the first sample, times the time multiplier (the last CFG line, 1 here). The rate is 3200 samples a second, so the step is 312.5 µs: hence 312, then 625.
- Then six analog values in the CFG channel order: IA, IB, IC, then VA, VB, VC. They are raw integers, not amps or kilovolts.
- The last three are the digital channels PICKUP, TRIP and 52A: 0 or 1. Here 52A is 1, so the breaker is closed before the fault.
From raw value to units
Actual value = a × raw + b, with a and b the sixth and seventh fields of the channel line in the CFG. In the second line of the example:
- IA: raw 317, a = 0.136259735, b = 0, so the current is
317 × 0.136259735 ≈ 43.19A. - VA: raw 3111, a = 0.00336671418, so the voltage is
≈ 10.47kV.
These are instantaneous values (samples of the wave), not RMS. If the last field of the channel line is P the value is on the primary side; if S, on the secondary, converted with the transformer ratio in the eleventh and twelfth fields.
Binary formats
The second-to-last CFG line gives the format. In the binary formats each sample is a fixed-length record, little-endian:
- BINARY: sample number in 4 bytes, time stamp in 4 bytes, then each analog channel as a 2-byte signed integer, then the digital channels packed into 16-bit words (first channel in the lowest bit). In the example:
4 + 4 + 6×2 + 2 = 22bytes per sample. - BINARY32: the same, with 4-byte analog values (2013 revision).
- FLOAT32: analog values as 4-byte floats (2013 revision); a and b still apply.
So the file length is predictable from the CFG: sample count times record length. Any difference means a truncated file or a format other than the CFG says, one of the first things the file check looks at.
Missing values
- In ASCII the field is left empty (99999 in the 1991 revision).
- In BINARY the value
-32768(0x8000) means missing, which is why channel ranges are usually -32767 to 32767, as in the example. - A missing time stamp is
0xFFFFFFFFin binary or an empty field in ASCII; time then comes from the CFG sample rate.
Try it
Convert this file to CSV to see the values after scaling, or check it to see the format and record length as read.