- Interactive Q & A - Interactive Q & A (
-   LIVE PLC Questions And Answers (
-   -   Indirect addressing with WinCC Flexible (

suppaman June 13th, 2013 02:12 AM

Indirect addressing with WinCC Flexible
3 Attachment(s)
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.

RMA June 13th, 2013 05:54 AM

For this sort of thing I always do it the other way round now - create a single display page for the HMI and resrve a space in the PLC memory for this. I then map the data as required in the PLC - much easier than trying to do it in the HMI and you save a load of tags as well (although I believe that's no longer such a problem with WinCC Flex as it was with ProTool).

uptown47 June 13th, 2013 10:41 AM

I'm with Roy on this one. A datablock in the PLC and then the data is mapped in via an Int in the PLC which is incremented or decremented by your navigation buttons indirectly.

All times are GMT -5. The time now is 09:46 AM.