estop's to pins (num 1000+1)

More
11 Jul 2011 12:12 #11390 by Fremder
hello and thanks for the good help .. sorry for the question where i'am not the first - i think :-)

i have problems to make this:

M131 go out:
halcmd setp hm2_5i20.0.gpio.042.out 1 # makes my Shutter ON

M130 go out:
halcmd setp hm2_5i20.0.gpio.042.out 0 # makes my Shutter OFF

its ok ...

when i have PUNIC or anything ... then i press ESC for hold ...and stop
but
the SHUTTER IS ON :)

what its the "good-way" to makes the pins <- stoped with ESC or estop

I have buttons on screen to set "Shutter manuel ON/OFF" and so ...
but then i can't make a conection to the > NET SutterOFF halui.machine.is-on -> halcmd setp hm2_5i20.0.gpio.042.out

i looked to a function - nearly the same - when i closed emc2 (the pins goes all to 0 :-)

sorry for this german-bavaria-english

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

More
11 Jul 2011 12:54 #11395 by andypugh
The solution is probably to use an and2 function.
link an2.N.in0 to the control input (or leave it unconnected and drive it with setp from the M1NN commmand) and net the other input to a suitable built-in EMC2 pin.

You might need to look around in the machine->show hal config->watch window to find a HAL pin (probably one of the "motion" group) which behaves the way you need.
You could probably use a "near" function linked to the velocity pin to do it, too.

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

More
11 Jul 2011 14:21 #11406 by Fremder
hello my teacher ... thanks

and2 its the right way ... and combined with motion.spindle-on its verry good to down with ESC :-)

puuu - strong way for smal lines *g*

have you a idee to makes in the "SIMulated-Version" ( i sit in the office 20 meter behind the machin-pc ...)
and "play" my code here ... but the 5i20 pins not in the sim.hal inside (the code is toooo much for me ...)

its a fast way to sim the pins ----> YES i "w"ill make this ... otherside its better i buy me a 5i20 for experiments *g*

good time for you and (yes thanks 1000+1 again )

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

More
11 Jul 2011 14:51 #11412 by andypugh
Fremder wrote:

have you a idee to makes in the "SIMulated-Version" ( i sit in the office 20 meter behind the machin-pc ...)
and "play" my code here ... but the 5i20 pins not in the sim.hal inside (the code is toooo much for me ...)


I have a similar situation, the workshop is at the end of the garden.

I can't immediately think of a way to run a simulated machine, but what you could do is create a copy of the real configuration that does not enable the motors, then you can run the real machine under remote desktop but not have to worry about what is happening with the hardware.
(this will work well with stepper systems with no feedback), less so with servos. With a servo system you can loop-back the feedback pins so that EMC2 thinks that the servos are moving.

You can have as many configurations on the PC as you want, I have 4 for the same machine (lathe mode, milling machine mode, gear hobber, inch lathe)

I use ssh -X to remotely control my Linux EMC2 machine from my Mac in the living room.

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

More
11 Jul 2011 15:44 - 11 Jul 2011 15:54 #11418 by Fremder
nice to "see" i 'm not the only :-) and now i must not makes "mind-games" to make a good idea ...

your way its good ...

the LAST - question *g* (for min.this.day)

what i must do for a Mnn Pythonfile in the first and last-line

/#!/bin/bash
halcmd sets minPower $1 # goes OK

# then i like a IF ELIF or nearly :(

_mP = #1 # from called g-codefile > P

if _mP < 150:
halcmd setS minPower 150
elif:
halcmd setS minPower $_mP
# don't OK .(
exit 0

and i search now 2 or more hours for logik
the search found for me this:

A = 1 +1
A = 1 + 2 - 1
A = 2
A = n-1 (=2) *g*
and so on :-)

... PS: its PythonOUT
GOOD
NO_GOOD
50 : 50
SLOW
> for "no realtimethinks"
i must stop
Edit:
ok i must do

> import os
and

txt = "halcmd setp limit1.0.0.max 100"
os.system(txt)

and GOOD :)
Last edit: 11 Jul 2011 15:54 by Fremder.

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

More
11 Jul 2011 16:01 #11419 by andypugh
Fremder wrote:

what i must do for a Mnn Pythonfile in the first and last-line

/#!/bin/bash
halcmd sets minPower $1 # goes OK

This isn't a Python command. If you want to run Python (and you can) then the first line needs to be

#!/bin/python

Then any python commands you put in there should work.
Unfortunately, I am totally clueless where Python is concerned.

You can do conditionals in bash, but the format is a bit different, being if [ conditon] then <stuff> else <other stuff> ; fi
(begins with if, ends with fi )

tldp.org/LDP/Bash-Beginners-Guide/html/chap_07.html

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

Time to create page: 0.066 seconds
Powered by Kunena Forum