Hello,

I have had no luck getting a C executable to run from a M101 - M199 command
so I have decided to take a different approach. I think that approach will
be problematic with the need for root to get access to the port anyway and
that may be causing the problem I am having. My goal is to apply a signal to
pins 2, 3, and 4 of an additional parallel port. I am thinking a bash script
with the appropriate pins turned high or low would do it..

So I found the parallel port tester .hal file from the wiki
http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Parallel_Port_Tester

I installed it and picked the appropriate port. (I actually have 3 ports
total, 1 port is controlling the milling machine 0x0B800, and the other 2
ports are 0x378 and 0x0B000)

I have verified that each of these ports work with the Parallel Port Tester
program and I get the expected results.

I can not get my bash script to execute correctly from calling a M102 as an
example.

This is my bash script:

#!/bin/sh

# M101 in your G code program will run the Linux commands in this
# shell script "batch" file, passing the P and Q variables as command
# line arguments.

# give the command line arguments descriptive names
P=$1
Q=$2

halcmd setp parport.1.pin-2-out True

echo "M101 P$P Q$Q: put your code here"

exit 0
******************************************************************************************
I have modified my .hal file to this:

# Generated by stepconf at Sat Sep 11 14:26:27 2010
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD
servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hal_parport cfg="0x0B800 0x0B000"
setp parport.0.reset-time 3500
loadrt stepgen step_type=0,0,0
loadrt abs count=1
addf parport.1.read base-thread
addf parport.1.write base-thread

setp parport.1.pin-2-out TRUE

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread
*******************************************************************************************************************

I have played with the order of my port placement in line : loadrt
hal_parport cfg="0x0B800 0x0B000" changing the order of the port call out?

So one question I have that I could not find in any of the reading I did is
does the the order of the port in this command dictate the parport number?

So is this the case?

loadrt hal_parport cfg=" 0 1 2 ....." or is it the order seen in the results
of the lspci -v .
I think I know the answer to this because my original configuration used
port 0x0B800 and it was set to parport.0.
So I am assuming that based on my .hal file parport.0 is 0x0B800 and
parport.1 is 0x0B000. I am also assuming these ports are "out" type because
that is said to be the default.

You will note that I have added a line "setp parport.1.pin-2-out TRUE" to my
.hal file. This is basically the same command I am trying to run from the
M102 code. I figured adding it here would require less steps in testing. I
get the same error in either case.

This is my error:

parameter or pin 'parport.1.pin-2-out' not found.

I get this error when I attempt to start EMC with the "setp
parport.1.pin-2-out TRUE" in my .hal file as shown above or when I remove
the line from the .hal file, launch EMC, then go to a terminal and execute
the bash script manually. When I attempt to run the bash file from the M101
I get no error and no result.

What am I missing?

Thanks,
Mike
------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to