Sign in to follow this  
Followers 0
pete3589

Indirect Addressing Revisited

2 posts in this topic

I am also having a similar issue with Indirect addressing as described in this thread: http://forums.mrplc.com/index.php?showtopic=11766 Unfortunately, I come from an AB background and am very used to using imbedded variables (i.e. AnalogInput[x].Value) to perform many of my tasks. I need to move 3 tags from my AnalogInputs[x] array (there are 96 elements) to TaglistData[x] array but only if AnalogInputs[x].OnOff is on. I am pretty good with ladder logic, but I really don't understand STL language that well yet. In RSLogix 5000, the code would look something like this (in text) y=0 For x = 0 to 96 IF AnalogInputs[x].OnOff then TaglistData[y].Value =: AnalogInputs[x].Value .... .... y = y+1 end if end for; I have my arrays created in DB blocks. I am guessing I need to use the memory location in the DB for the first BOOL in question and then simply add the offset to the next BOOL and continue looping this until I check all of the available values I need. Or an easier way would be if I can use imbedded tags like in the above example, but I don't think Siemens has this capability. Any help would be appreciated.

Share this post


Link to post
Share on other sites
Hi pete. The code you posted is made with IEC61131-3 ST (Structured Text). The language called SCL on the STEP7 platform just happens to be the same as IEC61131-3 ST as well. You can thus port your code seamlessly between these two platforms. If you dont have STEP7 SCL already, then I recommend that you either purchase the SCL option, or maybe better upgrade STEP7 BASIS to STEP7 PRO. The latter contains S7-PLCSIM, S7-GRAPH and S7-SCL. What you want to do is still possible with STL, but SCL is a factor 100 more productive than STL when programming such things as indirect addressing and array manipulation.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0