1. Erick Bergsma
  2. PowerBuilder
  3. Monday, 18 November 2019 16:13 PM UTC

Hello!!

Does anyone have working examples to ready data coming from an ethernet port?

I have tried WinSock, but I can't seem to get it to work.

We are on PowerBuilder 17 R3 Build1880.

 

We currently have a Weigh Scale application that is using Serial Port, but we want to convert it to Ethernet.

I've had Mettler Toledo in, and they demonstrated that our unit is currently sending data via the Ethernet port, I just can't figure out what I need to get it to work.

Any advice or direction is REALLY appreciated.

 

Accepted Answer
Erick Bergsma Accepted Answer Pending Moderation
  1. Wednesday, 20 November 2019 20:12 PM UTC
  2. PowerBuilder
  3. # Permalink

Thanks to all who chimed in.

For our solution, we used ...

https://wiki.scn.sap.com/wiki/display/SYBPB/Winsock+APIs

 

It contains the code we needed in order to make a request to a specific IP address and return data from port 2110.

 

 

Comment
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Tuesday, 19 November 2019 03:57 AM UTC
  2. PowerBuilder
  3. # 1

i would start with roland's winsock :

http://www.topwizprogramming.com/freecode_winsock.html

 

Comment
  1. Erick Bergsma
  2. Tuesday, 19 November 2019 12:52 PM UTC
Thanks Mike.. I already have it...but it doesn't appear to work for me.

I tried emailing Rowland, but the emails all bounce back for me.
  1. Helpful
  1. Roland Smith
  2. Tuesday, 19 November 2019 13:59 PM UTC
There isn't a W in my name, my email is roland@topwizprogramming.com.



My Winsock example is coded to work for TCP & UDP. What protocol does the device use?
  1. Helpful
  1. Erick Bergsma
  2. Tuesday, 19 November 2019 17:33 PM UTC
TCPIP...

I can use HyperTerminal successfully, and I get the Scale Unit data simulated on the screen.



Host Address: 192.168.0.1

Port: 2110

Connect Using TCP\IP(Winsock)





  1. Helpful
There are no comments made yet.
Erick Bergsma Accepted Answer Pending Moderation
  1. Monday, 18 November 2019 19:53 PM UTC
  2. PowerBuilder
  3. # 2

Thanks John...

I don't need to "analyze" any packets, I'm trying to figure out how to get PowerBuilder to read the data via the Ethernet port.

So far, I've figured out that Winsock is suppose to be able to do this.

I've successfully captured data using HyperTerminal, connected TCPIP via Winsock.

Now, to figure out all the API calls and the order of them.

I'm using ws2_32.dll as the Winsock API, and, as far as I can tell, I need to do  StartUp, a Connect, and a Listen.

I was just looking for an example to steal from... :-)

 

Comment
There are no comments made yet.
John Raghanti Accepted Answer Pending Moderation
  1. Monday, 18 November 2019 19:39 PM UTC
  2. PowerBuilder
  3. # 3

Is this something that maybe WireShark can capture?

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.