Transmit Data to pmu connection tester through networking


#1

Hello, my name is Owais. My project is to make PDC Server.
I have 305 message informations at every 0.001 seconds of electrical bus in hexadecimal format in txt file.
My message information is already converted in IEEE Std C37.118.2™-2011 standard.
My task is to check my message information data in pmu connection tester by transmitting these data to pmu connection tester which are in txt file from another computer through networking via udp protocol. I have tried several codes but an error is obtained everytime (Bad data stream , expected sync byte 0xAA as first byte in IEEE Std C37.118 frame, got 0x41).

My device id code is 65281. There are 74 bytes in one frame.
Samples of my message information data at each instant are as follows:
AA01004AFF0156615771000000000140446EA721C135F45F446EA721C3035F46446EA721C37B5F463B5A5873C2A4CA1C3B5A5873C34A650E3B5A5873C3A13287B4EEBAFBB33EFBFC8583

AA01004AFF0156615771000027100140446EA721C135F45F446EA721C3035F46446EA721C37B5F463B5A5873C2A4CA1C3B5A5873C34A650E3B5A5873C3A13287B4B30BE4B30F3CB6217B
My phasor values are in rectangular form.
please help me in accomplish my task . I will be very grateful to you.


#2

Hello Owais,

0x41 is the hexadecimal code for the capital letter ‘A’ in most common 8-bit character encodings. I believe that the hexadecimal dump you’ve provided likely represents valid frames of data, but it seems that the file you have them stored in is a text file. You need to convert that text to raw binary data and send that to a file in order for the PMU Connection Tester to be able to read it.

Thanks,
Stephen


#3

Hello Stephen,

I converted my hex data into binary data and then transmitted to pmu connection tester but similar type of error occur i.e

How can i send my data through networking to pmu connection tester, if there is any other method to send data to pmu connection tester through networking then please help me in that.
Can you give me appropriate code to send data to pmu connection tester through networking via udp protocol?

Thanks,
Owais


#4

Can you send us a copy of the file - maybe that will help us understand your issue better…

Thanks!
Ritchie


#5

Hello Ritchie,

There is no option for sending a txt file. How can i send you txt file?

Thanks!
Owais


#6

Okay, now I’ve seen both files and I think I understand the issue.

First, your binary data file is still a text file. For further evidence of that, 0x31 is the hexadecimal code for the number ‘1’ in most common 8-bit character encodings.

Second, I hadn’t really noticed before, but it seems you are connecting to your data source over UDP. I’m making an assumption here, but I think it’s likely that you have written an application to read the data from the hexadecimal text file and you are sending the data to the PMU Connection Tester over a socket.

So what I’m going to do is send you a PMU Capture file derived from the data you sent to give you an example of what I mean by raw binary. You can see in the screenshot below, the PMU Connection Tester can read this file directly.

I would also suggest downloading a hex editor so you can examine the file I’m sending and see how it relates to your original file.

Thanks,
Stephen


#7

Thank You Sir.
You are right, i want to send my data over socket. Is this possible?
How do you convert text file to pmucapture file so that i can convert other data text files into pmucapture file.Please tell me
Why it is not showing graph and values of frequency, voltage power etc?
I want this kind of output:

Thanks,
Owais


#8

It is definitely possible to send the data over a socket. If you want to use UDP, I believe you’ll need to send each packet in a separate datagram, and you’ll have to handle the timing in your application. I’m thinking your original hexadecimal text file is probably the most convenient format for the data because each packet is listed on a separate line making it easy for your application to parse each individual packet separately. The trick is, you’ll need to convert the hexadecimal text to raw binary within your application before you send it over UDP.

The method I used to convert the text file to raw binary probably isn’t going to help you within your application. I used Notepad++ to strip the carriage returns and line feeds out of the file, then used a hex editor to import the data as a hexadecimal string so I could turn right around and save it as raw binary. Your application will need to convert the hex string into raw bytes. Here is an example of how to do that in a C# application.

The PMU Capture file I sent back doesn’t show the graph and the values because it’s full of only data frames. Data frames cannot be properly interpreted without the corresponding configuration frame to go with it.

Thanks,
Stephen


#9

Thank You so much Sir.


#10

Sir i want to generate my own data’s configuration , header and command frames. What will i do?
What are the requirements ?
please help me in generating configuration frame


#11

The easiest way to do this would be to use the Grid Solutions Framework to generate a configuration frame from scratch - look at the source code for the Phasor Data Concentrator for an example: https://github.com/GridProtectionAlliance/gsf/blob/master/Source/Libraries/Adapters/PhasorProtocolAdapters/IeeeC37_118/Concentrator.cs

Otherwise if you want to do this manually you will need to interpret the IEEE C37.118 standard.

Thanks,
Ritchie


#12

Ritchie Sir,
The link you sent , there were many unknown libraries. Where i can find these directives or libraries?
What is the output of this Source code?

Thanks,
Owais


#13

You can try rebuilding the entire solution, but let’s try a different approach.

Perhaps it would be easier just to use the openPDC to create a configuration for you. Install the latest openPDC from here:

Note that during installation configuration you can just use “SQLite” as your database source for simplicity of installation. Just click “next” through most options and use the default settings and you should be fine.

Once the openPDC is installed, close the openPDC Manager if its running - we will want to open the manager with admin rights.

Before we start, copy the capture file Stephen created for you (i.e., bus8.pmucapture) into the “C:\Program Files\openPDC” installation folder.

Now find the openPDC Manager in the start menu and right-click on the shortcut and select “Run as Administrator”.

Once the manager is running with admin rights, navigate to the “Inputs / Input Device Wizard” from the main menu (or just click the “Input Device Wizard” button from the home screen).

Close the pop-up wizard window titled “Input Wizard Walkthrough” by clicking the “X” button at the top-right of the pop-up. We will manually walk through configuration steps.

Now we need to select your PMU capture file as the data source, do this by clicking the blue-blocks wizard icon to the right of the “Connection String” input area.

Click on the “File” tab and then click on the “Browse” button and navigate to your PMU capture file, i.e., “C:\Program Files\openPDC\bus8.pmucapture” then click “Save”.

Note: the file location of the PMU capture file is important as the openPDC service needs “rights” to the file. The easiest way to accommodate this issue is to just to copy the file into the openPDC installation folder, typically C:\Program Files\openPDC. If you use another folder, the openPDC will need read rights to this folder - this can be accomplished by editing the security rights for the folder and explicitly giving the “NT SERVICE\openPDC” user or the “openPDC Admins” local group the needed rights.

Now manually append the following text to your connection string:

; configurationFile=C:\Program Files\openPDC\bus8config.xml

Your full configuration string should now look like the following:

file=C:\Program Files\openPDC\bus8.pmucapture; definedframerate=30; simulatetimestamp=true; autorepeatfile=true; transportprotocol=file; configurationFile=C:\Program Files\openPDC\bus8config.xml

Click the “Next” button at the bottom right of the screen and then click on the “Edit Configuration” button. Use this interface to build a configuration that matches your device input. When you are done click “Save”.

Now click “Save Configuration” and save your file as “C:\Program Files\openPDC\bus8config.xml”.

Click “Next” and “Finish”.

Now click on “Monitoring / Graph Measurements” from the main menu. Expand “Direct Connected” and you should see your device. You can click on individual measurements and see if data is flowing.

Note that you now have a serialized XML file that you can use in the PMU Connection Tester against your PMU Capture file. Run the connection tester and select your capture. Now click on “File / Config File / Load” from the main menu and load the “bus8config.xml” file and data should properly parse.

Also, you can now create a new “output stream” from within the openPDC and send a new IEEE C37.118 stream with your data to any destination.

Hope that helps!

Ritchie


#14

Thank You Ritchie sir
I will try this. Thank You so much.

Owais


#15

Hello Ritchie Sir,
I followed all your steps.
Please guide me am i doing right or wrong. Please indicate my mistake. I will show my process through screenshots.


But when i save bus8config.xml and click finish option, message is shown

In PMU Connection Tester:
When i load xml file

When i click connect

Please help me

Thanks,
Owais


#16

The last two bytes of every data frame is a CRC-CCITT checksum of the rest of the data frame. The error indicates that the parsing library calculated the checksum, but the value it calculated didn’t match the last two bytes of the data frame it received. The best solution would be to fix the checksum of the data frames. Alternatively, you can disable checksum validation, but it looks like it would require a code change.

Thanks,
Stephen


#17

Sir,
I correct my crc of my data frame of 3 instances and make pmucapture file of it and then follow steps of Ritchie sir but now this error is occured

Please help me


#18

It seems there was a bug in the openPDC Manager that causes it to produce configuration frames that are missing the frequency definition, which is required to parse data frames. The bug was fixed yesterday, which means that the nightly build version today has incorporated the fix. My recommendation would be to install the latest nightly build version of the openPDC, then follow Ritchie’s steps again to generate the configuration frame for your data. This should produce a valid configuration frame that can be used with the PMU Connection Tester and clear up the null reference exception you’ve shown in your screenshot.

Link to the latest nightly build version:
http://www.gridprotectionalliance.org/NightlyBuilds/openPDC/Beta-VS2012/Synchrophasor.Installs.zip

Thanks,
Stephen


#19

Sir,
By latest Open PDC ,almost my problem is solved but in pmu connection tester frequency graph is not displaying and values of real and reactive power

What can be problem sir?


#20

Is the frequency of your input data really 75 Hz? Also, the voltage and current values are way to small to register on the MW/MVar scale.