Author Topic: No "Input" component ?  (Read 2614 times)

Wall-E

  • Robots in Architecture Members
  • Forum User
  • *
  • Posts: 194
    • View Profile
No "Input" component ?
« on: August 13, 2016, 12:16:29 PM »
Hi !

I have finaly managed to set-up a digital input and output on my KRC2 !
Then I made a little program to check that the output was working, and it works ! Now I can switch a relay on or off at the moment that I please, but I haven't tested the input yet.

I wish there was a "Input listener" component.
I suppose that the only way to integrate inputs at the moment is through a "Custom KRL" component.
Could someone send me a code snipet to see what the correct syntax is ?

Thanks !


Johannes @ Robots in Architecture

  • Lead Developer
  • Administrator
  • Forum User
  • *****
  • Posts: 952
    • View Profile
    • Robots in Architecture
Re: No "Input" component ?
« Reply #1 on: August 13, 2016, 04:02:36 PM »
Hello,

WAIT FOR $IN[5]
...would wait for input 5 to become true. See also page 99 of the KRC2 Expert Programming manual!
I could make a component for that, if it is helpful for your application!

Best,
Johannes

Wall-E

  • Robots in Architecture Members
  • Forum User
  • *
  • Posts: 194
    • View Profile
Re: No "Input" component ?
« Reply #2 on: August 15, 2016, 03:21:39 PM »
Hi Johannes,

And thanks for your answer.
I suppose that this code would pause the robot motion until a specific input channel becomes "True".
But what happens if the input is "true" briefly (as an impulse) and not as a continuous state ?

Cheers,

Johannes @ Robots in Architecture

  • Lead Developer
  • Administrator
  • Forum User
  • *****
  • Posts: 952
    • View Profile
    • Robots in Architecture
Re: No "Input" component ?
« Reply #3 on: August 15, 2016, 03:25:29 PM »
Hello,

Well, the WAIT FOR only waits for the switch to TRUE, it does not matter how long it is. You could make some kind of logic that waits for a few seconds and checks if the value is still TRUE if you need a specific timespan. Or you could solve that in hardware as well on the signal side.

Best,
Johannes