Store PLCnext CommunityPLCnext on LinkedInPLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

  1. Dan Clark
  2. PLCnext Technology & PLCnext Controls
  3. Thursday, 04 June 2020

Hello,

I have a project built in Eclipse and I want to change the name of the library, and the program.

Any help would be greatly appreciated!

Accepted Answer
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi Dan,

You mention three different parts of a PLCnext C++ project:

  • Library
  • Component
  • Program

... so we can discuss how to rename each of these:

Component class or Program class

To rename the Component class or Program class, simply search and replace the class name in the .cpp and .hpp files in the src directory.

Note that each program class holds a reference to a component, so don't forget this when renaming the component class.

Library

To change the name of the .pcwlx library that is generated by a plcncli (Eclipse) project, search and replace the name of the project's namespace in the .cpp and .hpp files in the src directory.
Make sure you change the namespace name:

  • In the "namespace" declaration at the top of the files,
  • Wherever the namespace name is used as a scope qualifier in the code,
  • Wherever the namespace name is used as a scope qualifier in the special comments that start with //# .

Then, when you rebuild the project, the .pcwlx file will be generated with the new library name.

IMPORTANT: simply renaming the .pcwlx file on the file system should not be done, and will cause problems with PLCnext Engineer. 

 

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support


There are replies in this post but you are not allowed to view the replies from this post.