Basic questions re net, signals & pins

More
18 Nov 2023 22:32 #285862 by poesel
Hi,

I'm new to HAL and would like to know if I understood that correctly.

With the 'net' command, I do create and name a (logical) wire. And I can attach pins to this wire. Max. one output and unlimited input pins - just as in real life.
I can call 'net' once with several pins to attach at the same time, or can call it several times with the same signal name and different pins (all the time adhering to the pin rule).
I can not connect a pin to more than one signal.
I can not connect signals (wires) directly with each other.
If I wanted to connect more than one output to one input, I need to use functions like AND2 or OR2.
Signals are not directly used by the system. They are just names (labels). The pins are the important part.

I hope I got that right.

Thanks

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

More
18 Nov 2023 22:46 #285864 by tommylight
From a quick glance, that is pretty much it.
Use PyVCP for testing, net some pins in hal and watch some leds turn on and off on screen, makes for a much better learning experience, makes it fun.
The following user(s) said Thank You: poesel

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

More
19 Nov 2023 01:31 #285874 by PCW
Yes,  that's basically it.

There is one minor exception to connecting output pins in that
tri-state output pins can be connected ( Index enable is an example
of a tri-state pin )
The following user(s) said Thank You: tommylight

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

More
10 Dec 2023 21:56 #287800 by poesel
In my continuing journey to understand HAL, I'm going to resurrect this thread.
What I'm trying to do is to connect halui.axis.x.select (which is an input) with whb.halui.axis.x.select (which is an output) through the signal 'axis-select-x'.
And I'm doing something wrong because it is not working.
This is Lcnc 2.9.1.

Janus.ini

...
[HAL]
HALUI = halui
HALFILE = Janus.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal
SHUTDOWN = shutdown.hal

[HALUI]
...


Janus.hal (vanilla pncconfig)

...
#  ---HALUI Signale---

net axis-select-x  halui.axis.x.select
...


Custom.hal

# Benutzerdefinierte custom HAL-Anweisungen können hier eingefügt werden
# Diese Datei wird nicht überschrieben, wenn Sie PNCconf erneut ausführen

# pendant
source WHB04B-6.hal


WHB04B-6.hal

...
net axis.select.x                          whb.halui.axis.x.select
...

I see the signal from the pendant, but axis.select.x is not getting set when whb.halui.axis.x.select is set.

?

Thanks


 

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

More
11 Dec 2023 07:54 #287821 by Aciera
That's because your signal names do not match:

'net axis-select-x' vs 'net axis.select.x'
The following user(s) said Thank You: poesel

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

More
11 Dec 2023 17:40 #287870 by poesel
D'oh - thanks!

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

Time to create page: 0.152 seconds
Powered by Kunena Forum