Basic HAL help

More
09 May 2017 00:37 #92897 by dberndt
Basic HAL help was created by dberndt
I need some basic HAL help here.

As a programmer an general sane person working with something like hm2_5i25.0.7i77.0.0.input-02 is pretty much a non-starter. So I want to name some stuff and I'm either not getting the syntax right, or I'm trying to do something that isn't possible.

So lets say I want to take 2 pins, and and2 them together to figure out if I a servo-amp is throwing an error...


#...lots of other garbage...
loadrt and2 count=1
#...more garbage...
addf and2.0 servo-thread

net x-amp-warning <= hm2_5i25.0.7i77.0.0.input-02
net x-amp-on <= hm2_5i25.0.7i77.0.0.input-03-not

#that seems reasonable so far, we've brought in the 2 pins we care about and given them descriptive names. Now lets put those things into an and2.

net and2.0.in0 <= x-amp-warning
net and2.0.in1 <= x-amp-on

Error, pin 'x-amp-warning' does not exist.. Why is it that I can't connect what seems to be a "signal" to another signal? I thought the analogy in the tutorial was that signals are just wires. I can certainly connect wires together in real life... Do I have to makeup a pin to connect these wires at somehow?

Finding this to be a 10/10 on the frustrating scale.

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

More
09 May 2017 00:42 #92898 by tommylight
Replied by tommylight on topic Basic HAL help
I think just reversing the order on the last 2 lines is .......well in order !!!

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

More
09 May 2017 01:11 #92902 by dberndt
Replied by dberndt on topic Basic HAL help
Well that's awesome...

No:
net and2.0.in0 <= x-amp-warning
net and2.0.in1 <= x-amp-on

Yes:
net x-amp-warning => and2.0.in0
net y-amp-ready => and2.0.in1

But... why? They seem to be the same. Lines above like:
net x-amp-warning <= hm2_5i25.0.7i77.0.0.input-02
net x-amp-on <= hm2_5i25.0.7i77.0.0.input-03-not
Assign the thing on the right to the thing on the left just fine. Why is it reversed in this case?

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

More
09 May 2017 12:31 #92916 by tommylight
Replied by tommylight on topic Basic HAL help
X-amp-warning is a name you gave it, all others are hal componenets in that case.
You can do:
Net x-amp-warning <= hm2_5i25.0.1.pinxxxx-in-or-out >
=> and2.0.in1
That works.

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

More
09 May 2017 13:01 #92920 by Todd Zuercher
Replied by Todd Zuercher on topic Basic HAL help
In Hal a "net" command has specific syntax.
net "signal name" "pin names"
The first word after the net is ALWAYS the signal name. This is an arbitrary name that you make up for this signal. It can be a new name or reference an existing signal name.
Next come the pin names, they are specific names of hal pins created by hal components. There can be only one output pin connected to any one signal name, but as many input pins as you like.
The following user(s) said Thank You: tommylight

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

Time to create page: 0.101 seconds
Powered by Kunena Forum