Time out on toolchange

More
07 Apr 2016 17:23 #72923 by emcPT
Time out on toolchange was created by emcPT
Hello,

In a tool change component when something goes wrong a time out is normally present on machines that indicates that the tool change went wrong.

How can a time out be accomplished inside a component ? For example if the tool change does not occur in 10 seconds it should enter in error.

Thank you

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

More
07 Apr 2016 22:10 - 07 Apr 2016 22:12 #72934 by BigJohnT
Replied by BigJohnT on topic Time out on toolchange
I do my tool change in Classicladder so timers are easy.

I think (guess) you could make a timer of some sort in a component maybe counting cycles or something. Oh take a look at the time component it tracks time.

Edit: and look at the timedelay component.

JT
Last edit: 07 Apr 2016 22:12 by BigJohnT.
The following user(s) said Thank You: emcPT

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

More
08 Apr 2016 12:09 - 08 Apr 2016 12:09 #72954 by andypugh
Replied by andypugh on topic Time out on toolchange

How can a time out be accomplished inside a component ?


You mean inside a realtime HAL component?

Typically a HAL component is written as a state machine:
state = 0;
switch state{
case 0: // idle
   if (thing) {
      stuff;
     state = 1
   }
case 1: // begin
   if (other thing){
      more_stuff
     state = 2
...
and so on.

To add a timeout:
state = 0;
switch state{
case 0: // idle
   if (thing) {
      stuff;
    timer = 0;
     state = 1
   }
case 1: // begin
   timer += period; // period is in nS
   if (timer > 1000000) {
       state = 99;
      break
   }
   if (other thing){
      more_stuff
     timer = 0
     state = 2
...
  case 99:  // Handle timeout heree
Last edit: 08 Apr 2016 12:09 by andypugh.
The following user(s) said Thank You: emcPT

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

More
08 Apr 2016 16:17 #72968 by emcPT
Replied by emcPT on topic Time out on toolchange
Yes, we implemented like a delay (that we were using in another machines) and quite similar to your implementation and it works fine.

About the classicladder I never tested as we are able to do almost anything with components.

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

Time to create page: 0.216 seconds
Powered by Kunena Forum