12.07.2015 Views

spec - Local Sector 7 web page

spec - Local Sector 7 web page

spec - Local Sector 7 web page

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

In addition, device-dependent values for par are available for <strong>spec</strong>ific countermodels. See the Hardware Reference for values for <strong>spec</strong>ific controllers.The counting functions mcount() and tcount() both program the timer/clock for a<strong>spec</strong>ified count time. Before the count period begins, both functions clear and enableall configured scalers and MCAs. The routines return immediately, ascounting isasynchronous. Use wait() ,described below, todetermine if counting has been completed.A ˆC will halt the timer/clock.When the count time has expired, or counting is aborted by a ˆC ,the scalers andMCAs are disabled. Normally, enable signals from the timer/clock are used todirectly gate the scalers or MCAs. Software gating takes place whether or not hardwaregating is in place and can be used in lieu of hardware gating, although theinterval over which the gating occurs will not be as precisely controlled.Controlling Motorsmove_all — This command sets motors in motion. The sequence of events is as follows.For some motor controllers, <strong>spec</strong> first examines the controller registersof all nonbusy motors and makes sure the contents agree with the currentpositions in program memory. Ifthere is a discrepancy, the user is asked tochoose the correct position. Next, <strong>spec</strong> prepares to move all motors that arenot already at the positions <strong>spec</strong>ified in the built-in A[] array, interpreted inuser units. Amotor will not be moved if it is currently moving or if it ismarked as protected (via the configuration file) or unusable (due to failure of ahardware presence test). If the target position of any of the motors is outsidethe software limits, the entire move is canceled, and the program resets tocommand level. Otherwise, the motors are started, and the command returns.The sequence of commands when using move_all should almost always be,wait(1)# Wait for moving to finishread_motors(0) # Put current positions of all motors in A[](Assign new values to elements of A[] to be moved)move_all # Move to those positionsIf read_motors() is called before the motors have stopped, the values in A[]will reflect the motor positions before they stopped. If read_motors() is notcalled at all, or if you do not explicitly assign a value to each element of A[] ,then you will not know for sure where some motors will be going whenmove_all is called.A ˆC halts moving, as does the sync command.move_cnt — This command is similar to move_all ,described above, but with the followingdifferences. Just before the motors are started, the clock/timer isINTERIM WORK-IN-PROGRESS (8/16/01) NOT FOR GENERAL DISTRIBUTION REFERENCE MANUAL 101

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!