Yung_Craig

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

9 posts in this topic

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.

Share this post


Link to post
Share on other sites

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

 

Edited by Gambit

Share this post


Link to post
Share on other sites

Hi

I agree with Gambit. But if you must change it than you should test the Batch replace function.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Which sofware are you using and which editor ?

Share this post


Link to post
Share on other sites
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. 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

1 person likes this

Share this post


Link to post
Share on other sites

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
1 person likes this

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