5
« on: March 18, 2008, 06:50:22 AM »
Hi There,
I have 5 pcs T100MD888 connected to Fargo Telecom Mobile modems and one Windows server also connected to a Fargo Telecom Mobile modem. All modems are running at 9600 Baud
Once per day or when the DM[] variable reaches a threshold, each plc Modem dials the server modem and dumps the DM[] ( in a padded format) and reads the RTC.
I use the Trilogi server version 2.0 and the standard dial modem function supplied by Trilogi.
When sending the data to the modem it is converted ? on the fly? to text with zeros being padded and some hyphens and commas are added as date and field delimiters and a CR for every 10 values in the DM.
Each Record is 10 positions in the DM as follows:
DM[1] = Date, DM[2] = Month, DM[3] = Year, DM[4] = Hour, DM[5] = Minute, DM[6] = Second, DM[7] = Value, DM[8] = ID, DM[9] = Value, DM[10] = Spare,
i.e if the DM Variable looks like this
18 3 2008 9 14 26 1 139 0
18 3 2008 9 9 26 2 139 0
18 3 2008 9 9 26 3 139 0
18 3 2008 9 9 26 1 139 0
it will be sent as records like this
18-03-2008,09:14:26,1,139,0 [CR]
18-03-2008,09:09:26,2,139,0 [CR]
18-03-2008,09:09:26,3,139,0 [CR]
18-03-2008,09:09:26,1,139,0 [CR]
This works and has been working fine for more that 12 months, as long as the DM[] is not filled beyond DM[1500]
If there is more data then some data is lost , not much just a comma or a few characters, but of course enough to corrupt data., and messing up the import rutine on the server
Until now I have solved it by sending data as soon as the DM[] variable reaches 1400 positions.
But now I will be installing at a site where the DM[] will fill up completely 2-3 times a day. So I have to solve the problem., because dialing up 5-10 times per day is to expensive, and the PLC is blocked during the process
I now guess the corruption is due to a buffer overflow I therefore introduced a 400 ms pause for every 50 records being sent, by adding the following in my ?send and format data? procedure
If Y MOD 500= 1 then
Delay 400
End if
This actually works ( have tried filling up the DM[] to positions 3840 10 times and transferring data), but prolongs the transfer time by 3 seconds in which the PLC is inactive
But I am worried about using the Delay function, would it be better to make at For Next loop to create a pause in the flow or is there another way of reducing the speed of dataflow?
/PeterH