How to display the value of the int variable from the hal_parport.c file in the

More
05 Sep 2023 11:44 #279946 by drzasiek90
Hi, I'm compiling my own version of LinuxCNC and making some changes to the
hal_parport.c
file. I would like to be able to display the value of a variable in the Axis panel in a way similar to how spindle speed is displayed using a HAL pin. Can someone guide me on how to achieve this?

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

More
05 Sep 2023 12:45 #279960 by cornholio
You may want to elaborate a little more.
What variable ?
Where is coming from ?

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

More
05 Sep 2023 14:34 #279979 by andypugh
Maybe create a new HAL pin or parameter and set the value of it inside your new comp.

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

More
06 Sep 2023 05:23 #280054 by drzasiek90
I create a global variable in the source file that takes certain values in certain situations. I compile linuxcnc and run. I would like to be able to view the value of this variable while the program is running.

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

More
06 Sep 2023 08:09 - 06 Sep 2023 08:09 #280067 by andypugh
Create your variable in the HAL structure and assign it to a parameter (you can copy the structure of the other pins / params)
Then you can use the existing HAL tools to monitor the value, including displaying it in GUIs.
Last edit: 06 Sep 2023 08:09 by andypugh.

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

More
06 Sep 2023 09:40 #280078 by drzasiek90
No, I've already done it.
I am able to view the parameter in tools.
However, I would like to display this value permanently, but using pycvp it is probably not possible - so far I have not succeeded.
Using pyvcp I am successfully displaying the hal pins but the hal parameters are not working.

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

More
06 Sep 2023 10:18 #280081 by cornholio
Oh ok, you want to modify Axis to display the value ?

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

More
06 Sep 2023 10:44 #280083 by andypugh

Using pyvcp I am successfully displaying the hal pins but the hal parameters are not working.

PyVCP can only display items that can be "net"-ed to the PyVCP pins in HAL. So you will need to create the variable as a pin, not as a parameter. 
(Which means that it needs to be part of the hal_malloc data and needs to be a pointer to a pointer) 
 

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

More
06 Sep 2023 10:44 #280084 by drzasiek90
If necessary.
However, I'd prefer to do without modification by adding a panel via pyvcp.
I am looking for a simple method so that it is easy to replicate.

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

Time to create page: 0.081 seconds
Powered by Kunena Forum