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

  1. Acke Chau
  2. PLCnext Technology & PLCnext Controls
  3. Wednesday, 13 December 2017

Hi,

Try to create a folder in /usr/local but get Permission Denied with Error Code3.

The current user is a admin, do I need to have root access?

The hardware is a release version

Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi Acke,

You can see from the "ls -l" command that the owner of the local directory is "root", and that only the owner has write permissions for that directory.

You will need to either log in as root, or else change the permissions on that folder using the "chmod" command, and/or change the groups that the admin user belongs to, in order to create a file in this directory.

Hope this helps.

- Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

Vincent PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi Acke,

 

Just out of curiosity, what are you trying to achieve by writing into /usr/local? As it sound like your trying to install something in there. My advice would be to use /op/plcnext folder. as this way, you keep your OS, more tidy, and group your own application (and it's dependencies) nicely, and clearly can differentiate (later on) what is OS, runtime +libraries, and what was added by you.

 

Kind regards,

Vincent

Phoenix Contact Netherlands - Technical Consultant

Acke Chau Accepted Answer Pending Moderation
0
Votes
Undo

Hi all,

Thanks for your reply. Yeah Vincent, you got me.

I'm try to run the "small modbus example" in my PLC but without success.

I have add the includes/libs in the project. 

 

After rebuild and no errors I have exported MyLibrary.pcwlx and added to my PLC project.

I have also downloaded my so files to  /op/plcnext/Modbus/lib to my PLC.

Restarted and I got this error in my PLC logfile. (the full logfile is attached in the post)

14.12.17 20:57:37.735 Arp.System.Acf.Internal.Sm.ComponentsController ERROR - Exception occurs while setting up config of component 'Arp.Plc.Plm': Load: Loading of the library '/opt/plcnext/shadowing/libMyLibrary.so' failed with error code libmodbus.so.5: cannot open shared object file: No such file or directory. (Arp::Exception)

Seems I have missed some steps. Probably tell the AXC2152 where I have put the libmodbus.so files. Any suggestions?

Attachments (1)
Peer PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi Acke.

If you copy your ".so" files into "/usr/local" or to a other directory, you have to tell the Linuxsystem how to find them. This can be done by editing the "ld.so.conf" in "/etc" directory. But you need root.

Vincent, i am with you. From the perspective of user-rights the "/opt/plcnext" is easy. But we thought, that every dependency of the userapplication is easyer to find in "/usr/local". thats more Linux style we think. Correct me if it is not :-).

Hope my description is ok.

Peer

 

Oliver PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Hey,

I think you can place the libmodbus into "/opt/plcnext/projects/Default/lib".
You might have to recompile the Lib from source because many things in the SDK changed since EA3....

Also make sure while copying the Files to the PLC that  "libmodbus.so.5" is still a Link to the actual file. (might be lost if you copied and unzipped in a Windows OS....)
Otherwise it will not work out.
Check with "ls -l" to see if everything is correct.
It should look like this:

Phoenix Contact Electronics Headquarter - PLCnext Runtime Product Management and Support

Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo

Also note that wherever the libmodbus.* files are located - e,g, "/opt/plcnext/projects/Default/Libs" - you need to make sure that:

  1. the path to the library files is listed in the "/etc/ld.so.conf" file, and
  2. after adding the path to ld.so.conf, run the ldconfig command to update the dynamic loader cache.

- Martin.

Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support

  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.