make component pin in toggled ...

More
30 Aug 2016 18:05 - 30 Aug 2016 18:28 #79734 by bkt
maybe it's a stupid question but I can not make permanent a pin in my Component in shorter time ....

example...
 /******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
Last edit: 30 Aug 2016 18:28 by bkt.

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

More
01 Sep 2016 16:36 #79842 by andypugh
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.
The following user(s) said Thank You: bkt

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

More
01 Sep 2016 17:56 #79857 by bkt
realtime comp ..... :unsure:

Regards
giorgio

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

More
01 Sep 2016 20:16 #79874 by andypugh

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

Time to create page: 0.067 seconds
Powered by Kunena Forum