RS485

Forum is open to all questions, answers, and discussions related to electric meters, ours or others.
oxymai
Posts: 8
Joined: Sat Dec 30, 2017 3:07 pm

Re: RS485

Post by oxymai »

attached is data response from my V4 meter
Attachments
ekm_issue.jpg
ekm_issue.jpg (66.99 KiB) Viewed 19124 times
Jameson
Posts: 860
Joined: Fri Nov 04, 2011 7:42 pm
Location: Santa Cruz, CA
Contact:

Re: RS485

Post by Jameson »

Hey oxymai,

Thank you for sending the screenshot along with the settings you are using (though I dont understand all of your settings).

From what I can tell by just looking at your screenshot, it looks like you are sending a good meter request, the meter is receiving this request, and is sending a full response (though you are not actually receiving all of it).

First thing I would do is read your meter using the EKM Dash software and your USB converter. This will both confirm that you have everything properly connected and that your meter is sending good data when it responds. You can also use the EKM Dash Hex Inspector to help you parse the data in the future.

Second, I would setup a sniffer to "sniff" the RS485 traffic. We use RealTerm (PC) or CoolTerm (MAC) for this. This is like an independent observer, that just looks at the traffic in an unbiased way. This is critical for troubleshooting issues. I cant tell you how many times this has helped me!

Third, I would triple-double check that your serial settings are 9600 baud, 7 data bits, even parity, 1 stop bit, and no flow control. I imagine that this is the problem that you have: one of your serial port settings is not getting set properly.

Will you reiterate what all of these settings mean?:

SerialPortSettings.c_cflag |= PARENB; => Is this Even Parity?
SerialPortSettings.c_cflag &= ~CSTOPB; => Looks like Stop Bit. Is this 1 Stop Bit?
SerialPortSettings.c_cflag &= ~CSIZE;
SerialPortSettings.c_cflag |= CS7; => I guess this is 7 data bit
SerialPortSettings.c_cflag &= ~CRTSCTS;
SerialPortSettings.c_iflag |= IXOFF;
SerialPortSettings.c_iflag &= ~ICANON;
Jameson
EKM METERING
http://www.ekmmetering.com
831.425.7371
Post Reply