Technical Forum

STEP 7 (TIA Portal)

Editing data in DB?

Thread Starter: Franz87   Started: 6/8/2012 3:02 PM   Replies: 2

« Previous thread Next thread »
Page 1 of 1 (3 items)
  6/8/2012, 3:02 PM
Joined 6/8/2012
Last visit: 6/13/2012
Posts: 3
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hello everyone,
I've recently bought an S7-1200 for a university project and I'm pretty new to the TIA Portal.

I have the following question (don't know it there is a similar thread to this one, haven't found it yet):
How can you edit/import data to a global DB block? 

I need to introduce arrays of thousands of values and obviously I cannot introduce them by hand. I can see from the "copy as text" option that the DB blocks are written in SCL language? (not familiar with it).  So how can I import data, via excel file for example, or can I somehow edit the underlying source file of the DB block?

Help would be appreciated, this problem is driving me batty.
Top
  6/8/2012, 3:22 PM
Joined 7/7/2010
Last visit: 5/17/2013
Posts: 1977
Rating:
Rated: Excellent [4.01 out of 5 / rated 200 time(s)]. (200) 
Users with special expertise supervising conferences
Rated: Excellent [5 out of 5 / rated 1 time(s)]. (1) 
Franz87 wrote:
Hello everyone,
I've recently bought an S7-1200 for a university project and I'm pretty new to the TIA Portal.

I have the following question (don't know it there is a similar thread to this one, haven't found it yet):
How can you edit/import data to a global DB block? 

I need to introduce arrays of thousands of values and obviously I cannot introduce them by hand. I can see from the "copy as text" option that the DB blocks are written in SCL language? (not familiar with it).  So how can I import data, via excel file for example, or can I somehow edit the underlying source file of the DB block?

Help would be appreciated, this problem is driving me batty.

When in the DB editor, you can try some of the following.  Please report back which if any work best for you.

I am assuming virtually all will have the same datatype within the array or this may be more difficult...

1. Create a single array entry that conforms to the properties required, like:
myDBarray1 : ARRAY[1..1000] of BYTE : initial value = 0; // comment here
2. Now exand the array (click the |>).  Highlight the top most entry row by clicking the box [] to the left of the array element name.
3. Ctrl-C to copy that row.
4. Go to notepad, paste it (ctrl-V).  Change it slightly for #2 if you need it to be different.
5. Select the changed data, ctrl-c, then back in portal in row 2 of your array, try pasting it over top of the row.
--- portal might crash here, it might work, it might do nothing...

Try the same with excel.

The nice thing about the portal db editor is you just name it myArray1, make it an array of the appropriate type, and it is done.

If you need special structures for your data, create a plc datatype, then create an array of those structures.

You can copy the entire database, paste into excel, change, and paste it back.  Be careful and save often as this often results in crashes even in the latest released service pack and update.  I know, I do this several times a day and it crashes every day. :(

Helpful? Rate it.
Solved? Post it.
Top
  6/8/2012, 3:49 PM
Joined 6/8/2012
Last visit: 6/13/2012
Posts: 3
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi,

I had already tried the first variant, it worked but if I copied more than 2000 values the damn thing crashed. I thought there would be a more efficient way. 

Thank you anyway for the advice.
Top
Page 1 of 1 (3 items)
Actions