AngryRobot

Auto Assign Addresses To Symbols?

7 posts in this topic

Is it possible to allow CX programmer to automatically assign open addresses to the symbols that I create?  It has been a while (over a year) since I've written a program in CX-Programmer, and the last time I used I only programmed with straight addresses.

 

Since then I've grown quite fond of just creating a descriptive tag/symbol and not having to keep track of addresses.  It is especially difficult on this particular project since it is going to be a huge program encompassing several workstations, and I'm not getting the information that I need to program them in any sort of order.  So I can't really set aside specific address blocks for different stations or functions, because I have no clue how many addresses I am actually going to need until I get the info for that station; but I might already be writing the program for the next station in the line.  I just have to use addresses as I need them... it would be a lot easier if I didn't have to worry about remembering them.

Share this post


Link to post
Share on other sites

NOT AUTOMATICALLY that I know of.

The method I use is to copy desired addresses from CX Programmer Symbols and paste into EXCEL.

Edit EXCEL spreadsheet to add/change desired name then paste back into CX Programmer.

A few words of caution:- There is some conflict with WORD and BIT addresses you need to be aware of.

For example CIO Word 0 and CIO Bit 0.0 will both appear as 0 in your spreasheet.

Share this post


Link to post
Share on other sites
21 minutes ago, AngryRobot said:

Is it possible to allow CX programmer to automatically assign open addresses to the symbols that I create?  It has been a while (over a year) since I've written a program in CX-Programmer, and the last time I used I only programmed with straight addresses.

 

Since then I've grown quite fond of just creating a descriptive tag/symbol and not having to keep track of addresses.  It is especially difficult on this particular project since it is going to be a huge program encompassing several workstations, and I'm not getting the information that I need to program them in any sort of order.  So I can't really set aside specific address blocks for different stations or functions, because I have no clue how many addresses I am actually going to need until I get the info for that station; but I might already be writing the program for the next station in the line.  I just have to use addresses as I need them... it would be a lot easier if I didn't have to worry about remembering them.

Yes, it is possible, although I didn't check what PLC model able to do so. At minimum CP1 / CJ Series able to do it.
 

You go to the menu PLC --> Memory Allocation --> Automatic Allocation, there you add the Starting Memory Address and maximum length of auto-allocation.
Afterwards, whenever you create a Symbol, you will see the Auto-Allocated memory assigned to it.

You need to consider the word length of each variable too, because Auto Allocation variable will depend on the symbol type you use.

Share this post


Link to post
Share on other sites
Just now, innoaloe said:

You need to consider the word length of each variable too, because Auto Allocation variable will depend on the symbol type you use.

Can you specify more on this?

Following your instructions I was able to get the auto allocation set up using all of the available W bits as my allocation size.

Share this post


Link to post
Share on other sites
Just now, AngryRobot said:

Can you specify more on this?

Following your instructions I was able to get the auto allocation set up using all of the available W bits as my allocation size.

Let's say you make a Variable with BOOL Type, it means it will automatically occupy one bit. Let's say you start by W0, it will occupy W0.00.
'Say next variable is also a BOOL, it will occupy W0.01

Now let's say the 3rd variable you make is a WORD, it will occupy the entire W1 and ignore the rest of W0.02 - W0.15.
4th variable, let's say it's LREAL, it will occupy 4 Words of W2 ~ W5.

By any chance in ladder on some parts you're using direct address instead of symbols, you need to check whether that address is occupied by the symbol or not.

A good practice for auto-allocation usually is to separate your bit allocation and WORD / longer data allocation.
If you notice, auto-allocation lets you allocate certain memory only for certain type of variable.

So in practice let's say you can allocate W area memory to BOOLs, and then allocate D words for all numbers and strings.

Also keep in mind the PLC will still use the auto-allocated memory for Special IO Units / Functions (let's say like CJ1W-AD081 Unit0 will always occupy D20000) so make sure your auto-allocation doesn't overlap with those.

Edited by innoaloe

Share this post


Link to post
Share on other sites

Well, I might have screwed myself with this.

 

So I set up auto allocation to only allocate the W bits.  That way I can create BOOL symbols as I program and not have to worry about keeping track of the open addresses.  The problem is that this does not actually assign a W bit to the symbol on the Symbols table.  It shows ups as W0.00[Auto].  In CX-Programmer that seems to work just fine because I can enter W0.00 or Test_Symbol_Name and it associates with the correct symbol.  When I copy the symbols table into Excel though it does not copy the auto allocated addresses.  That also means it does not copy the address when I past the table into my CX Designer project.

 

I might be going back and hard coding in addresses for a lot of symbols. 

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