- Posts: 346
- Thank you received: 0
and2 in multiple hal files?
7 years 3 months ago #139715
by vmihalca
and2 in multiple hal files? was created by vmihalca
Hi guys,
I am trying to keep the hal files quite separated by the hardwares attacted to the machine: pendant, buttons pannel, probes, etc
For this I use multiple hal files that I load in the ini file.
However I ended up in the situation where in a file I have:
loadrt and2 count=4
and in another file I have:
loadrt and2 names=and2.vc
This results in the following error:
and2: already exists
Is there a way to give aliases to and2 so that I can use it in multiple files and keep everything clean?
Or what would be the best practice regarding these components?
I am trying to keep the hal files quite separated by the hardwares attacted to the machine: pendant, buttons pannel, probes, etc
For this I use multiple hal files that I load in the ini file.
However I ended up in the situation where in a file I have:
loadrt and2 count=4
and in another file I have:
loadrt and2 names=and2.vc
This results in the following error:
and2: already exists
Is there a way to give aliases to and2 so that I can use it in multiple files and keep everything clean?
Or what would be the best practice regarding these components?
Please Log in to join the conversation.
7 years 3 months ago #139716
by PCW
Replied by PCW on topic and2 in multiple hal files?
I think the solution for this kind of issue is the "TWOPASS" hal file parsing option
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
7 years 3 months ago #139720
by Todd Zuercher
Replied by Todd Zuercher on topic and2 in multiple hal files?
I'm not sure exactly how or if TWOPASS works in this situation. But I think the simplest solution is to loadrt all of your and2s in your first hal file. (all the and2 net lines in the 2nd file can stay there. Use a line like this in the 1st file.
Code:
loadrt and2 names=and2.0 and2.1,and2.3,and2.vc
Please Log in to join the conversation.
7 years 3 months ago #139721
by vmihalca
Replied by vmihalca on topic and2 in multiple hal files?
Thanks, after doing this and adding names to all and2 and or2 it worked.
Now I ran into another issue:
I have a hal file that wires some external buttons for Run/Step and Pause/Resume
This enters in conflict with the hal file of the pendant VistaCnc that has buttons for pause resume on the pendant.
The error I get is: halui.program.is-paused was already linked to signal program.is-paused.
Is there a way to merge these two files similar to twopass so that they don't conflict each other?
Now I ran into another issue:
I have a hal file that wires some external buttons for Run/Step and Pause/Resume
This enters in conflict with the hal file of the pendant VistaCnc that has buttons for pause resume on the pendant.
The error I get is: halui.program.is-paused was already linked to signal program.is-paused.
Is there a way to merge these two files similar to twopass so that they don't conflict each other?
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
7 years 3 months ago #139722
by Todd Zuercher
Replied by Todd Zuercher on topic and2 in multiple hal files?
Can you attach the conflicting hal files? Have to see what's going on to find the best fix.
Please Log in to join the conversation.
- tommylight
-
- Offline
- Administrator
-
Less
More
- Posts: 22012
- Thank you received: 4
7 years 3 months ago #139724
by tommylight
Replied by tommylight on topic and2 in multiple hal files?
Maybe using the OR component will do what you need, net the two inputs to two svitches and the output to run/ step. Same thing for pause/resume.
Please Log in to join the conversation.
7 years 3 months ago #139726
by rodw
Replied by rodw on topic and2 in multiple hal files?
Just think about the problem for the moment.
You want to pause the machine when you press button 1 OR button 2
So rephrasing into the language of HAL, you need to connect button 1 and button 2 to inputs on an OR2 component and connect the output from the OR2 to pause the machine in halui.
You want to pause the machine when you press button 1 OR button 2
So rephrasing into the language of HAL, you need to connect button 1 and button 2 to inputs on an OR2 component and connect the output from the OR2 to pause the machine in halui.
Please Log in to join the conversation.
- tommylight
-
- Offline
- Administrator
-
Less
More
- Posts: 22012
- Thank you received: 4
7 years 3 months ago #139732
by tommylight
Replied by tommylight on topic and2 in multiple hal files?
Rod,
Thank you.
Much better explanation than i can do.
Regards,
Tom
Thank you.
Much better explanation than i can do.
Regards,
Tom
Please Log in to join the conversation.
7 years 3 months ago #139923
by vmihalca
Replied by vmihalca on topic and2 in multiple hal files?
See below the files that are conflicting:
The error I get is: halui.program.is-paused was already linked to signal program.is-paused.
The error I get is: halui.program.is-paused was already linked to signal program.is-paused.
Please Log in to join the conversation.
7 years 3 months ago #140579
by andypugh
It will also tell you what line the error occurs on.
If the error occurs on the or2 line then you need to delete (or comment-out) the first net.
Replied by andypugh on topic and2 in multiple hal files?
vmihalca wrote: See below the files that are conflicting:
The error I get is: halui.program.is-paused was already linked to signal program.is-paused.
It will also tell you what line the error occurs on.
If the error occurs on the or2 line then you need to delete (or comment-out) the first net.
Please Log in to join the conversation.
Time to create page: 0.108 seconds
