Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - abradford

Pages: [1]
1
Technical support / Controller drops TCP connection
« on: July 30, 2009, 10:02:51 AM »
Hi all,

I'm having two issues with my F2424 controller.  First, the controller seems to close TCP connections without reason during data transfer, and second, the STATUS(3) command doesn't detect the closed connection.

What happens is the controller connects to a central server to upload a sensor log, but sometimes during the data upload the TCP connection is dropped.  The server sees a 'Connection reset by peer'.

There doesn't seem to be a way to detect the dropped connection on the PLC, as STATUS(3) call in the following code is ineffectual in stopping the loop.  When the connection drops, the controller is unaware and continues trying to upload the data.

Any help will be much appreciated!
Andrew


This is the code that is affected by the dropped connection:
Code: [Select]
' loop through the controller log
   WHILE I < N
' offset from start of log
      O = DM[34] + (DM[30] * DM[32])

' format data to send (6-char ascii number)
      A$ = STR$(DM[O], 6)
      A$ = A$ + STR$(DM[O + 1], 6)
      A$ = A$ + STR$(DM[O + 2], 6)
      A$ = A$ + STR$(DM[O + 3], 6)
      A$ = A$ + STR$(DM[O + 4], 6)
      PRINT# 4 A$

      ' Erase log entries that have been sent
      DM[O] = 0
      DM[O + 1] = 0
      DM[O + 2] = 0
      DM[O + 3] = 0
      DM[O + 4] = 0
      ' Bring the start index up to speed
      DM[30] = (DM[30] + 1) MOD (DM[33] / DM[32])

' if the connection is closed, close our end down
' and log an error
      IF STATUS(3) <> 1 THEN
         PRINT# 4 "</>"
         DM[DM[40]] = DM[DM[40]] | 4
         RETURN
      ENDIF

      I = I + 1
   ENDWHILE

2
Technical support / Binary Data over Ethernet
« on: June 26, 2009, 12:46:59 PM »
Hi,

I'm transmitting data from my controller to a PC using the built-in ethernet module on the F2424.

I've got it connecting and mostly working.  When I run the custom function, no binary data comes through on the PC.

e.g. (on the controller):
OUTCOMM 4, 65
PRINT# 4, "hello"

The data I receive on the PC doesn't include the binary data.  All I see on the PC is "hello" when what I should see is "Ahello".  (65 is the ASCII value for 'A').

Any help is appreciated,
Andrew

Pages: [1]