Indexed PLC value to HMI

tworst

Member
Join Date
Mar 2016
Location
x
Posts
15
I have tag in my PLC that is array based: TAG[X] (Real)

I want to display this value on the HMI and the element to be displayed will be based on a drop down list on the HMI that sets the value of X, which is actually the day of the week. I can do this easily by:

PLC,
IF X=0, MOVE TAG[0] INTO HMI_TAG
IF X=1, MOVE TAG[1] INTO HMI_TAG, etc.

HMI,
Use numeric indicator and connect it to HMI_TAG

However, I would prefer to just use the index X right in the HMI itself:

Numeric indicator connected to TAG[X]

I tried this in the HMI, and it liked the syntax, but it seems like it can't directly evaluate the index and thinks its a new tag.

Does anybody know how to use an expression or macro or something to alow direct connection to an indexed value?
 
I know it wont do it directly in the connection tab, but I was hoping there was some way to set up HMI tags and maybe some macro/scripting to take the index value and use it to repoint the connection links.

I really hope there is some way to do this, otherwise, I am going to have to do 2688 move statements in the PLC to move array values into non array values and change what gets moved according to the index.
 
Last edited:
you should be able to use parameter tags associated with the page, i have not tested this but i have done something similar on SE , you may have to reload your page from a button but try something like this:

X is a HMI Tag set from your dropdown box in the HMI

Use a button to open a page using X as the parameter
Display "HMI Screen" /TX

Then create your display using #1 as your tag reference e.g. TAG[#1]

Hope that makes sense
Ash

----------------------------------------------
Edit:

Just booted up ME & had a look. Using a go to display button & a parameter file should work for you
 
Last edited:
It appears to me that you are looking for a message display screen that is controlled from a single address.

move your x value into an integer and have your message display point to that integer. it will display the message you program for that integer until the value changes.

the only thing you will have to do is program all those messages in.

regards,
james
 
Bad news. It was discontinued. The "Data Access" activeX you want only works in version 6.x
https://rockwellautomation.custhelp.com/app/answers/detail/a_id/31318

You could do like Ash said: parameter files, but you would need 1 parameter file per index number. Then use the Display list selector to open the next display with your message.
If you have 2,000+ to do then that is not a good option.
https://rockwellautomation.custhelp.com/app/answers/detail/a_id/628627


Better to add some ladder logic to do the indexing for you.
The HMI changes the value of IndexTag and the ladder logic copies that into the HMI_TAG
ex. Copy TAG[IndexTag] to HMI_TAG
 
The way I read the post was he has an array of data that contains different information for each day e.g. Tag[1].BottlesFilled, Tag[2].BottlesFilled, etc...

I thought instead of creating the tags & information for each tag in each array he wanted to use one set & change the values depending on the day selected.

If this is this case, you would only need one parameter file to transfer the local tag into #1

Use the day of the week to set the value of the local HMI tag, then open the display with the parameter file.

So create the displays:
Tag[#1].BottlesFilled
Tag[#1].BottlesOverFilled
Tag[#1].BottlesUnderFilled

By changing the value of the tag assigned to #1 in the parameter file then loading the page with that parameter file will work. I've just done something recording the turbidity in each run & storing the data in arrays for each day

Ash
 
I thought instead of creating the tags & information for each tag in each array he wanted to use one set & change the values depending on the day selected.

If this is this case, you would only need one parameter file to transfer the local tag into #1

Use the day of the week to set the value of the local HMI tag, then open the display with the parameter file.

I was distracted by the 2,000+ number.
Yes, if it's just for each day of the week then the parameter files would be no problem; just create seven and it's done.
 
What I am trying to do is bring up the same screen and load it with different data depending on the shift selected.

What I have been trying is using a parameter file:

EX: SHIFT 5 parameter file
#1=5
#2=55

HMI numeric indicator connections

tag1[#1]
tag2[#2]

PLC tags

tag1[array]
tag2[array]

Using a display selector button to load the same display but change the parameter file depending on the shift selected. When I run this, it always throws an error regarding the tags that have parameters in the connections. I can't see what the error is because the screen is not wide enough. I will see if I can find some way to get the error. So, I think I am on the right path, but I am missing something probably minor.
 
I would try this.

1. create the display screen you want and populate it the way you want it AND include an area for the shift. this shift area can be changed by the operator.
2. all of your data fields point to a file. for example n7:0 to n7:54. N7:0 is the shift number. N7:1 to n7:54 is the data registers defined on the screen.
3. use a copy / move statement to send the data based on the shift information in n7:0 to registers n7:1 to n7:54

if n7:0 is 1, copy the associated data to registers n7:1 to n7:54 and so on.

I hope this helps,
james
 
I am trying to avoid moving/copying in the PLC. Way too many of them to do. In any case, I want to learn how to do parameter files in the HMI. Not just for what I am doing now, but also I can see a use for it in the future.
 
Arg. I was doing everything correctly. What I did not realize is that parameter files don't execute in the test environment. Once I downloaded and ran it for real, everything worked.

Thanks for pointing me in the right direction on this.
 

Similar Topics

On the AB PLC-5 (540E) does the the Index Register (S:24) get reset at the beginning of each scan?
Replies
3
Views
4,389
I have upgraded an old RS500 project to Studio 5000, it has thrown multiple errors which I am currently working through. I have looked through...
Replies
8
Views
1,715
Hello guys, I use Tia Portal V16. What is the best way to change the indexed HMI tags when I change the format of an Udt in my plc program...
Replies
0
Views
1,301
Hello, I am doing a PLC5 to 1756 L81 conversion. I have an issue with what looks like an indexed array bit in the PLC 5 that I am unsure of how...
Replies
1
Views
1,267
As per manual i was tested with PLC on below program. But not any changes using swap instruction. plz help
Replies
3
Views
1,982
Back
Top Bottom