Quick S5 DataBlock question

Johnny T

Member
Join Date
Jul 2003
Location
Fife, Scotland
Posts
642
Hi

If I write in S5:
 G DB 20 



How many words does DB 20 have that I've just created. I know on S7 you can go in and edit the DB and designate how many words it contains etc. If I generate a DB in S5 does it have 256 words in it automatically or do I need to add something to the code to tell it to fill the DB with spaces for words?

Hopefully that question makes some sense...

Basically what I'm asking, is the following code illegal:
G DB 20
C DB 20
L KF 100
T DW 50


??

Thanks

JT
 
Hello johnny T;

Here is a quote from a S5 manual (CPU 943):
S5_DB_length.jpg


So basically, yes, your code is valid. To look up values in DWs with idenntification lower than 255 Load and Transfer instructions are adequate.
Hope this helps,
Daniel Chartier
 
If I generate a DB in S5 does it have 256 words in it automatically or do I need to add something to the code to tell it to fill the DB with spaces for words?
Nope. The number of words in the DB generated is equal to the number that was in ACCU1 when you executed the code + 1.
E.g. if you have the next code in your program
L  KF +100
G DB 20

then DB 20 will contain DW 0 up to and including DW100, or a total of 101 DW's.
You cannot change the length of a DB in the program, but you're able to erase a DB by loading 0 into ACCU1 prior to generating the DB. E.g. this code erases DB20:
L  KF +0
G DB 20

After this code you can regenerate the DB with a different length.

Kind regards,
 

Similar Topics

I'm trying to import a .prj file and I keep getting the error message: Project import error. i Any ideas how to get around this? Thanks.
Replies
0
Views
67
Hi, I am looking for some help with a GE Fanuc Versa Max Micro Controller model IC200UDR001-BF connected to a Quickpanel mini display...
Replies
3
Views
141
Hello, I want to plot a line on X,Y axis with defined start and end points on Quick Panel+. I use PAC Machine Edition 9.7, and it supports...
Replies
14
Views
1,721
Hello, I want to plot a line on X,Y axis with defined start and end points on Quick Panel+. I use PAC Machine Edition 9.7, and it supports...
Replies
0
Views
342
I have previously shared this elsewhere, so I apologize if you have already seen it. Here is a basic and quick introduction to Python for PLCs...
Replies
10
Views
2,236
Back
Top Bottom