TCP Help

Forum is open to all questions, answers, and discussions related to electric meters, ours or others.
Post Reply
Wouter
Posts: 11
Joined: Sun May 20, 2012 11:37 am

TCP Help

Post by Wouter »

Okay...

I've got a Omni v.3 meter hooked up to an Iserial box. It works and the software works and I have been successful in auto logging to Wattvision.

However, I would like my own controller to read the data. I can not use RS485 since my controller is using it with other devices. There is no overlap in regards to baud, etc. I am happy to use TCP.

I get confirmation of the connection but do not get any data. Are you able to help?

Here is the code of my controller.

SYSLOG "HELLO WORLD"

DIM mtr$(1000)
DIM l
DIM p$(1000)
DIM cr$

cr$ = "/r/n" ' carriage return line feed

OPEN "TCP:192.168.1.125:1000" AS 3 ' open connection on handle 3

Delay 100 ' wait for a bit

IF CONNECTED(3) THEN
SYSLOG "Connection has been made" ' confirm connection
ELSE
SYSLOG "No connection" ' connection failed
END ' give up
ENDIF

10
Delay 5000 'wait 5 seconds

READ 3,mtr$,0,cr$ ' read the connection on handle 3

l= LASTLEN(3) ' get the length of the response
SYSLOG "File length: " + str$(l) ' publish file length
SYSLOG "File read: " + mtr$ ' print file
p$ = "" ' initialize conversion string

FOR i = 1 to l
p$ = p$ + SPRINTF$("%02x" , MIDGET(mtr$,i,2)) ' convert data
NEXT i

SYSLOG "This is the converted string: " + p$ ' print converted string

GOTO 10 ' loop around... do another read

END
Wouter
Posts: 11
Joined: Sun May 20, 2012 11:37 am

Re: TCP Help

Post by Wouter »

Well I am finally getting a response... but not what I expected.

I am only getting 29 bytes back and I don't recognize it at all.

FF FB 01 FF FB 03 FF FB 00 FF FD 01 FF FD 00 FF FA 2C 05 09 FF F0 FF FA 2C 05 0C FF F0

Any idea?

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

Re: TCP Help

Post by Jameson »

I would be interested in knowing if this is a response coming from the meter. Are you sending your meter an RS-485 hex string?

If you have an Omnimeter you will be using this document: http://documents.ekmmetering.com/Meter_ ... ter_v3.pdf

You will want to make sure you are sending the top line in RED (formulated for your meter number). You can sniff the RS-485 traffic between your meter and the iSerial to make sure it is coming our right.

Let us know if this is what you are doing already. Or if you make progress, let us know.

Thanks and good luck.
Jameson
EKM METERING
http://www.ekmmetering.com
831.425.7371
Post Reply