Sign in to follow this  
Followers 0
ARCDaw

Step 7 STL dynamic array

2 posts in this topic

Hi everyone!
I have a problem in STL (using step 7 V5.5 + SP3 version).
Every second I need to read the actual input value and store it in specified memory (MW 2204, MW 2206, ... MW 2222).
After 10 seconds (10 values should be in the memory) I have to do an average of them. 
And my question is: how to place this 10 input values in this memory?
 

Share this post


Link to post
Share on other sites

Hello Arcadaw,

I don't know if you already figured out this, but you can do this by using indirect address, but you may probably need to store this data in to a DB instead of a memory M location, if you are not familiar with indirect addressing, you can do this with a counter, and a positive edge logic, see example

A 1second_pulse

FP Temp_bool

= Temp_bool2

JNB  exit_1

L 0

L counter

==I

JNB Next_memory

L IW 10

T MW2204

JU exit_a

Next_memory: nop 0

L 1

L counter

==I

JNB Next_memory2

L IW 10

T MW2206

JU exit_a

.. copy code for number of data memories

 

exit_a: nop 0

L 1

L counter

+I

T counter

L counter

L maximum_number_of data_reached

==I

L 0

T counter

exit_1: nop 0

 

 

 

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