Hello Guest it is May 14, 2021, 09:13:26 PM

Author Topic: Specialized application  (Read 2202 times)

0 Members and 1 Guest are viewing this topic.

Specialized application
« on: January 18, 2008, 01:29:57 PM »
Here is what I need to have happen.
 Program starts, relay 1 goes on, relay 2 is off and waiting for an input 1 to change.
 Relay 1 then goes off and relay 2 goes on.
Then I wait for input 2.
 Input 2 is tripped then relay 1 and 2 go off, wait for x to move a distance as input by the operator.
 After x finishes the move, relay 1 comes on, relay 2 stays off and we wait for input 1 again.
I have a macro to do the I/O part which works, however I need to understand how to get a variable input box
into the macro as an x move distance.

I think this will all be gone in a macro which I call.
Any suggestions?

Thanks, Allen

Offline jimpinder

  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: Specialized application
« Reply #1 on: January 18, 2008, 02:10:52 PM »
If you are saying that you have done most of the macro for switching the relays etc, then you are there !!

I think the syntax is     -    a = GetUserDRO ( )  with the number of the DRO in  or something similar. If you look at the Video Tutorial on writing Macros, most of it is covered in there.

The axis readings are readily available. It might be as simple as a = dro(1) where 1 is x, 2 is y and 3 is z.

I just can't remember - but it is farly simple. Obviously you might have to make two readings, one before and one after the move to establish distance - but it is all accesssible.
Not me driving the engine - I'm better looking.