Modbus Examples?

More
21 May 2013 15:35 - 21 May 2013 15:36 #34488 by bigalex
Replied by bigalex on topic Modbus Examples?
Hi ArcEye.

I did :

sudo apt-get install libxmu-headers

But I still had xmu problems.
So I did:

sudo apt-get install libxmu-dev

and then

make
make install-menus
sudo make setuid

and everything seems to finish without errors.
So I did :

. ./scripts/rip-environment
linuxcnc

and start a configuration and I see 2.6-pre but the start procedure fails and now I have this:

cnc@cnc-desktop:~/linuxcnc-dev$ . ./scripts/rip-environment
cnc@cnc-desktop:~/linuxcnc-dev$ linuxcnc
LINUXCNC - 2.6.0~pre
Machine configuration directory is '/home/cnc/linuxcnc/configs/sim/gscreen_custom-1'
Machine configuration file is 'industrial_lathe.ini'
Starting LinuxCNC...
/home/cnc/linuxcnc-dev/scripts/realtime: line 159: /home/cnc/linuxcnc-dev/bin/linuxcnc_module_helper: Permission denied
Realtime system did not load
Shutting down and cleaning up LinuxCNC...
RTAPI: ERROR: could not open shared memory (errno=2)
/home/cnc/linuxcnc-dev/scripts/linuxcnc: riga 437: 22034 Errore di segmentazione $HALCMD stop
RTAPI: ERROR: could not open shared memory (errno=2)
/home/cnc/linuxcnc-dev/scripts/linuxcnc: riga 437: 22035 Errore di segmentazione $HALCMD unload all
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
/home/cnc/linuxcnc-dev/scripts/realtime: line 192: /home/cnc/linuxcnc-dev/bin/linuxcnc_module_helper: Permission denied
/home/cnc/linuxcnc-dev/scripts/realtime: line 192: /home/cnc/linuxcnc-dev/bin/linuxcnc_module_helper: Permission denied
/home/cnc/linuxcnc-dev/scripts/realtime: line 192: /home/cnc/linuxcnc-dev/bin/linuxcnc_module_helper: Permission denied
/home/cnc/linuxcnc-dev/scripts/realtime: line 192: /home/cnc/linuxcnc-dev/bin/linuxcnc_module_helper: Permission denied
/home/cnc/linuxcnc-dev/scripts/realtime: line 192: /home/cnc/linuxcnc-dev/bin/linuxcnc_module_helper: Permission denied
/home/cnc/linuxcnc-dev/scripts/realtime: line 192: /home/cnc/linuxcnc-dev/bin/linuxcnc_module_helper: Permission denied
/home/cnc/linuxcnc-dev/scripts/realtime: line 192: /home/cnc/linuxcnc-dev/bin/linuxcnc_module_helper: Permission denied
Cleanup done
LinuxCNC terminated with an error. You can find more information in the log:
/home/cnc/linuxcnc_debug.txt
and
/home/cnc/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal


File Attachment:

File Name: linuxcnc_debug.txt
File Size:0 KB


File Attachment:

File Name: linuxcnc_print.txt
File Size:1 KB


bigalex :blink:
Attachments:
Last edit: 21 May 2013 15:36 by bigalex.

Please Log in or Create an account to join the conversation.

More
21 May 2013 18:11 #34493 by ArcEye
Replied by ArcEye on topic Modbus Examples?
It appears that the problem is to do with permissions.

You have built in you home folder using sudo, I always build in /usr/src as root and never have these problems

You need to look at your build and its permissions, specifically who is the owner of the files and what they are set to.
ls -l

Then change them

man chown
man chmod

Please Log in or Create an account to join the conversation.

More
21 May 2013 19:33 - 21 May 2013 19:35 #34494 by bigalex
Replied by bigalex on topic Modbus Examples?
Hi .
I checked out the "owner" of the linuxcnc-dev folder and subfolders and it is root.
I did the make and install operation with sudo.
If I try to run from /linuxcnc-dev/ with

. ./scripts/rip-environment
linuxcnc

I have the messages that I shown you before.
If I run with:

sudo linuxcnc

It is running the version installed from buildbot.

Do I have to change the "owner" of the entire linuxcnc-dev folder to the user I am (cnc) ?

bigalex :blink:
Last edit: 21 May 2013 19:35 by bigalex.

Please Log in or Create an account to join the conversation.

More
21 May 2013 20:00 #34495 by ArcEye
Replied by ArcEye on topic Modbus Examples?
Assuming your user name is alex

sudo chown -R alex:alex /home/alex should do it, you should be the owner of your own folder anyway

Do a ls -l afterwards to check it changed and try again.

Please Log in or Create an account to join the conversation.

More
21 May 2013 20:38 #34496 by bigalex
Replied by bigalex on topic Modbus Examples?
Hi.

I did as you told me.
I checked out the owner changed properly.
I still have the same result.

cnc@cnc-desktop:~/linuxcnc-dev$ linuxcnc
LINUXCNC - 2.6.0~pre
Machine configuration directory is '/home/cnc/linuxcnc/configs/sim/Glade2Gcode'
Machine configuration file is 'glade2gcode.ini'
Starting LinuxCNC...
module_helper is not setuid root
Realtime system did not load
Shutting down and cleaning up LinuxCNC...
RTAPI: ERROR: could not open shared memory (errno=2)
/home/cnc/linuxcnc-dev/scripts/linuxcnc: riga 437: 1244 Errore di segmentazione $HALCMD stop
RTAPI: ERROR: could not open shared memory (errno=2)
/home/cnc/linuxcnc-dev/scripts/linuxcnc: riga 437: 1245 Errore di segmentazione $HALCMD unload all
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
RTAPI: ERROR: could not open shared memory (errno=2)
module_helper is not setuid root
module_helper is not setuid root
module_helper is not setuid root
module_helper is not setuid root
module_helper is not setuid root
module_helper is not setuid root
module_helper is not setuid root
Cleanup done
LinuxCNC terminated with an error. You can find more information in the log:
/home/cnc/linuxcnc_debug.txt
and
/home/cnc/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal


can the problem be related to this :

Starting LinuxCNC...
module_helper is not setuid root
Realtime system did not load

in case it is I don't know how to proceed.
I'm so sorry ..... the situation from my point of view it is difficult to understand.
So if you can , please be patient.

bigalex :blink:

Please Log in or Create an account to join the conversation.

More
21 May 2013 20:46 #34498 by andypugh
Replied by andypugh on topic Modbus Examples?
It looks like the sudo make setuid stage of the build process didn't work

I suggest simply trying it again. You will need to type your password.

Please Log in or Create an account to join the conversation.

More
21 May 2013 21:06 #34499 by bigalex
Replied by bigalex on topic Modbus Examples?
Hi.
As you said I did:

cd src
sudo make setuid

and finally at the end of this endless story .................. it works !!! :woohoo:
I don't know how and I don't know when but I hope to return to you and Andy and all the people
in this forum the contribute that you gave me.
T H A N K --- Y O U ! ! !

bigalex :blink:

P.S. I read the thread about Saving Parameters After Shut Down and I have to say that it is very a interesting option
to the Andy solution proposed using GladeVCP (I'm still testing it).

Please Log in or Create an account to join the conversation.

More
21 May 2013 21:19 #34501 by ArcEye
Replied by ArcEye on topic Modbus Examples?
Hi

Glad you are now sorted, you will find it easy next time B)

I was doing other things, thankfully Andy was available.

All that happened was that you undid the setting made by make setuid when you ran chmod, so running it again sorted it out.

P.S. I read the thread about Saving Parameters After Shut Down and I have to say that it is very a interesting option
to the Andy solution proposed using GladeVCP (I'm still testing it).


It's not really an alternative, because it doesn't provide a way to dynamically change anything or to use hal pin data in GCode, just capture a state and re-load it.
But you may find a complementary use for it.

regards

Please Log in or Create an account to join the conversation.

More
04 Jun 2013 21:25 #35255 by VNR
Replied by VNR on topic Modbus Examples?
Hello,

first of all, i apologize my time out of the community, since my fourth baby is comming, i am running out of time.

One question .... I understood that mb2hal is a hal component isn't it ?
Why it is not possible install it in a simplest way ?


mb2hal is a component only available in 2.6, I assume it either uses features not available in 2.5 or it is considered so experimental that it is not in a mainstream distribution.
Once you have compiled Linuxcnc you will have built mb2hal also, so keep at it


I have written the mb2hal driver, and Yes, it is experimental. I mean it is working for me, but i don't know anybody who has used it too. Nobody has reported a bug nor asked a direct question to me. Also it was created after the stable 2.5 branch was closed.

If somebody have a problem trying to configure it or have found a bug, please contact me, i will try to fix it as soon as possible.

Regards,
Victor
The following user(s) said Thank You: bigalex, Todd Zuercher

Please Log in or Create an account to join the conversation.

More
04 Jun 2013 21:59 - 04 Jun 2013 22:36 #35256 by bigalex
Replied by bigalex on topic Modbus Examples?
Hi Victor.
Nice to meet you ....
I finally downloaded and installed from the git the 2.6 pre of LCNC and I'm trying to make some tests with your component .
Your component seems to be really flexible and virtually "unlimited" as per transactions number isn't it ?
Because it is a user space component did you have any performance feedback on the comunication transactions ?
The write modbus functions are performed only on data change ?
If I want a data read/write from/to a modbus slave how is managed the communication ?
I mean as should be non simultaneous read/write operations on the same slave are allowed isn't it ?

Thank you.

bigalex :blink:
Last edit: 04 Jun 2013 22:36 by bigalex.

Please Log in or Create an account to join the conversation.

Time to create page: 0.356 seconds
Powered by Kunena Forum