and2 in multiple hal files?

More
7 years 3 months ago #140647 by vmihalca
The conflicting lines between the two files are:

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 to join the conversation.

More
7 years 3 months ago #140652 by andypugh
Delete one, or use the same signal name in both, whichever gives the behaviour you want.

Please Log in to join the conversation.

More
7 years 3 months ago #140661 by vmihalca
Thanks for the reply.
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 to join the conversation.

More
7 years 3 months ago #140663 by tommylight
You have both instances of "program.pause" that is an arbitrary signal name wired to the same signal in both hal files.
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 to join the conversation.

More
7 years 3 months ago #140667 by vmihalca
The first one loaded is the vc-p4s.hal
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 to join the conversation.

More
7 years 3 months ago #140669 by Clive S
Replied by Clive S on topic and2 in multiple hal files?

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 to join the conversation.

More
7 years 3 months ago #140670 by vmihalca
Ok, I understand the arrow theory, but how should I solve the conflict between these lines?
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 to join the conversation.

More
7 years 3 months ago #140706 by rodw
Replied by rodw on topic and2 in multiple hal files?
The more steps or connections you try and do on one line, the more confusing this becomes. It became much easier for me as soon as I did one thing per line and it is much easier to maintain
instead of:
Code:
net program.pause halui.program.pause <= toggle2nist.0.on net program.resume halui.program.resume <= toggle2nist.0.off

do this
Code:
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
Code:
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
Code:
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 to join the conversation.

More
7 years 3 months ago #140740 by pl7i92
Replied by pl7i92 on topic and2 in multiple hal files?
also it is comen to loadrt the logic base sutch as and2 or .... in the main halfile
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 to join the conversation.

More
7 years 3 months ago #140741 by andypugh
It would help to know which of the vc-4s pins are inputs and which are outputs.

Also, do you need toggle2nist?

A typical net using or2...
Code:
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 to join the conversation.

Time to create page: 0.137 seconds
Powered by Kunena Forum