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

More
8 years 10 months ago #102927 by AndrewHsasku
How net function should work? Why I can't connect one input to two outputs?
Code:
net enable axis.0.amp-enable-out => driver.enable x-pid.enable
or
Code:
net enable <= axis.0.amp-enable-out net enable => driver.enable net enable => x-pid.enable

Please Log in to join the conversation.

More
8 years 10 months ago #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
Code:
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.)

Please Log in to join the conversation.

More
8 years 10 months ago #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
Code:
# 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.

Please Log in to join the conversation.

More
8 years 10 months ago #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 to join the conversation.

More
8 years 10 months ago #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:
Code:
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

Please Log in to join the conversation.

More
8 years 10 months ago #102970 by Todd Zuercher
If you could post a copy of your whole hal file.

Please Log in to join the conversation.

  • ozzyrob
  • New Member
  • New Member
More
8 years 10 months ago #102974 by ozzyrob
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 to join the conversation.

More
8 years 10 months ago #102994 by AndrewHsasku
Thanks, it started working
I used hal_pin_bit_newf(HAL_OUT not hal_pin_bit_newf(HAL_IN

Please Log in to join the conversation.

  • ozzyrob
  • New Member
  • New Member
More
8 years 10 months ago #103011 by ozzyrob
So you zigged when you should have zagged ? ;)

Glad you got it sorted :)

Please Log in to join the conversation.

Time to create page: 0.102 seconds
Powered by Kunena Forum