and2 in multiple hal files?
- vmihalca
- Offline
- Platinum Member
- Posts: 344
- Thank you received: 21
net pause-on toggle2nist.0.is-on and2.bttns0.in1 and2.bttns3.in1 <= halui.program.is-paused
net program.is-paused halui.program.is-paused => vc-p4s.program.is-paused
So you're saying I should delete the first net?
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23178
- Thank you received: 4864
Please Log in or Create an account to join the conversation.
- vmihalca
- Offline
- Platinum Member
- Posts: 344
- Thank you received: 21
I added the same signal name for both, makes more sense. Applied that for other conflicts too.
Now the error message has changed to:
Signal 'program.pause' can not add OUT pin 'toggle2nist.0.on', it already has OUT pin 'vc-p4s.program.pause'
Any idea about this one?
See the updatated files attached below
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19529
- Thank you received: 6553
You can use that arbitrary name as many times as you need, but it can not be wired to the same signal twice:
net program.pause vc-p4s.program.pause => halui.program.pause
net program.resume vc-p4s.program.resume => halui.program.resume
net program.stop vc-p4s.program.stop => halui.program.stop
You will get the same error for those lines as you have halui.program.pause/resume/stop in both files. Check the ini on what is the first of those two hal files that gets loaded, and delete the halui.program.pause/resume/stop in the second hal file.
See if it works. Had such issues a while back and noticed that the order of things inside the hal files does matter when having same signals on multiple hal files.
Please Log in or Create an account to join the conversation.
- vmihalca
- Offline
- Platinum Member
- Posts: 344
- Thank you received: 21
If I understood correctly, you said I should remove the halui.program.pause/resume from the lines below.
If I do so, its the same error.
net program.pause halui.program.pause <= toggle2nist.0.on
net program.resume halui.program.resume <= toggle2nist.0.off
From what I understand from the message, I cannot share the signal to those two outputs.
I don't understand yet the whole hal stuff, but I have no idea if toggle2nist.0.on/off are considered outputs, why the arrow is <= and not =>
Please Log in or Create an account to join the conversation.
- Clive S
- Offline
- Platinum Member
- Posts: 2241
- Thank you received: 474
I don't understand yet the whole hal stuff, but I have no idea if toggle2nist.0.on/off are considered outputs, why the arrow is <= and not =>
The arrows= are not used by linucnc and are only there for the human to read and are quite often the wrong way around
Please Log in or Create an account to join the conversation.
- vmihalca
- Offline
- Platinum Member
- Posts: 344
- Thank you received: 21
There must be a way to have both pendant and pause/resume run/step buttons working.
net program.pause halui.program.pause <= toggle2nist.0.on
net program.resume halui.program.resume <= toggle2nist.0.off
and
net program.pause vc-p4s.program.pause => halui.program.pause
net program.resume vc-p4s.program.resume => halui.program.resume
Please Log in or Create an account to join the conversation.
- rodw
- Away
- Platinum Member
- Posts: 10833
- Thank you received: 3574
instead of:
net program.pause halui.program.pause <= toggle2nist.0.on
net program.resume halui.program.resume <= toggle2nist.0.off
do this
net program.pause <= toggle2nist.0.on
net program.pause => halui.program.pause
net program.resume <= toggle2nist.0.off
net program.resume => halui.program.resume
So lets start the next one you want. you can't call your signal name the same so we need a new name
net program.pause2 <= vc-p4s.program.pause
net program.resume2 <= vc-p4s.program.resume
So now it will become apparent you have a problem. How do you connect 2 signals to the same pin?
(eg. program.pause and program.pause2 )
You can't!
So I think you want to be able to press a hardware button OR a GUI button to do the same thing. If that is the case, you need to use an OR2
net program.pause <= toggle2nist.0.on
net program.pause2 <= vc-p4s.program.pause
net program.pause => or2.0.in0
net program.pause2 => or2.0.in1
net program.pause3 <= or2.0.out
net program.pause3 => halui.program.pause
So now it is much more readable and understandable and easier to maintain.
Hope I got that right. I'll leave it to you to do the other side and make sure the loadrt and addfs are right and that the or2 numbering is correct
Please Log in or Create an account to join the conversation.
- pl7i92
- Offline
- Platinum Member
- Posts: 1875
- Thank you received: 354
and do there the servo tread also so all component are getting it based on the main hal
this gives a real good overview to the thinges that work over the mashine
use comments # to keep track
mashine.hal
loadrt flipflop names=flipflop_resume,flipflop_pause,flipflop_run,flipflop_icon
addf flipflop_resume servo-thread
addf flipflop_pause servo-thread
addf flipflop_run servo-thread
addf flipflop_icon servo-thread
# RESET/ESTOP button
loadrt multiclick names=click_estop,click_macro1,click_zero,click_spindel,click_stop,click_mode,click_macro2,click_macro3,click_probe_z
addf click_estop servo-thread
addf click_mode servo-thread
addf click_macro2 servo-thread
addf click_probe_z servo-thread
#click_probe_z in postgui
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23178
- Thank you received: 4864
Also, do you need toggle2nist?
A typical net using or2...
net button1 <= some-monentary-button
net button1 => or2.0.in0
net button2 <= another-monentary-button
net button2 => or2.0.in1
net button1orbutton2 <= or2.0.out
net button1orbutton2 => halui,program,pause
I suggest drawing the net out on paper, and giving a signal name to every line, that should make it clearer.
Here is an example, though it doesn't have the signal names on the lines:
wiki.linuxcnc.org/uploads/orient.svg
Note that Ctrl-+ will make it bigger in most web browsers.
Please Log in or Create an account to join the conversation.