and2 in multiple hal files?
- vmihalca
- Offline
- Platinum Member
Less
More
- Posts: 344
- Thank you received: 21
17 Jul 2019 19:50 #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 or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17997
- Thank you received: 4841
17 Jul 2019 20:04 - 17 Jul 2019 20:19 #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
Last edit: 17 Jul 2019 20:19 by PCW. Reason: TWOPASS upper case no space
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 4957
- Thank you received: 1441
17 Jul 2019 20:49 #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.
loadrt and2 names=and2.0 and2.1,and2.3,and2.vc
Please Log in or Create an account to join the conversation.
- vmihalca
- Offline
- Platinum Member
Less
More
- Posts: 344
- Thank you received: 21
17 Jul 2019 21:01 #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 or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 4957
- Thank you received: 1441
17 Jul 2019 21:18 #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 or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19529
- Thank you received: 6553
17 Jul 2019 22:00 #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 or Create an account to join the conversation.
- rodw
- Away
- Platinum Member
Less
More
- Posts: 10833
- Thank you received: 3573
17 Jul 2019 22:09 #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.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19529
- Thank you received: 6553
17 Jul 2019 22:17 #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
The following user(s) said Thank You: rodw
Please Log in or Create an account to join the conversation.
- vmihalca
- Offline
- Platinum Member
Less
More
- Posts: 344
- Thank you received: 21
19 Jul 2019 20:33 #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 or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23178
- Thank you received: 4864
25 Jul 2019 22:40 #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?
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 or Create an account to join the conversation.
Time to create page: 0.076 seconds