View Single Post
Old June 13th, 2013, 02:12 AM   #1
suppaman
Member
Italy

suppaman is offline
 
Join Date: Mar 2009
Location: Italy
Posts: 7
Indirect addressing with WinCC Flexible

Hello everyone.

I'm having some problem with indirect addressing in WinCC Flexible RT (PC-based)

I've a DB structured as below: an array of 300element of UDT.
The udt consist in two variables:
Code: INT
Description: STRING[30]

So it's something similar to a table.
In this table, i've to do some operation like add elements, sorting by "code", delete and compact, modify.

On the plc side, there's no problem, i've already written all the function that i needed.
The difficult part is on HMI side.

I've to create a page to view the table. But beacause of the amount of the elements, i would like to have a view in a single page of at least 10 (maybe 20 is better) elements, so 2 columns (one for the code, the other for the description) and lets say 10row.
Then, with two button prev and next i can navigate into the DB Table's elements.

As i'm not an expert with indirect addressing and script, the only way i've got the things working it's like below:
I've create 10 fields "code".
Field1 contain variable Code_1, that point to DBxxx.DBW[code_index_01] (with multiplex address mode), Field2 contain Code_2 that point to DBxxx.DBW[code_index_02] and so on..

A default start value of the internal variables code_index_yy is set, so the first time i run the RT i've the indexes pointin g to the first ten elements.
Then when i press "next" button, it runs a script wich simple increments the variables code_index_yy to point to the next ten elements

But in my opinion is not a very elegant solution.
This HMI communicate with 3 different PLCs, each one have its own DB, so i've to repeat the variable for each one...

Maybe anyone of you have other ideas on how to do that? With a different approch maybe?

I've also attached some images, maybe with these it's easy to understand..
Maybe my explanation is not very clear, but i hope you'll understand the problem.

Thanks a lot for your support.
Attached Images
File Type: png Page.png (8.2 KB, 17 views)
File Type: png Script.png (17.0 KB, 13 views)
File Type: png Variables.png (22.0 KB, 13 views)
  Reply With Quote