SOEiQ
شرح

ملف DAT في COMTRADE: العينات وصيغها

ملف DAT يحمل العينات (Samples) نفسها: سطر (أو سجل ثنائي) لكل عينة، فيه رقمها وزمنها وقيمة كل قناة تماثلية (Analog) وحالة كل قناة رقمية (Digital). ولا يُقرأ وحده: ترتيب القنوات ومعاملات التحويل والصيغة كلها في ملف CFG.

Guide

The COMTRADE DAT file: samples and formats

The DAT file holds the samples themselves: a line (or binary record) per sample with its number, its time stamp, a value per analog channel and a state per digital channel. It cannot be read alone: channel order, conversion factors and format are all in the CFG file.

المثال: صيغة 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

من القيمة الخام إلى الوحدة

القيمة الفعلية = a × الخام + b، حيث a وb الحقلان السادس والسابع في سطر القناة بملف CFG. في السطر الثاني من المثال:

وتذكّر أن القيمة هنا لحظية (Instantaneous)، أي عينة من الموجة، لا قيمة فعالة (RMS). وإذا كان الحقل الأخير في سطر القناة P فالقيمة على جانب الابتدائي (Primary)، وإن كان S فهي على الثانوي (Secondary)، وتحوَّل بنسبة المحول في الحقلين الحادي عشر والثاني عشر.

الصيغ الثنائية

يحدد السطر قبل الأخير في CFG الصيغة. في الصيغ الثنائية كل عينة سجل ثابت الطول، والبايت الأدنى أولًا (little-endian):

وطول الملف إذن يُتوقع من CFG: عدد العينات مضروبًا في طول السجل. ومن ثم فأي فرق يعني ملفًا مقطوعًا أو صيغة غير التي في 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

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:

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:

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

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.