RS-232 to RS-485 Converter - How to Receive data?

For more advanced meter data users. Learn from others and ask questions about how to read meters, how to use the EKM Push Data, and how to display the meter data in useful ways.
Post Reply
adil.dalvi
Posts: 2
Joined: Tue Apr 14, 2015 12:06 am

RS-232 to RS-485 Converter - How to Receive data?

Post by adil.dalvi »

Hi everyone,

I'm working on a project at work to create a Tower Monitoring solution and Power Meters were one of the features that we wanted to offer.

We ordered the EKM Omnimeter I v.3 Smart Meter, a Basic KWh meter, a couple of CTs and the RS232 to RS485 converter.

We were able to install and integrate the Basic Meter to our tracking device since it has a wire for a pulse counter.

Our main aim though, is to integrate the Smart Meter and we have already installed it and via EKM Dash, it works as intended, I can see the readings from the meter, and I'm using a Serial to USB cable on my pc so I know the meter is sending information just fine.

The problem arises when I want to integrate it to our tracking device.

The main reason we got the RS-232 to RS-485 converter is because our tracking device has an RS-232 port, and that is why it was needed so we could be able to integrate the meter via the converter to our tracking device.

The challenges we are facing now is that it simply does not work. No values are being received by the tracking device so I really don't know where to start.

Does the Omnimeter v.3 send data on it's own every couple of minutes, or does our tracking device need to to ask the Omnimeter for this information, and how would I do that?

I have already integrated other Serial Devices, but I've never had this issue since all the previous times, the serial devices would just send the information every couple of minutes to our tracking device, and it would come up on our portal.

I would greatly appreciate any sort of help on this as I'm stuck and don't know how to proceed.

Thanks.
Jameson
Posts: 860
Joined: Fri Nov 04, 2011 7:42 pm
Location: Santa Cruz, CA
Contact:

Re: RS-232 to RS-485 Converter - How to Receive data?

Post by Jameson »

Welcome to the forum!

Good to hear you have it working with the USB converter to EKM Dash. You will want to essentially recreate what you have working with your own "tracking device".

When you have it working with the EKM Dash and USB converter, go to the Help menu item > Hex Inspector. There you can see how the Dash initiates communication with the meter, and the meter responds. This communication sequence is outlined in this v.3 meter parsing example: http://documents.ekmmetering.com/Meter_ ... ter_v3.pdf

Make sure your RS232 serial port on your device is set to 9600 baud, 7 data bits, Even Parity, 1 Stop Bit, No Flow Control. Then send the exact same meter request string as your EKM Dash with USB has been sending. You should get a meter response. Next step is then, how to parse the data.

The meter does not send data out on its own, it waits for a meter request that contains its meter number. When it hears this it responds.

For more information, please visit our Developer Portal (more RS485 parsing data is at the bottom of this page): http://www.ekmmetering.com/developer-portal

Let me know if you have any questions.
Jameson
EKM METERING
http://www.ekmmetering.com
831.425.7371
adil.dalvi
Posts: 2
Joined: Tue Apr 14, 2015 12:06 am

Re: RS-232 to RS-485 Converter - How to Receive data?

Post by adil.dalvi »

Hi Jameson,

Thanks for helping me out. I was able to use this information to try some things out, but I'm still failing to receive any data from the EKM Meter.

I tried speaking to the device manufacturer's and we still haven't been able to crack it yet, although their manual speaks about how to script the device into sending a message ( or in our instance, a request ) with the meter number, so that the Meter can respond back with the data.

First of all, I used the HEX inspector, and this is what I received when I was using EKM Dash:

Meter Number: 17365
Meter Model: EKM-OmniMeter v.3
Baud: 9600
Port: \\.\COM6

Send
2F 3F 30 30 30 30 30 30 30 31 37 33 36 35 21 0D
0A

Receive
02 10 17 15 30 30 30 30 30 30 30 31 37 33 36 35
30 30 30 30 33 39 34 39 30 30 30 30 32 34 37 38
30 30 30 30 31 34 37 31 30 30 30 30 30 30 30 30
30 30 30 30 30 30 30 30 30 30 30 30 32 31 32 36
30 30 30 30 31 30 32 38 30 30 30 30 31 30 39 38
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
32 33 32 35 32 33 37 32 32 33 37 34 30 30 31 36
38 30 30 30 31 34 30 30 31 30 36 30 30 30 33 37
34 32 30 30 30 30 32 32 36 30 30 30 32 31 39 34
30 30 30 36 31 36 34 4C 30 39 36 43 30 36 34 43
30 39 39 30 30 30 37 37 31 30 30 31 31 35 30 34
31 35 30 34 31 31 33 33 32 35 30 32 30 30 30 30
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
30 30 30 30 30 30 30 30 00 21 0D 0A 03 04 24

Send
01 42 30 03 75


From what I understood, I essentially have to send the line, 2F 3F 30 30 30 30 30 30 30 31 37 33 36 35 21 0D 0A , to the meter via our device, and it should essentially respond back to me with the numerous rows of data above, yes?

I then proceeded to the manual, and looked at the steps that were required to send a message to the Meter, and this is what it said:

Depending on the type of data that it is going to be exchanged between the Syrus and the external RS-232 device there are two possible configurations
1. ( Irrelevant )
2. The external device uses any byte-based protocol.

For the second option, the Syrus is used just as a communication media between the attached device an a Destination Point. When working in this mode the Syrus can pass any byte-like message to a Destination Point and vice versa.

This requires the Syrus working on MDT PAD mode. On MDT PAD mode Syrus uses a PAD criteria to send the received message to a Destination Point. The PAD criteria is controlled with the MT message and it is composed by:

PAD character 1.
PAD character 2.
PAD Timeout.
PAD size.

Whenever the PAD criterion is met, the accumulated message on the unit is transmitted. The unit sends and receives the MDT messages using the TX message. Using this message any binary-like data can be transferred by means of escape characters.


To configue the MDT mode, Send a message with the following format:

A[BBB[CCCD\EE\FF\GG\HH]]

*A: MDT Mode:
N: Normal. (Default)
P: PAD.

*BBB: Packet timeout.

*CCC: Packet maximum size. Default is 50. Maximum allowed size is 1024. With the 3 characters it is possible to set up to 999. To set 1024 use FFF.

*D: Include packet delimiter:
T: Include
F: Exclude

*\EE: Packet delimiter 1. Code for the character that is to be used as delimiter 1 (PAD mode). Default is \0D.

*\FF: Packet delimiter 2. Code for the character that is to be used as delimiter 2 (PAD mode). Default is \0A.

*\GG: End PAD mode. Code for the character that is to be used to end PAD mode and go back to Normal mode. Default is \1B (escape character). Use \** to ignore the escape character.

*\HH: Reserved. This value will be ignored but must be included in the Configuration Command. Can always be set to \FF.


So what I've sent to the device is:

>SMTP010150T\03\FA\1B\FF;<

and configured the Baud Rate to 9600 b/s.

The Manual continues,

When the remote host sends to Syrus a TX message it can contain any byte-like characters by means of escape sequences.

If the host would like to send the sequence:

[02][07][08][FC][AA]xyz[F1]

to the device attached on the serial port, then it has to send the following TX message to the Syrus:

>STX\02\07\08\FC\AAxyz\F1<

This will make the Syrus send the original sequence to the attached device.


So what I've been doing is sending " 2F 3F 30 30 30 30 30 30 30 31 37 33 36 35 21 0D 0A " as:

>STX\2F\3F\30\30\30\30\30\30\30\31\37\33\36\35\21\0D\0A<

and trying different variations and trying to tweak it here and there with no results except our Servers respond with the same exact message back.


I know the message is super long, but I'm officially stuck again.
Jameson
Posts: 860
Joined: Fri Nov 04, 2011 7:42 pm
Location: Santa Cruz, CA
Contact:

Re: RS-232 to RS-485 Converter - How to Receive data?

Post by Jameson »

I would first setup to "sniff" the output of your device with a separate computer. We use "Advanced Serial Port Monitor" or "RealTerm" for this. That way you can independently verify and see if the RS485 serial output is what you would expect.

Yes if you send 2F 3F 30 30 30 30 30 30 30 31 37 33 36 35 21 0D 0A to your meter with the correct serial settings, the meter will respond, just like it did for your version of the EKM Dash.

Thanks,
Jameson
EKM METERING
http://www.ekmmetering.com
831.425.7371
Post Reply