AdvancedHMI Software
General Category => Support Questions => Topic started by: Joe Matkowski on January 17, 2019, 09:51:08 AM
-
Attached is screenshot of exception I get when using generic tcp client. I am just fooling around trying to send data back and forth between two laptops. I tried using a timer to send data using "GenericTCPClient1.SendString("MyDataString")" got exception so I deleted timer and used a button click and got the same exception. Any ideas??
Jody
-
What are you using for the server?
-
Hercules / TCP Server tab, Hercules shows connection from the correct ip address, I have tried a clean copy of the latest AHMI and I just tried with 3.99w using your example from the forum post https://www.advancedhmi.com/forum/index.php?topic=1982.msg11087#msg11087. Also I have tried changing to different ports thinking my router might be blocking it internally but no luck.
jdm
-
With the clean version of 3.99w I do not get the exception but I also do not get any data.
jdm
-
The client does require a terminating characters so it knows where the end of the packet is. By default it is set to a carriage return. Does the server send a terminating character?
-
I don't believe it does, I added <CR> as well as ##13 per the help popup still cannot receive data, however I can send a string to hercules
jdm
-
In the GenericTCPClient.vb file, insert a break point at line 292
While i < StateObject.CurrentIndex
then run the application to see if it goes to that break point. If it does, then hover over CurrentIndex to see what the value it.
Next move the breakpoint to line 295:
If CurrentByte = m_TerminatingByteValue Then
Then press F5 and each time it hits the breakpoint, hover over CurrentByte to see what the value is. The last byte should equal the TerminatingByteValue, otherwise it will never process the packet.
-
Archie Sorry for the delay I got tied up on another fire to put out. It is not getting a terminating byte using hercules as server. I am going to try and setup two AHMI programs using this version I have that will at least send data and see if I can get it working that way.
-
Is there something you can key off of to know when the full packet is received such as a fixed packet length? Most Ethernet protocols have a packet length in the header that is used to determine when the full packet was received.
-
I have tried two clean versions with your setup and I cannot get them to send back and forth, Not sure what you mean by "key off" I am pretty much way over my head at this point. The main goal of this project is to be able to send data to and from a proprietary scada platform, as all of the equipment we manufacture is rental equipment we have a customer that wants to fully integrate there system into ours for reporting, at the end of the day I need to be able to send a csv string to there system via tcp socket and receive and parse the string they send back.
-
When I say "key off", imagine 2 packets received back to back in a continuous stream. What could be used to know there were 2 packets and exactly where to split the stream?