is it possible to embed a python console for debug in gladevcp?

More
04 Aug 2020 09:39 #177205 by Gorgc
Is it possible to open a python console when I debug so that I can view the python variables in the running program?
thx

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

More
04 Aug 2020 13:45 #177246 by cmorley
Can you show an example of what you mean?
If there is a library to do it in python, then it should be possible.

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

More
04 Aug 2020 21:58 #177292 by cmorley

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

More
05 Aug 2020 00:30 #177319 by Gorgc
someone told me that i could use jupiter qtconsole to create a console window, but he didnt give any details . i tried but it just doesnt work with linuxcnc.I guess it is just not connected to linuxcnc. I will take a closer look at this example.thank you very much.

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

More
05 Aug 2020 02:06 #177336 by Grotius
Hi,

Is it possible to open a python console when I debug so that I can view the python variables in the running program?

I am not good at Python, but this is a kind of debug text output to terminal when lcnc is running, maybe its handy info for you :

#encoder internal / external
read_encoder = "ethercat -p {0}".format(self.widgets.slave_position.get_text()) + " upload --type uint8 0x8012 0x08"
encoder = subprocess.check_output(read_encoder, shell=True)
print(encoder)
self.widgets.encoder_label.set_text(encoder)

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

More
05 Aug 2020 06:21 - 05 Aug 2020 06:22 #177350 by Gorgc
hi everyone thx for reply

i tried code.interactive, it works , but the process is blocked when console is open. when you enter ctrl+d, program continues to run.

i think this is close.I know that someone had the idea to debug or operate remotely before, but I haven't found a suitable example. It seems that I still need to explore a bit more.
I plan to use python+c mixed programming for all c++ classes on my control side, including a non-real-time control manager. With this console, I can monitor the variables of each module in the real-time thread, or directly control the robot by operating the manager. The on-site engineer can debug the robot by himself through the console, and python visu interface is also complete. Many goals were accomplished in one go!
Last edit: 05 Aug 2020 06:22 by Gorgc.

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

More
05 Aug 2020 14:35 #177392 by cmorley
you might look at ipython too - Wikipedia claims it can interact with pygtk

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

Moderators: mhaberlerHansU
Time to create page: 0.104 seconds
Powered by Kunena Forum