NET: can not add OUT pin .. it already has out pin

More
11 Dec 2017 19:08 #102927 by AndrewHsasku
How net function should work? Why I can't connect one input to two outputs?
net enable	axis.0.amp-enable-out				=> driver.enable	x-pid.enable
or
net enable <= axis.0.amp-enable-out
net enable => driver.enable
net enable => x-pid.enable

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

More
11 Dec 2017 20:10 - 11 Dec 2017 20:40 #102931 by Todd Zuercher
Multiple in pins can be connected to an out, but only one out can ever be connected to a signal.

If for some reason you need to use more than one source for a signal, you can use an or2 or another hal logic component.
linuxcnc.org/docs/html/man/man9/or2.9.html

Example
loadrt or2 count=1
addf or2.0  servo-thread

net outpin1 <= some.hal-out1 => or2.0.in0
net outpin2 <= some.hal-out2 => or2.0.in1
net target <= or2.0.out

Now the example you gave looks like it only has one output pin (axis.0.amp-enable-out) and two input pins, so it shouldn't be a problem. (I say this guessing that "driver.enable" is supposed to represent some GPIO input pin that sends a signal out to enable your drive, such as parport.0.pin-09-out.)
Last edit: 11 Dec 2017 20:40 by Todd Zuercher.

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

More
11 Dec 2017 20:31 - 11 Dec 2017 20:37 #102933 by AndrewHsasku
Don't get it. Once again - one pin is an input. This input is casted as a signal. This signal is transmitted to multiple output pins.
As it is written here: linuxcnc.org/docs/2.5/html/hal/basic_hal...#_net_a_id_sub_net_a
#   signal    source            destination          destination
net xStep stepgen.0.out => parport.0.pin-02-out parport.0.pin-08-out
This is my case, that prints error.

Maybe there is a missconception about input and output. I mean input as an input for net function.
Last edit: 11 Dec 2017 20:37 by AndrewHsasku.

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

More
11 Dec 2017 20:46 #102936 by Todd Zuercher
That line of hal code should not give you any problems due to multiple out pins, as both of the parport pins you have there are both hal input pins. (It is a little confusing since in hal they receive the signal as an input that the parallel port sends out.)

If you are getting a fault because of something to do with that line, it is possible that signal name is used somewhere else in your hal file(s) where another output (or even possibly the same one) is connected to it.

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

More
11 Dec 2017 22:50 - 11 Dec 2017 23:10 #102946 by AndrewHsasku
It seems that any net connection that output is my driver's pin results in such error
exact line looks for example like that:
net x-enable	axis.0.amp-enable-out	=> x-pid.enable	driver.axis_x.enable
net x-vel-cmd	x-pid.output		=> driver.axis_x.velocity
Last edit: 11 Dec 2017 23:10 by AndrewHsasku.

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

More
12 Dec 2017 03:51 #102970 by Todd Zuercher
If you could post a copy of your whole hal file.

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

More
12 Dec 2017 04:37 #102974 by InMyDarkestHour
If you can run halrun and load your driver, then run show pin that will show the pins available from your driver and their directions.

No need to run a whole configuration.

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

More
12 Dec 2017 13:39 - 12 Dec 2017 13:56 #102994 by AndrewHsasku
Thanks, it started working
I used hal_pin_bit_newf(HAL_OUT not hal_pin_bit_newf(HAL_IN
Last edit: 12 Dec 2017 13:56 by AndrewHsasku.

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

More
12 Dec 2017 16:48 #103011 by InMyDarkestHour
So you zigged when you should have zagged ? ;)

Glad you got it sorted :)

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

Time to create page: 0.076 seconds
Powered by Kunena Forum