I/O Signals

Hello,

I am relatively new to Rapid programming and have problem I am not sure how to write the code for.

I am trying to setup a rotary table that I need to monitor the RPM’s before motion occurs. I will get a DI signal when the RPM’s are correct but I need to know how to write an Interrupt to prevent motion before the condition is met.

The table has proximity sensors that I receive DI signals from when the rotary table has completed revolutions. I will need to start at the zero degree table position so I will get a DI signal then.

I have a couple of questions I need help with.

Could I just use the WAITDI command until the signals are received?
Can I read the DI signal and when it equals 1, write the value to a num variable so I can count total revolutions?

I am planning on using a WHILE command to evaluate when the correct number of revolutions has been completed.

I am not really sure if this is the right approach or not, but I need some advice if other methods would work better.

Any code examples provided would be greatly appreciated.

Thanks,
Ted

May be something like this:

WaitDi MySignal,1;
Reg1 := Reg1+1;
WaitDi MySignal,0;

/Jorge

That is similiar to what I did. I used a WaitTime instead of WaitDI MySignal,0;

I like your solution better to wait until the DI signal = 0 rather than assigning a specific time period.
Thanks,