How to change MOV source destinations dynamically?

instruward

Member
Join Date
Jul 2019
Location
Prairies
Posts
27
I apologize, I don't know how to word my question properly.

See code snippet for reference: https://imgur.com/a/yPOohZ9

I have an old panelview PB32 program I'm trying to covert over to FactoryTalk. There is a 20 character product code that I need to convert in the PLC so my new HMI can read it.

Currently it stores the characters in N240:20 through N240:29 (for product code #1), for a total of 20 characters. I found some example code online to convert that over to a ST (string) data file.

I am trying to figure out if I can make the attached code be reused for all product codes (over 30).

Like if product 1 name sourced from N240:20 through N240:29, and the destination is ST9:0.DATA[0].

How I can make the attached code's MOV references switch to N240:60 through N240:69, and ST9:1.DATA[0] for product code #2.
 
I think what you're looking for is indirect addressing.


For example, assuming recipe 0 is stored in N240:60, recipe 1 is stored in N240:61, and so on...recipe 9 is stored in N240:69.


In some other register - say, N7:0, you have the required recipe number. E.g. if you need recipe 6, then N7:0 = 6.

You need to add 60 to get it into the correct range (because your recipes start at N240:60, not N240:0), so ADD N7:0 plus 60 store result in N7:1. Now N7:1 = 66.

Then your syntax for the MOV source is N240:[N7:1]. If N7:1 = 66, then the source will be evaluated as N240:66.

Disclaimer: it's been a long time since I did indirect addressing on the Logix 500 platform. I have a vague memory that you might need to precede the indirect address with a # symbol or similar on that platform. In any case, if what I'm describing is what you're after, search for "indirect addressing" and you'll find plenty of information on the subject, now that you have the right keywords (y)
 
Yes exactly, thank you. Indirect addressing.

So yea the confusing part is that 1 product name spans N240:60 to N240:69.
The old panelview HMI read the data in as a character array.

I've figured out how to concatenate the data into 1 string file per product code.

I obviously need to do some reading, I've been trying to use the MOV function with the destination of ST9:#[N7:93].DATA[0]. But it doesn't like me inserting #[N7:93] there, not sure yet what I am doing wrong.
 
Yes exactly, thank you. Indirect addressing.

So yea the confusing part is that 1 product name spans N240:60 to N240:69.
The old panelview HMI read the data in as a character array.

I've figured out how to concatenate the data into 1 string file per product code.

I obviously need to do some reading, I've been trying to use the MOV function with the destination of ST9:#[N7:93].DATA[0]. But it doesn't like me inserting #[N7:93] there, not sure yet what I am doing wrong.

in this manual it says "You cannot use indirect addressing with: S, ST, ... files" - that is MicroLogix 1100 though, so maybe that limitation is not applicable to your hardware?

update: ML 1400 manual does not have that constraint for ST ...
 
Last edited:

Similar Topics

Hi. I can usually change the source value on these mov instructions but here in this particular one with the Blue arrow makers I can not, even...
Replies
9
Views
3,360
Hoping someone can give me some guidance or confirmation of what I need to do. We have a FactoryTalk SE program that I need to change the IP...
Replies
0
Views
26
Hey all, i have a panelview screen (image attached), with 4 items on it. Program 1, Program 2, ...3, ...4. The PLC i am using is a compactlogix...
Replies
5
Views
166
Greetings I have a problem, my system is the following: wincc v8.0 (demo), logo8.3, abb m2m analyzer. I created some pages to display the...
Replies
0
Views
61
We had one go down. we have a new one. Their emergency Number don't work. The Model is TLSA046AAH-330N01-007 A catalog says we need software TET...
Replies
2
Views
168
Back
Top Bottom