jlaird0415

GX Work2 Comments in Arrays

5 posts in this topic

I am very new to the Mitsubishi PLC world (I have a lot of experience with A/B and Omron though).  I am having an issue trying to assign comments to an array of Globally scoped bits - I am also using Structured Ladder - NOT simple ladder.  Is it possible to do this?  I have contacted there tech support group and they were of little help.  I don't care if I update the label comment or the device comment, I just want to assign a simple comment that can be displayed (i.e. I am using this for step sequences).

 

Any help would be greatly appreciated!

 

Share this post


Link to post
Share on other sites

You cannot assign comments inside the array (e.g. arrayName[0] = no comment, arrayName[9] = no comment). However arrayName = comment.

I think you are asking for number 1. Why would you assign names to elements inside the array? Why would you like to have different comments on different array elements? The point of arrays are exactly to have one uniform collection of devices that end up in the variable name "arrayName"... If you assign a comment for the "header" of the array this comment (the comment of the header) will show up everywhere in your code even if you use arrayName[0].

If you want the comment to show as a tooltip, go to "Tool->Options" then open "Program Editor->Structured Ladder/FBD/ST/IL->ToolHint". There you can setup which tooltips are displayed when you hover the mouse over a variable name.

ToolHint.png

Share this post


Link to post
Share on other sites

I was just searching for this feature, though I'm using GX Works 3. Not sure if there's been any change, but so far I can't find it.

Here's why I want to do this. I created a global array of bits for alarms, and was hoping to add a comment to each bit in the array to describe what that particular alarm is for. I supposed I can create individual alarm bits and then just make sure they're in a contiguous memory area, but I thought this would be easier.

Share this post


Link to post
Share on other sites

For arrays this won't work. However, if you "must" have comments on each one like you describe and you would like to group them, why not create a "Structured Data Type"? Then you can work with an unassigned "collection" of bits combined. use the SDT in Global List and assign a specific variable to the first element in the SDT and it will populate the rest. I've made a simple screenshot containing several windows, I'll explain below:

  1. Lower left corner: The SDT/DUT specification (bLabel0_0 and so on - these are "inside" the array or collection)
  2. Upper center (all the way): Defined the SDT in Global Labels
  3. Right center: Specified M0 as the first device, all others populate automatically.

Doable?

 

dut.PNG

Share this post


Link to post
Share on other sites

That works too. I decided to just create a new global label file just for alarms and generated the list in Excel and copied it in.

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