how to create a link Button help me please !!
- Raen
- Offline
- New Member
- Posts: 13
- Thank you received: 0
thanx a lot....
Please Log in or Create an account to join the conversation.
- Raen
- Offline
- New Member
- Posts: 13
- Thank you received: 0
can someone help me? how to build this ??
i've already configure this all things :
STEP 1
make a int.xml file --> place at the same place with the axis_mm.ini file
<pyvcp>
<button>
<text>"program"</text>
<halpin>"program"</halpin>
</button>
</pyvcp>
STEP 2
make a intpostgui.hal file --> place at the same place with the axis_mm.ini file
net btn1 halui.mdi-command-00 <= pyvcp.program
STEP 3
configure the axis_mm.ini
[DISPLAY]
pyvcp = int.xml
[HAL]
HALUI = halui
add section:
[HALUI]
MDI_COMMAND = M101
STEP 4
make a M101 file (already setting execute file) --> place at a NC_files
#!bin/bash
# file to turn on paraport pin 14 to open the collet closer
halcmd setp parport.0.pin-14-out True
exit 0
is there anything WRONG or INCOMPLETE at this STEP ??
please explain me step by step...... >.<
i want to create a button at EMC2-Axis (Axis_mm.ini) and the button can execute my "program.py"
please someone help me......
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23558
- Thank you received: 4858
It is no good expecting an example that shows how to open a collet closer using a parallel port to magically run your python code. You need to understand what that file is doing, and modify it to do what you want (in this case to run your python program)
Please Log in or Create an account to join the conversation.
- Raen
- Offline
- New Member
- Posts: 13
- Thank you received: 0
1. net btn1 halui.mdi-command-00 <= pyvcp.program
2. M101 file --> placed at nc_files
#!bin/sh
why i still cant link the button to my "program.py" ?
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23558
- Thank you received: 4858
what is a relationship between this section :
1. net btn1 halui.mdi-command-00 <= pyvcp.program
2. M101 file --> placed at nc_files
#!bin/sh
why i still cant link the button to my "program.py" ?
There is still nowhere in the chain anything which links to your program.py file.
The confusion might be because the HAL pin which changes state when you press the button is called "program", but that does not in any way link it to the python file of the same name.
Please read these links, in this order, but don't just take the examples and use them, all you need is a read-through to get a feel for the structure.
www.linuxcnc.org/docview/html/hal_intro.html
www.linuxcnc.org/docview/html/hal_basic_hal.html
www.linuxcnc.org/docview/html/hal_pyvcp.html
www.linuxcnc.org/docview/html/config_emc2hal.html
www.linuxcnc.org/docview/html/gui_halui.html
(Sorry, it is quite a lot of information)
What you should have so far is a system of links in Pyvcp, Hal and Halui that results in the file "M101" being run. You need to make that "M101" file run your python file. The current M101 is set up to run just like the command line, so anything you put in the file will execute exactly as it would if you typed it in the terminal window. What do you type in the terminal window to run your python file?
Please Log in or Create an account to join the conversation.
- piasdom
- Offline
- Platinum Member
- Posts: 472
- Thank you received: 10
custom_postgui.hal:12: Signal 'x-offset' of type 'float' cannot add pin 'pyvcp.x-offset' of type 'bit'
in the link i have and the button shows in axis
net x-offset halui.tool.length_offset.x <= pyvcp.x-offset
all looks ok to me, but i think i need something besides pyvcp.x-offset.
can't find anything about floats and bits. and in the docs, list of pins
have
halui.tool.length-offset.x minus sign
but i found in the hal config
halui.tool.length_offset.x underscore
so i know i have the pin right. just don't know if the end of the
link will always end in pyvcp.?????-?????
THANKS
p.s. i'm trying to make a pin in xml file, but isn't pin halui.tool.length_offset.x
used to output something. so i need to change my xml file to something besides button ?
Please Log in or Create an account to join the conversation.
- piasdom
- Offline
- Platinum Member
- Posts: 472
- Thank you received: 10
display the offset. just 0.0
Please Log in or Create an account to join the conversation.
- piasdom
- Offline
- Platinum Member
- Posts: 472
- Thank you received: 10
was offsetting x and looking for z
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23558
- Thank you received: 4858
"bit" means boolean (en.wikipedia.org/wiki/Boolean_data_type ) and is the output type of switches, buttons etc.can't find anything about floats and bits. and in the docs,
"float" means floating point ( en.wikipedia.org/wiki/Floating_point )and is the output type of spinboxes and number boxes.
HAL also has s32 and u32 (signed and unsigned integers ( en.wikipedia.org/wiki/Integer_(computer_science) )
That sounds like an error in the docs. The Hal Config screen will always be correct.list of pins
have
halui.tool.length-offset.x minus sign
but i found in the hal config
halui.tool.length_offset.x underscore
Please Log in or Create an account to join the conversation.
- piasdom
- Offline
- Platinum Member
- Posts: 472
- Thank you received: 10
Please Log in or Create an account to join the conversation.