On 17 May 2018 at 13:34, Maxime Lemonnier <maxime.lemonn...@gmail.com> wrote:

> I would like to configure HAL to simply zero-out channel 7 when it receives
> the trigger pulse, then I would write a comp that output the position at
> which the trigger was pulsed using the delta between encoder 3 and 7.

If you are writing a custom .comp then I would source the index-enable
signal from that.

It isn't clear from your description precisely when you want this to
happen, but I imagine that choosing the conditions is also something
easiest inside the custom component.

HAL comps for jobs like this tend to be coded as a state machine:

pin out signed state = 0;
pin in float input1;
pin in float input2;
pin out float output;
switch state{
case 0: //readiness state
if (conditions){
    state = 1;
    index_enable = 1;
case 1: // waiting for index
if (! index_enable){
    state = 2;
    output = input1 - input2;
    state = 2;
case 2: // we don't really need this state
    state = 0;

"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
— George Fitch, Atlanta Constitution Newspaper, 1916

Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Emc-users mailing list

Reply via email to