Inverting an output pin

More
06 Nov 2019 15:54 #149730 by Elco
Inverting an output pin was created by Elco
How does one invert an output signal? The manual mentions this:

• parport.<p>.pin-<n>-out-invert (bit) Inverts an output pin.

Original HAL file attached.

File Attachment:

File Name: cnc_3_2019-11-06.hal
File Size:4 KB


However, when I change my hal file accordingly, Linuxcnc crashes with the following error (Kernel bit deleted):
Error report created by /usr/lib/tcltk/linuxcnc/show_errors.tcl:

Print file information:
RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/lib/linuxcnc/modules
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.6
LINUXCNC - 2.8.0-pre1-5212-g8da4d21ad
Machine configuration directory is '/home/robert/linuxcnc/configs/cnc_3'
Machine configuration file is 'cnc_3.ini'
INIFILE=/home/robert/linuxcnc/configs/cnc_3/cnc_3.ini
VERSION=1.1
PARAMETER_FILE=linuxcnc.var
TASK=milltask
HALUI=
DISPLAY=axis
COORDINATES=X Y Z
KINEMATICS=trivkins coordinates=XYZ
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Found file(REL): ./cnc_3.hal
Shutting down and cleaning up LinuxCNC...
config string '0 x'
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments

Debug file information:
Note: Using POSIX realtime
./cnc_3.hal:53: Pin 'parport.0.pin-08-out-invert' does not exist
1432
Stopping realtime threads
Unloading hal components
Note: Using POSIX realtime

Kernel message information:
[rest deleted]
Attachments:

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

More
06 Nov 2019 16:09 #149731 by toplakd
Replied by toplakd on topic Inverting an output pin
This is hove my inverted input looks:
net z-home-s <= hm2_7i92.0.gpio.030.in_not

So I assume for output pin could be same
out_not or out-not

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

More
06 Nov 2019 16:33 #149732 by Elco
Replied by Elco on topic Inverting an output pin
Is there anywhere in the manual where that is described?
I could imagine using the not function in two steps:

net xenable => not.0.in
not.0.out => parport.0.pin-08-out

(If that is the correct syntax)

And I assume this (manual 11.1.4) is incorrect:

• parport.<p>.pin-<n>-out-invert (bit) Inverts an output pin.

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

More
06 Nov 2019 16:40 - 06 Nov 2019 16:44 #149733 by toplakd
Replied by toplakd on topic Inverting an output pin
I would try it same way as you have inverted your estop, with -not at the end.

net estop-ext <= parport.0.pin-15-in-not
Last edit: 06 Nov 2019 16:44 by toplakd.

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

More
06 Nov 2019 18:52 - 06 Nov 2019 18:53 #149743 by Todd Zuercher
parport.N.pin-xx-out-invert is a parameter not a pin and you use a setp command to set it.

The way to invert a parallel port output is like this. Then you connect the out pin as normal.
setp parport.0.pin-08-out-invert true
net xenable         => parport.0.pin-08-out
Last edit: 06 Nov 2019 18:53 by Todd Zuercher.
The following user(s) said Thank You: Elco, millathe

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

Time to create page: 0.075 seconds
Powered by Kunena Forum