Author Topic: Trnsmission errors  (Read 6326 times)

peterh_DK

  • Newbie
  • Posts: 37
    • View Profile
Trnsmission errors
« on: January 02, 2007, 01:39:16 AM »
Hi There,
Has anybody got some experience in transmitting text files?
I have 3 TM100MD+ with RTC  and each is connected  to a Fargo Mobile modem

Each unit dials in every morning and dumps the content of the DM[] array, using TLServer on a host machine.
This  basically works fine. The output from each DM[] array is formatted while sending in order to reflect records in a database
The format is as follows:

Date, time, value1, unitID, value2 >CR>

Two of the units usually return 50-70 lines ( i.e. records) and one unit usually returns 100-200 records.
I have received approximately 15.000 records this way during the last months but every week I get some transmission errors where some characters are lost.
My SQL database can handle the import errors, but I loose data.
What can I do to raise the transmission quality or even better how can I check that the transmission is ok on a character level?

I check for the <OK> when I close the text file with Print#1 "/" Command but these errors are in the middle of the transmission.


Examlpe 1 Line 3: the characters "3,0 <CR>" are lost
 
20-12-2006,15:34:28,1,123,0
20-12-2006,15:35:42,3,123,0
20-12-2006,15:35:48,3,1220-12-2006,16:14:10,1,123,0
20-12-2006,16:14:12,3,123,0
20-12-2006,16:14:39,1,123,0
20-12-2006,16:17:25,1,123,0
20-12-2006,16:19:12,1,123,0


Example 2 line 4: ?30-12-? is sent twice
30-12-2006,15:26:09,3,123,7
30-12-2006,15:26:15,3,123,1
30-12-2006,15:26:26,2,123,0
30-12-30-12-2006,15:27:13,1,123,1
30-12-2006,15:27:15,1,123,1
30-12-2006,15:27:18,1,123,0
30-12-2006,15:29:44,1,123,11



Example 3 line 4: almost a whole line is lost

21-12-2006,15:03:08,3,123,0
21-12-2006,15:03:10,2,123,0
21-12-2006,15:03:35,1,123,0
21-12-2006,15:03:38,:41,1,123,0
21-12-2006,15:11:55,3,123,0
21-12-2006,15:12:02,2,123,0
21-12-2006,15:12:04,1,123,0
21-12-2006,15:12:07,1,123,0

The examples are just cut out from the complete text files, and the errors usually occur after line 140 typically around line 150-160.

This makes me wonder whether I have a programming error in formatting and sending the file,
but I doubt that this is the case since it is a simple:  for i = 1 max DM size loop,  and it works fines "most" days

Any ideas how can improve transmission check




/Peter

peterh_DK

  • Newbie
  • Posts: 37
    • View Profile
Re:Trnsmission errors
« Reply #1 on: January 03, 2007, 05:45:40 AM »
I got a new bunch of transmission errors today.....

This makes me think:

Is there any error control between the PLC and TLServer. i.e is there a for example a CRC control of the flow when I issue a Print#1 " Appendxxx.txt" and send data to TL Server, or is data just sent out in the blue air and then presumed OK if I receive an <OK> after the Print#1"/" command?

Best regards

Peter

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:Trnsmission errors
« Reply #2 on: January 03, 2007, 03:36:30 PM »
For the PLC to open a file on the TLServer using the File Service tags, there is no error check. It was designed basically for direct RS232 connection in local configuration which are normally quite reliable. If your transmission is through wireless mobile modem, the modem should have some kind of error correction and re-transmission request which is transparent to the PLC in order to handle the transmission error over the mobile network.

Your other solution may be to write a Visual BASIC or VC++ program to receive data from RS232 port. In that case, you can program the PLC to send out the data with a CRC checksum (there is a CRC16 command which can compute CRC) or other checksum method, and when your VB6 or VC++ program receive the data, it will check for a correct checksum to determine if the data is correct. It should discard the data if it is incorrect or request the PLC to resend the data. You will have to develop your own communication protocol in that case.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

peterh_DK

  • Newbie
  • Posts: 37
    • View Profile
Re:Trnsmission errors
« Reply #3 on: January 03, 2007, 11:31:27 PM »
Ok Thanks for the reply,

I will have to live with the errors for the time being. I may, however,  try sending smaller files, because i Don't think it happens with less than 100 records.

/Peter