Fastest way of deleting a wack load of strings in Siemens

cotang

Member
Join Date
Aug 2006
Location
calgary
Posts
58
So, my problem is I have a DB of 4 strings of 254 bytes (total of 1024). I need to clear them every cycle (sorta like a buffer I guess). I tried using a For loop but its kinda slow. I tried using the delete function (FC4) but I can't call it 4 times else it gives me a OB88 error which I believe is a nesting problem. Plus it not working for me. I tried using blkmov (by creating another DB of blank and transferring it over....) it kinda slow too....

Any other options out there?

Thanks.
 
Not elegant, but is probably fastest. Just takes a littlebit of typing ;)
With some clever cutting and pasting and searching and replacing it may not take more than half an hour or so.

OPN DB10
L L#0
T DBD0 // bytes 0-3
T DBD4
T DBD8
. // etc
. // etc
T DBD1016
T DBD1020 // bytes 1020-1023

On a 315 it takes 2.2 us per T DBD times 256 lines, which means approx 0.5 ms.
 
No, that would be STL.

Btw, there is one thing that my STL code didnt cover. The first two bytes in a string tells how long the reserved string is in bytes, and how long the current text in the string is.
In SCL this is taken care of automatically.

In SCL, you can try to write:

MyDB.String1 :='' ;
MyDB.String2 :='' ;
MyDB.String3 :='' ;
MyDB.String4 :='' ;

This creates this STL code (DB1 with 4 strings from DBW0 onwards):
Code:
      SET   
      SAVE  
      =     L      0.1
      L     W#16#FE00
      T     DB1.DBW    0
      L     W#16#FE00
      T     DBW  256
      L     W#16#FE00
      T     DBW  512
      L     W#16#FE00
      T     DBW  768
      SAVE  
      BE
One can see that it simply sets the string length to zero. It does not actually clear the content of the string.
But this could be enough if you really use the strings as standard strings. If you do not read the string as individual chars.
 

Similar Topics

I used to do DH+ a lot but it's been years so I thought I get a quick sanity check here. So, one of the site got a AB SLC 5/04 hooked up to a...
Replies
6
Views
2,120
1769-L24ER-QB1B CPU / RsLogix 5k V20 Does anyone know the fastest rate data (Float Register data) can be log to the SD card? Can it be done at...
Replies
1
Views
1,733
Hi, we have to move a lot of data out of a Controllogix in an Excel sheet. At the Moment we are using OPC via RSLinx. Is there a faster way? Or...
Replies
11
Views
6,700
What is the fastest Pulse frequency that an AB 1769-IQ32 (CompactLogix Standard Input Card and not ua Highspeed counter) can detect reliably for a...
Replies
3
Views
2,062
Trying to determine the fastest execution time possible for a new 5000 cpu. Two DC Inputs assuming the fastest DC module. Two DC Outputs again...
Replies
8
Views
2,705
Back
Top Bottom