- Posts: 1111
- Thank you received: 0
make component pin in toggled ...
10 years 2 months ago #79734
by bkt
make component pin in toggled ... was created by bkt
maybe it's a stupid question but I can not make permanent a pin in my Component in shorter time ....
example...
Obviously halui.joint.N.on-hard-max-limit is a momentary contact .... I would like to make it become permanent, in MYCOMP on mypin until an external reset ...
example:
step 1) halui.joint.0.on-hard-max-limit UP => MYCOMP.mypin UP => myintvariable UP to myvaiable=1
step2) halui.joint.0.on-hard-max-limit DOWN => MYCOMP.mypin DOWN => myintvariable UP to myvaiable=1
step3) MYCOMP.resetsignal => myvaiable DOWN to myintvariable=0
I'm able to make these only if halui.joint.0.on-hard-max-limit stay UP more than 500-300msec. why these? I need sometings like 80-100msec.... is possible??
Depends only from userspace timing??
Regards
Giorgio
example...
Code:
/******MYCOMP*******/
while(!done)
{
usleep(20000); /* or usleep(250000) same result*/
FOR_ALL_INST(){
if (mypin) {myintvariable = 1;} .....
if (myintvariable == 1) { myoutputpin = 1;}
if (myresetpin) {myoutput = 0;}
.....
/***********my hal file****************/
net mypin MYCOMP.mynin <= halui.joint.0.on-hard-max-limit
.....
Obviously halui.joint.N.on-hard-max-limit is a momentary contact .... I would like to make it become permanent, in MYCOMP on mypin until an external reset ...
example:
step 1) halui.joint.0.on-hard-max-limit UP => MYCOMP.mypin UP => myintvariable UP to myvaiable=1
step2) halui.joint.0.on-hard-max-limit DOWN => MYCOMP.mypin DOWN => myintvariable UP to myvaiable=1
step3) MYCOMP.resetsignal => myvaiable DOWN to myintvariable=0
I'm able to make these only if halui.joint.0.on-hard-max-limit stay UP more than 500-300msec. why these? I need sometings like 80-100msec.... is possible??
Depends only from userspace timing??
Regards
Giorgio
Please Log in to join the conversation.
10 years 1 month ago #79842
by andypugh
Replied by andypugh on topic make component pin in toggled ...
Maybe create a realtime HAL component instead?
Or use linuxcnc.org/docs/2.7/html/man/man9/edge.9.html
Or use the code from "edge" in your own realtime comp.
Or use linuxcnc.org/docs/2.7/html/man/man9/edge.9.html
Or use the code from "edge" in your own realtime comp.
Please Log in to join the conversation.
10 years 1 month ago #79857
by bkt
Replied by bkt on topic make component pin in toggled ...
realtime comp ..... 
Regards
giorgio
Regards
giorgio
Please Log in to join the conversation.
10 years 1 month ago #79874
by andypugh
Replied by andypugh on topic make component pin in toggled ...
Please Log in to join the conversation.
Time to create page: 0.100 seconds
