SOEiQ
شرح

ملف CFG: مفتاح قراءة تسجيل العطل في COMTRADE

لماذا لا تكفي أرقام ملف DAT وحدها؟ لأن تسجيل العطل (Fault record) بصيغة COMTRADE ملفان على الأقل: ملف DAT فيه العينات (Samples) أرقامًا مجرّدة، وملف CFG نصي يقول ما كل عمود، وكيف يتحول رقمه إلى أمبير أو كيلوفولت. ولذا نبدأ بملف CFG: نقرأ ملفًا حقيقيًا من أوله إلى آخره كما يحدده المعيار IEEE C37.111 (إصدار 1999)، ونقف عند كل جزء منه لنعرف ماذا يعني للمهندس.

Explainer

The CFG file: the key to reading a COMTRADE fault record

A COMTRADE fault record is at least two files: a text CFG that describes the record, and a DAT that holds the samples. The DAT numbers mean nothing without the CFG, which says what each column is and how it turns into amperes or kilovolts. Here we read a real CFG from start to end, as IEEE C37.111 (1999 revision) defines it, and stop at each part to see what it means to the engineer.

المثال

هذا ملف CFG لعطل أرضي (Earth fault) على الفاز A، من الملفات النموذجية (محاكاة):

SIM STATION,SIM-RELAY,1999
9,6A,3D
1,F21 IA,A,,A,0.136259735,0,0,-32767,32767,1,1,P
2,F21 IB,B,,A,0.00804660678,0,0,-32767,32767,1,1,P
3,F21 IC,C,,A,0.00865025731,0,0,-32767,32767,1,1,P
4,BUS VA,A,,kV,0.00336671418,0,0,-32767,32767,1,1,P
5,BUS VB,B,,kV,0.00352851459,0,0,-32767,32767,1,1,P
6,BUS VC,C,,kV,0.00348574068,0,0,-32767,32767,1,1,P
1,PICKUP,,,0
2,TRIP,,,0
3,52A,,,0
50
1
3200,1039
01/01/2026,10:00:00.000000
01/01/2026,10:00:00.080000
ASCII
1

1. المحطة والجهاز والإصدار

SIM STATION,SIM-RELAY,1999: اسم المحطة، ثم معرّف جهاز التسجيل، ثم سنة إصدار المعيار. إن غابت السنة فالملف من إصدار 1991.

2. عدد القنوات

9,6A,3D: تسع قنوات في المجموع، ست تماثلية (Analog) وثلاث رقمية (Digital). ويجب أن يساوي المجموع حاصل الجمع، وإلا اعتمدت أغلب البرامج العددين المفصّلين.

3. القنوات التماثلية (Analog channels)

سطر لكل قناة، بثلاثة عشر حقلًا في إصدار 1999:

الحقلفي المثال (IA)المعنى
An1رقم القناة، متسلسل من 1.
ch_idF21 IAاسم القناة.
phAالفاز.
ccbmفارغالدائرة أو الجهاز المراقَب.
uuAالوحدة: A أو kV أو V…
a وb0.136259735 · 0معاملا التحويل (Scaling): القيمة = a × العينة + b. فمثلًا العينة 142 في السطر الأول من DAT تعني 19.35 أمبير.
skew0تأخر أخذ عينة هذه القناة (Skew) بالميكروثانية.
min وmax-32767 · 32767مدى العينات. ولاحظ أن بلوغ الحد قد يعني أن المسجل قصّ الإشارة (Clipping).
primary وsecondary1 · 1نسبة محول التيار (CT) أو الجهد (VT)، مثل 1200 و1.
PSPهل القيم المسجّلة ابتدائية (Primary) أم ثانوية (Secondary). ومنه تُحسب القيم الأخرى بنسبة المحول.

4. القنوات الرقمية (Digital channels)

2,TRIP,,,0: رقم القناة، والاسم، والفاز، والدائرة، ثم الحالة الطبيعية (0 أو 1). وهنا ثلاث إشارات: الالتقاط (Pickup) والفصل (Trip) وحالة القاطع (Circuit Breaker) من الملامس المساعد 52A.

5. التردد ومعدل العينات (Sampling rate)

50: التردد الاسمي للشبكة. ثم 1: عدد معدلات العينات في التسجيل، ثم سطر لكل معدل: 3200,1039 أي 3200 عينة في الثانية حتى العينة رقم 1039. ولماذا قد يكون في الملف أكثر من سطر؟ لأن بعض المسجلات ترفع المعدل حول العطل وتخفضه بعده.

6. وقت البدء ووقت الإطلاق (Trigger)

السطر الأول وقت أول عينة، والثاني لحظة إطلاق التسجيل (Trigger)، بصيغة يوم/شهر/سنة,ساعة:دقيقة:ثانية. هنا أُطلق التسجيل بعد 80 مللي ثانية من بدئه، ومعنى ذلك أن العينات قبلها هي ما قبل العطل (Pre-fault). وتذكّر أن الشهر يأتي قبل اليوم في إصدار 1991.

7. الصيغة ومعامل الزمن

ASCII: صيغة ملف DAT، وقد تكون أيضًا BINARY، أو BINARY32 وFLOAT32 في إصدار 2013. ثم 1: معامل الزمن (Time multiplier) الذي تُضرب فيه الطوابع الزمنية في ملف DAT. ويضيف إصدار 2013 سطرين لرمز التوقيت وجودة الساعة.

جرّب بنفسك

افحص هذا الملف لترى كل حقل كما يقرؤه الفحص، أو حوّله إلى CSV لترى القيم بعد التحويل.

The example

This is the CFG of a phase A to ground fault from the sample files (simulated):

SIM STATION,SIM-RELAY,1999
9,6A,3D
1,F21 IA,A,,A,0.136259735,0,0,-32767,32767,1,1,P
2,F21 IB,B,,A,0.00804660678,0,0,-32767,32767,1,1,P
3,F21 IC,C,,A,0.00865025731,0,0,-32767,32767,1,1,P
4,BUS VA,A,,kV,0.00336671418,0,0,-32767,32767,1,1,P
5,BUS VB,B,,kV,0.00352851459,0,0,-32767,32767,1,1,P
6,BUS VC,C,,kV,0.00348574068,0,0,-32767,32767,1,1,P
1,PICKUP,,,0
2,TRIP,,,0
3,52A,,,0
50
1
3200,1039
01/01/2026,10:00:00.000000
01/01/2026,10:00:00.080000
ASCII
1

1. Station, device and revision

SIM STATION,SIM-RELAY,1999: the station name, the recording device's id, then the year of the standard. Without a year, the file is a 1991 record.

2. Channel counts

9,6A,3D: nine channels in total, six analog (A) and three digital (D). The total must equal the sum; when it does not, most programs use the two counts.

3. Analog channels

One line per channel, thirteen fields in the 1999 revision:

FieldIn the example (IA)Meaning
An1Channel number, in sequence from 1.
ch_idF21 IAChannel name.
phAPhase.
ccbmemptyCircuit or component monitored.
uuAUnit: A, kV, V…
a, b0.136259735 · 0Multipliers: value = a × sample + b. The sample 142 on the first DAT line means 19.35 A.
skew0Sampling delay of this channel, in microseconds.
min, max-32767 · 32767Sample range. Reaching it may mean the recorder clipped the signal.
primary, secondary1 · 1Current or voltage transformer ratio, such as 1200 and 1.
PSPWhether the recorded values are primary (P) or secondary (S); the other is worked out with the ratio.

4. Digital channels

2,TRIP,,,0: channel number, name, phase, circuit, then the normal state (0 or 1). Here the pickup, the trip and the breaker's 52A contact.

5. Frequency and sampling rate

50: the nominal line frequency. Then 1: how many sampling rates the record has, then one line per rate: 3200,1039 means 3200 samples a second up to sample 1039. Some recorders sample faster around the fault and slower after it, so the file has more than one line.

6. Start and trigger times

The first line is the time of the first sample, the second the moment the record was triggered, as dd/mm/yyyy,hh:mm:ss. Here the trigger came 80 ms after the start, so the samples before it are the pre-fault. The 1991 revision puts the month before the day.

7. Format and time multiplier

ASCII: the DAT format; it may also be BINARY, or BINARY32 and FLOAT32 in the 2013 revision. Then 1: the multiplier for the time stamps in the DAT. The 2013 revision adds two lines for the time code and clock quality.

Try it

Check this file to see every field as the check reads it, or convert it to CSV to see the values after scaling.