EWEB reading 3rd Party Device SNMP Data Value

nakedpanic

Member
Join Date
Nov 2005
Location
Detroit
Posts
18
I'm looking if anyone has any suggestions or insights into this. I'm bench testing using a 1756-EWEB card to read a data value from a 3rd party device using SNMP.

Here's how I break it down:

EWEB CreateSocket (looks to be working)
EWEB OpenConnection (looks to be working)
EWEB WriteMessage (This would be a 'GetRequest' call with OID for data value I want. Not working yet, can't seem to get this out of error, and not sure how to build the message)
EWEB ReadMessage (looping read, waiting for response from 3rd party device. Not sure until something actually is sent from device, no error on msg)
EWEB DeleteSocket (looks to be working)


I'm not sure about msg timeouts either. My end application would read about 15 of these devices, so I have to consider that also, however getting 1 to work is key.
 
I can't give you an example application, unfortunately. There's an EWEB expert on the Forum, username Contr_Conn, who might have done this already.

Approach this just like you would an ASCII application; first intercept a working set of data exchanges between an SNMP browsing utility and the end device, then intercept your EWEB traffic and compare them.

What MIB objects are you trying to read, and from what sort of device ?
 
I modified a VB6 app to get the data over SNMP into the app, and it worked, which I used to get the actual OID I need for the data I want. I've got the OID written down at my work desk, but it's a string like 1.x.x.x.x.x.x.x.x.x

The device is a PoE Temperature sensor, typically used in a server room.
 
I traced the VB app's socket call and will try using the same string and size and see what happens. It builds a 256 byte array, which I'll copy.
 
As Ken mentioned, I did some work with open sockets, but I never used this for SNMP calls.

If you have forking VB code and non-working sockets application, then post it here and I will take a look.
 
One thing I see is that SNMP uses UDP on port 161.
In this case you should not be "opening connection"
"Opening connection" used only with TCP
Instead you should send UDP "Write" message and wait for response.
 
Thanks for the reply!

I'll try not opening the connection, but the manual indicates you don't have to include the IP and Port in the write message parameter if you have the open connection.

But, still failing on the write message parameter. I traced the VB app, which I found the OID as 1.3.6.1.4.1.129.133.71.3.2.0
The app builds a byte array(255)=
48, 41, 2, 1, 0, 4, 6, 112, 117, 98, 108, 105, 99, 160, 28, 2, 1, 1, 2, 1, 0, 2, 1, 0, 48, 17, 48, 17, 48, 15, 6, 11, 43, 6, 1, 4, 1, 129, 133, 71, 3, 2, 0, 5, 0's in remaining

So I tried to put those in the SINT array (in decimal) but Logix doesn't allow me to enter the 160, 129 and 133 values, which I'm assuming is some type of ascii value error, but don't know how to get around that.
 
Without looking at your application I can't say what is wrong. Also can you post wireshark trace for vb message?

As for numbers greater than 127 you need to convert them to hex and enter as hex. They will be shown as negative under decimal representation but logix does not have unsigned 8bit values.
 
Last edited:
The SINT data type in Logix 5000 is a Signed integer, so it has 7 data bits and a sign bit and can represent -128 to + 127.

I work around that by doing a masked move from a larger value (DINT -> SINT), or when I'm entering a constant I fake it by subtracting 256.

129 = 0x81 hex = "-127" ControlLogix SINT
133 = 0x85 hex = "-133" ControlLogix SINT
160 = 0xA0 hex = "-96" ControlLogix SINT

Edit: or, of course, enter the value in hex by pre-pending a "16#". In RSLogix 5000, "16#A0" = -96 (ControlLogix SINT) = 160 (Unsigned Byte)
 
I'll try that ken.
Not sure what a wireshark trace is...

Just completely broke down the request array, using a different OID 1.3.6.1.2.1.1.1.0 which return a text string from the device:
[] =
0 = UniSeq {not sure} = 48
1 = last array position = 38
2 = ver byte type = 2
3 = ver packet len = 1
4 = ver packet data = 0
5 = community byte type = 4
6 = community len = 6
7-12 = "public"
13 = context byte type = 160
14 = context packet len = 25
15 = request byte type = 2
16 = request packet len = 1
17 = request data = 0
18 = error byte type = 2
19 = error packet len = 1
20 = error data = 0
21 = index byte type = 2
22 = index packet len = 1
23 = index packet data = 0
24 = struct1 byte type = 48
25 = struct1 packet len = 14
26 = struct2 byte type = 48
27 = struct2 packet len = 14
28 = object byte type = 6
29 = object packet len = 8
30-37 = 43,6,1,2,1,1,1,0 {the OID}
38 = 5 {end marker}
39 = 0 {guess it adds a trailing zero}
 
Not sure how you can troubleshoot Ethernet without Wireshark?
This is a traffic capture program - google it

What you need is to capture vb packet and compare it to the packet sent by EWEB
 
Is this what you are looking for?

24 1.276252 10.105.11.157 10.105.11.185 SNMP 298 get-request 1.3.6.1.4.1.17095.3.2.0

0000 00 03 64 03 0f dd 00 1c 7e 16 54 ba 08 00 45 00 ..d..... ~.T...E.
0010 01 1c b4 b0 00 00 40 11 98 f9 0a 69 0b 9d 0a 69 ......@. ...i...i
0020 0b b9 13 29 00 a1 01 08 03 d2 30 29 02 01 00 04 ...).... ..0)....
0030 06 70 75 62 6c 69 63 a0 1c 02 01 01 02 01 00 02 .public. ........
0040 01 00 30 11 30 0f 06 0b 2b 06 01 04 01 81 85 47 ..0.0... +......G
0050 03 02 00 05 00 05 00 00 00 00 00 00 00 00 00 00 ........ ........
0060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
0070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
0080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
0090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
0100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
0120 00 00 00 00 00 00 00 00 00 00 ........ ..
 
yes, but I need full trace.

Can you save wireshark trace and post it?

Also I need your write message configuration and source tag data structure
 

Similar Topics

Does anyone have downloads of the TN 42799 and TN 49389 technotes? They are no longer available on Tech Connect.
Replies
3
Views
1,629
hi, i try to use eweb tcp serve program to transfer data but it time out. so i just want to know is there limit or fix for that. the sample not...
Replies
0
Views
1,064
I have updated the firmware of the EWEB module first to 5.001 then to 4.016. I have updated the firmware of the 1756-L73 to v28. The device is...
Replies
1
Views
1,511
Hello, There used to be a toolkit available through Allen-Bradley for the 1756 EWEB card to assist the development of webpages. Allen-Bradley...
Replies
1
Views
1,505
hi, i follow the manual to setup server and client for 1756-eweb card but i have some question, is there anyone who have program for both server...
Replies
1
Views
1,071
Back
Top Bottom