Sign in to follow this  
Followers 0
lostcontrol

Adding Comments to Array Variables

6 posts in this topic

If I declare a 10 element array, starting at say D100 called xyz, then I can add a comment to D100. If I use D102 in my program, then even though I have not added a symbol to D102, then the symbol xyz[2] is automatically added. No problems with this. This issue I have, is that if I add D102 to my symbol table, the array symbol takes precedence, and the comment I have added is not displayed in the program. If I add a comment to the declared array variable, in this case xyz[0], wherever this appears, the same description is present all throughout the code. So, is there something that I have overlooked, or is there somewhere I should be looking to find this missing symbol description? Edited by lostcontrol

Share this post


Link to post
Share on other sites
If you add the symbol for D102 to the program symbol table instead of the global symbol table, it will take precedence and display the way you want it to.

Share this post


Link to post
Share on other sites
Ok, that is correct. So that then means I have to add the symbol in 2x places, and I still cannot add individual descriptions to each array element. The reason for the array, is I am indexing through this array in another section in ST, and you need to have the symbol declared as address's cannot be accessed in ST.... My method was to declare the array, then use this address through the program, both ladder & ST. I guess as I add the ladder, i can create the new symbol as I go, and then point it to the required address, and add the correct description. Would be a nice feature to be able to see what each element in the array is though...

Share this post


Link to post
Share on other sites
Interesting. I was at a seminar on FBs and ST yesterday at Omron. We covered arrays but this was not mentioned.

Share this post


Link to post
Share on other sites
Does that mean that Bob may be coming round to FB's & ST??? Did they go over SFC as well? It is my understanding that the next version of CX-P will allow UDT's also. I am not sure whether this is also going to be hardware specific, or the latest CJ2's will handle it. I think they must be going to true tag-based addressing. I wonder if they will ever go to the graphical FB style.

Share this post


Link to post
Share on other sites
Lets not get too excited! I can see uses in some of my projects for FBs written with ST for 'fiddling' with data from devices. J1939 is an absolute pain - number, divisor and offset. Lots of floating point to get an answer - lots of turning numbers into floats and quite often FIX or FIXL back. Really good for that. Absolute pain for digital though - use ladder - seminar leader agreed. Could also be useful for standard comms routines etc. No. we did not cover SFC. I dislike it immensely and it is SOOO memory hungry it is not funny! Good if you are dealing with mechanical people I guess as they understand flow charts - I still get into trouble with the darn things. My mind does not work that way - it is much more 'free form' and probably 'undisciplined' to the extreme. The next version does include several new data types but they were not explained. You are probably correct. Supposed to make programming much easier also - I will not know how until I get it I guess. Graphical FB style? True tag based addressing - I hope they NEVER stop us using numbers. I was brought up with number addressing and still use it. Dislike tag addressing - can never remember what I called the things - can remember the numbers though. Just thankful we do not have to type in %I, %Q and all that sort of nonsense. Have you ever tried to program a Twido with addresses like %I.10.20.05 - probably not got it right but that is the way you have to address certain areas in the bloody software. Gave them away after 2 attempts.

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