Jump to content

Best way to convert a ladder program with labels to one that uses the device


Recommended Posts

Posted

Hello! I am looking to convert a program that uses labels to one that just uses the device (D100, M100, etc.) so that maintenance can read it better. My current solution is to put all the labels and their data types in an excel file, assign them a new address, then replace them in the program 1 by 1. This sounds very tedious, so I was wondering if anyone has any better methods I can use or if there are flaws in the method I am planning on doing.

Posted
5 hours ago, Gambit said:

Why don't you just show both or use device display if you're using simple mode

 

Using the device display still doesn't show the information I would like to see, such as what kind of data type it is/which register its stored (such as if it is an L or M bit, or if its timer or a counter etc.). Our maintenance team has expressed that they can debug programs faster when they see all that immediately.

Posted
24 minutes ago, Gambit said:

Which sofware are you using and which editor ?

I am using GXWorks3 to edit the program for an iQ-R CPU. I am realizing now that you can specify a device to a variable name, and after doing that you can use your method to see both the device and the variable name. 

Posted

I'm using names all the time and try not to use hardware addresses. But good names are important. Combining discribing names and prefixes are important. 

Here ara the prefixes I use.

Prefix.png

Posted

I despise prefixes on variable names (aka "Hungarian notation".) Unnecessary clutter if the variable name is properly descriptive.  One of Microsoft's [expletives] in the programming world.

  • Like 1
Posted

I do use prefixes on mine, but only the ones below, I don't put in data type at all...  This is so when I sort the variable list alphabetically they all group together...

  • I_ for physical inputs
  • O_ for physical outputs
  • HMI_ for data coming from the HMI (buttons, inputs, etc)
  • SI_ for safety inputs
  • SO_ for safety outputs
  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...