Sign in to follow this  
Followers 0
Guest Ofir

Programming help. (LD)

4 posts in this topic

Hi, Im new to this language, so sorry for the "newbie" question . Anyway, I need to read 20-30 Analog inputs. every input should be sampled, and manupilate a Power supply (this project charges/discharge a battery (40v, made of 20 cells). every cell should be sampled, and with timer i should check that the voltage is ok for the time of charge. if there is a problem or the voltage not ok, disconnect the cell (by a relay). so, the code is quite long... and i can't just copy,past and change the input/output parameters for each cell. i need a methood to increase the address of the input and corresponding output for each cell. Let's say i start with %AI0001 . the relay is on %G00001 . i need to increase by one each time the address. And ofcourse, each timer have it's own address.. so i need to incease each timer by 3 (as i remember). Any help will be great . Ofir.

Share this post


Link to post
Share on other sites
If you're working with a 90-70 or a PAC sytstems PLC, you can do indirect addressing. Replace the '%' symbol with the '@' symbol in the address for indirect. If you're using a 90-3, take a look at the ARRAY_SEARCH and ARRAY_MOVE instructions and see if they can't help you accomplish what you need to do. Aother overlooked feature of the programming software is its ability to select the next available address for each memory type. Take the analog inputs for an example. If you haven't used any %AI addresses in your program, when you're addressing an instruction, just type '%AI' instead of '%AI001'. The software keeps a pointer for the highest used address for each memory type, and it will select %AI001. The next time you do it, the software will bump the address to %AI002 for you. If you use the same trick when programming timers or counters, the software will automatically bump the %R address by three.

Share this post


Link to post
Share on other sites
Hi steve, I forgot to mention that im working with 90-30 (and versaPro ofcourse). About the second part of your message - The problem is not to copy&past and change parameters, Or if the program will do it for me. the problem is That i need to save memory space... i dont think the whole program will fit into the memory of the PLC. About the ARRAY_MOVE/SEARCH .. im not familiar With this command but i'll look into it later. Ofir.

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