EKM-Omnimeter RS-485 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.
ckhome
Posts: 5
Joined: Tue Dec 02, 2014 7:57 am

Re: EKM-Omnimeter RS-485 Data

Post by ckhome »

I would be interested in seeing a Tridium driver for the EKM meters! Here is a web link to the Niagara community where one can find resources and attend classes. Hope it helps.

https://community.niagara-central.com/o ... vices_Home
Niagara Central
Niagara Central
Niagara Central.PNG (165.64 KiB) Viewed 91489 times
Jameson
Posts: 860
Joined: Fri Nov 04, 2011 7:42 pm
Location: Santa Cruz, CA
Contact:

Re: EKM-Omnimeter RS-485 Data

Post by Jameson »

I wanted to follow up and let everyone know where this stands. We have had some conversations with Tridium and based on the time and the price they quoted us, we will have to hold off on paying them to integrate for now. We would have to see a lot more demand for this before we will be able to justify (mostly the expense) of getting our meters to work with Tridium Jace.

So please let us know if this is a need that you have, if we get enough of a response we will bump it up the list of priorities.

Thanks,
Jameson
EKM METERING
http://www.ekmmetering.com
831.425.7371
Jameson
Posts: 860
Joined: Fri Nov 04, 2011 7:42 pm
Location: Santa Cruz, CA
Contact:

Re: EKM-Omnimeter RS-485 Data

Post by Jameson »

LabVIEW was mentioned earlier in this thread, so I thought someone here might be interested in this link to a LabVIEW driver for the v.3 Omnimeters: http://forum.ekmmetering.com/viewtopic.php?f=1&t=3429
Jameson
EKM METERING
http://www.ekmmetering.com
831.425.7371
MohaveTom
Posts: 8
Joined: Wed Aug 12, 2015 2:29 pm

Re: EKM-Omnimeter RS-485 Data

Post by MohaveTom »

I think this is the proper place for this comment.

I have written C++ code to read my v.4 Omnimeter and store the responses in a database.
This is a Qt project, so it is full of Qt specific stuff.

These links will take you to the sources.
https://github.com/MojaveTom/QtReadEkm
https://github.com/MojaveTom/QtSupportRoutines

Since I have only a v.4 meter, there are stubs for some of the v.3 specific functions.

Smiles,
Tom
sensij
Posts: 7
Joined: Fri May 08, 2015 9:48 am

Re: EKM-Omnimeter RS-485 Data

Post by sensij »

Jameson wrote: Here is our CRC code... This is a standard lookup table implementation with the standard CRC16 polynomial, the differences in computation are in the code, dealing with the initial value, endianness, and 7-bit encoding.

static const uint16_t const ekmCrcLut[256] = {
<snip>
};

uint16_t ekmCheckCrc(
const uint8_t const*dat,
uint16_t len
) {
uint16_t crc = 0xffff;

while (len--) {
crc = (crc >> 8) ^ ekmCrcLut[(crc ^ *dat++) & 0xff];
}

crc = (crc << 8) | (crc >> 8);
crc &= 0x7f7f;

return crc;
}

Thank you for sharing this! Saved me a bunch of time....
Daniel_Ch
Posts: 6
Joined: Mon Jan 11, 2016 12:02 pm

Re: EKM-Omnimeter RS-485 Data

Post by Daniel_Ch »

Hi Jameson,

I'm trying to get data from the sensor v.3, I'm using arduino microcontroller and I would like to know if there is a ('\n') at the end of each line.

this file makes me guess
this file makes me guess
ekmu.png (18.91 KiB) Viewed 90969 times
Jameson
Posts: 860
Joined: Fri Nov 04, 2011 7:42 pm
Location: Santa Cruz, CA
Contact:

Re: EKM-Omnimeter RS-485 Data

Post by Jameson »

Hello Daniel,

There is not an ASCII "\n" at the end of each line, the HEX Meter Request and HEX Meter Return are just as you have posted them. The nice part about HEX is there are no hidden ASCII characters. If you convert ASCII "\n" to HEX you would get 5c 6e.

I can see that this meter request is for Omnimeter II v.3 UL #10001320, and I can see your full meter response with checksum 1A 44. Let me know if you are having trouble parsing the data.

Hope this helps.
Jameson
EKM METERING
http://www.ekmmetering.com
831.425.7371
Daniel_Ch
Posts: 6
Joined: Mon Jan 11, 2016 12:02 pm

Re: EKM-Omnimeter RS-485 Data

Post by Daniel_Ch »

I want to make an alert when there is overload detected and make a signal to turn off some machines, so I bought a max485 to convert rs485 data from meter, it is connected in serial with the push system, I pretend to read the request and response.

I'm using SerialEvent code to read the Rx port in arduino, I think I've solved 7E1 serial configuration, but I need to make sure if I will get data as the strings I uploaded in post above, my purpose is to read the electric power, I need to keep data in a register and get access to an specific line.
After that, I compare it with a constant value to activate the signal I am looking for, so I need to make sure that data will look like those strings.

One more thing, the ekm meter is reading every minute, the boud rate is 9600 independently ?

I wasn't aware about 7E1 configuration, this was the result in serial monitor.
I expect better results next time.
Attachments
serialdata.png
serialdata.png (30.26 KiB) Viewed 90965 times
Last edited by Daniel_Ch on Tue Jan 26, 2016 8:21 am, edited 1 time in total.
Jameson
Posts: 860
Joined: Fri Nov 04, 2011 7:42 pm
Location: Santa Cruz, CA
Contact:

Re: EKM-Omnimeter RS-485 Data

Post by Jameson »

It looks like you are interpreting data in ASCII, we tend to recommend you keep in in HEX. Otherwise you will get the symbols and unprintable characters that are impossible to interpret.

Can I ask: Seeing as you already have an EKM Push reading your meter, why trigger based on the RS485 data and not use the EKM Push data API directly? Does your Arduino have an ethernet port or only a serial port?

http://www.ekmmetering.com/developer-portal/

Yes, the meter always communicates at 9600 baud, 7 data bits, Even Parity, 1 Stop Bit, and No Flow Control.

Good luck, sounds like a fun project! Let us know how it turns out :)
Jameson
EKM METERING
http://www.ekmmetering.com
831.425.7371
Daniel_Ch
Posts: 6
Joined: Mon Jan 11, 2016 12:02 pm

Re: EKM-Omnimeter RS-485 Data

Post by Daniel_Ch »

Yes, only serial port.

I just modify my code to print in HEX, and 7E1 configuration not 8E1, do you think that I can read data properly using the max485 which converts from rs485 to ttl ?

Thank you so much,

Daniel
Post Reply