techElder
Well-known member
I'm looking for fresh input. I must be fried, because I can't think of a simple way to do this.
I have a hardware device (function unimportant) that has a TRIG_IN input, a TRIG_OUT output and a SELF_TRIG link (where the IN is directly connected to the OUT.)
So, the following subs work great for connecting one device to another and getting them to function in sequential order.
I call the TrigOut routine after the first one is finished functioning, and then the next one is waiting for that pulse in TrigIn and performs its function.
What I can't seem to figure out is the SELF_TRIG operation with a hardware link where the first device continuously performs its function by triggering itself. I know it can't be done with two separate subroutines, but seems like there should be a simple way.
There is no separate indicator that self trigger should occur. Its just a link from out back to in.
Help? (Hoping Hippy has some magic dust to throw on this problem! )
I have a hardware device (function unimportant) that has a TRIG_IN input, a TRIG_OUT output and a SELF_TRIG link (where the IN is directly connected to the OUT.)
So, the following subs work great for connecting one device to another and getting them to function in sequential order.
I call the TrigOut routine after the first one is finished functioning, and then the next one is waiting for that pulse in TrigIn and performs its function.
What I can't seem to figure out is the SELF_TRIG operation with a hardware link where the first device continuously performs its function by triggering itself. I know it can't be done with two separate subroutines, but seems like there should be a simple way.
There is no separate indicator that self trigger should occur. Its just a link from out back to in.
Help? (Hoping Hippy has some magic dust to throw on this problem! )
Code:
[color=Green]'---------------------------
[PLAIN]'------[ SUBROUTINES ]------[/PLAIN]
'---------------------------[/color]
[color=Black]TrigOut:
[/color][color=Green]' create a timed high level on the TRIG_OUT pin
[/color][color=Blue]pulsout [/color][color=Black]TRIG_OUT,ONESECOND
[/color][color=Blue]return[/color]
[color=Black]TrigIn:
[/color][color=Green]' wait for a timed high level on the TRIG_IN pin
[/color][color=Blue]do until [/color][color=Black]TRIG_IN [/color][color=DarkCyan]= [/color][color=Black]TRUE : [/color][color=Blue]loop
return[/color]