and2 in multiple hal files?

More
26 Jul 2019 12:17 #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 or Create an account to join the conversation.

More
26 Jul 2019 13:00 #140652 by andypugh
Delete one, or use the same signal name in both, whichever gives the behaviour you want.

Please Log in or Create an account to join the conversation.

More
26 Jul 2019 16:47 #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
Attachments:

Please Log in or Create an account to join the conversation.

More
26 Jul 2019 17:15 #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 or Create an account to join the conversation.

More
26 Jul 2019 18:14 #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 or Create an account to join the conversation.

More
26 Jul 2019 18:18 #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 or Create an account to join the conversation.

More
26 Jul 2019 18:30 #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 or Create an account to join the conversation.

More
27 Jul 2019 00:22 #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:
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
The following user(s) said Thank You: Clive S

Please Log in or Create an account to join the conversation.

More
27 Jul 2019 11:21 #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 or Create an account to join the conversation.

More
27 Jul 2019 11:24 - 27 Jul 2019 11:27 #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...
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.
Last edit: 27 Jul 2019 11:27 by andypugh.
The following user(s) said Thank You: vmihalca

Please Log in or Create an account to join the conversation.

Time to create page: 0.158 seconds
Powered by Kunena Forum