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

  • drzasiek90
  • Topic Author
  • New Member
  • New Member
More
3 years 1 month ago #279946 by drzasiek90
Hi, I'm compiling my own version of LinuxCNC and making some changes to the
Code:
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 to join the conversation.

More
3 years 1 month ago #279960 by Cant do this anymore bye all
You may want to elaborate a little more.
What variable ?
Where is coming from ?

Please Log in to join the conversation.

More
3 years 1 month ago #279979 by andypugh
Maybe create a new HAL pin or parameter and set the value of it inside your new comp.

Please Log in to join the conversation.

  • drzasiek90
  • Topic Author
  • New Member
  • New Member
More
3 years 1 month ago #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 to join the conversation.

More
3 years 1 month ago #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.

Please Log in to join the conversation.

  • drzasiek90
  • Topic Author
  • New Member
  • New Member
More
3 years 1 month ago #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 to join the conversation.

More
3 years 1 month ago #280081 by Cant do this anymore bye all
Oh ok, you want to modify Axis to display the value ?

Please Log in to join the conversation.

More
3 years 1 month ago #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 to join the conversation.

  • drzasiek90
  • Topic Author
  • New Member
  • New Member
More
3 years 1 month ago #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 to join the conversation.

Time to create page: 0.091 seconds
Powered by Kunena Forum