Host Engineering Forum
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 22, 2012, 03:30:36 pm


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: report by exception, Visual Basic?  (Read 854 times)
Buzz
Newbie
*
Posts: 5


« on: September 09, 2010, 12:14:01 pm »

Is it possible to receive data from the ECOM100 using a Visual Basic 6 application (via VB's WinSock control) in a manner similar to how (viewer.exe) does with the report by exception's C++ code?
Logged
Greg
HOS†ech
Host Moderator
*****
Posts: 320


Hmmm...


WWW
« Reply #1 on: September 10, 2010, 02:28:25 pm »

It is possible, but we don't have an example of it. There are customers who have done this. Perhaps you can look at the C++ code of Viewer.EXE and figure that out? If so, you can let us know and we'll give your working example to other VB6 users that might need it.  Smiley
Logged

"You have to believe in free will. You have no choice." -Isaac Bashevis-Singer
Buzz
Newbie
*
Posts: 5


« Reply #2 on: September 10, 2010, 06:03:10 pm »

I have my VB app listening on socket or port number 30583.  I also have the VB WinSock protocol set to TCP/IP but none of the VB WinSock connection events fire when I trigger them from the ECOM100, no error events either.  It's as if nothing, WinSock related, is happening at all. I know the ECOM100 is indeed sending packets back to my PC because the C++ 'viewer.exe' receives / displays them. 

viewer.exe's caption always denotes UDP and will only receive data when its protocol is set to UDP.  NetEdit3.exe only finds the ECOM when set to TCP/IP.  Does anyone know why viewer.exe has to use UDP and NetEdit3.exe has to use TCP/IP?
Logged
franji1
Bit Weenie
Host Moderator
*****
Posts: 1035



WWW
« Reply #3 on: September 11, 2010, 01:16:09 pm »

Actually, NetEdit does use UDP/IP, but people are familiar with the term TCP/IP, and in this industry, Ethernet/IP means something totally different than Internet Protocol.
Logged

BobO
Host Moderator
*****
Posts: 1149


Yes Pinky, we *are* going to control the world!


« Reply #4 on: September 13, 2010, 10:14:04 am »

TCP/IP is generally regarded to be the proper name of the stack. TCP is a specific subset of TCP/IP, as is UDP. All of Host's protocols use UDP, as datagrams most closely parallel the packet based protocols that are generally used in automation.
Logged

BobO

The Constitution does not guarantee us freedom from being offended...but we can choose not to be, and life gets so much easier.
Buzz
Newbie
*
Posts: 5


« Reply #5 on: September 13, 2010, 02:46:21 pm »

It is possible, but we don't have an example of it. There are customers who have done this. Perhaps you can look at the C++ code of Viewer.EXE and figure that out? If so, you can let us know and we'll give your working example to other VB6 users that might need it.  Smiley


After reading franji1's and BobO's replies. .  I played around with my VB app's WinSock settings and I'm now receiving 'report by exception' data from the ECOM100 using the UDP protocol (Visual Basic 6)

This is how its works in VB. I have a form with a WinSock control named "ECOM_WinSock"  The Form's load event looks like this.

Private Sub Form_Load()
    Me.ECOM_WinSock.Protocol = sckUDPProtocol
    Me.ECOM_WinSock.Bind 30583
End Sub
When the ECOM100 sends data to my PC the 'ECOM_WinSock_DataArrival' event is triggered. The data is retrieved via the 'GetData' method.  I'm also able to know which ECOM device the data came from by reading the 'ECOM_WinSock.RemoteHostIP' property. Read the 'RemoteHostIP' value from within the 'DataArrival' procedure, at same moment the 'DataArrival' event fires.  Thanks! I'm sort of in disbelief at how easy this is looking today.  Grin

« Last Edit: September 14, 2010, 10:37:33 am by Buzz » Logged
franji1
Bit Weenie
Host Moderator
*****
Posts: 1035



WWW
« Reply #6 on: September 13, 2010, 02:49:45 pm »

Thanks! I'm sort of in disbelief at how easy this is looking today.  Grin
Thank YOU for sticking with it!
Logged

Greg
HOS†ech
Host Moderator
*****
Posts: 320


Hmmm...


WWW
« Reply #7 on: September 13, 2010, 04:08:38 pm »

Awesome, Buzz! I'll make this available to others.  Cheesy
Logged

"You have to believe in free will. You have no choice." -Isaac Bashevis-Singer
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM