Changeset 1716 for trunk/MagicSoft


Ignore:
Timestamp:
01/20/03 13:41:19 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/aposs/Manual.m

    r1675 r1716  
    44/*                                                                         */
    55kVERSION    = 0   /*                                                       */
    6 kSUBVERSION = 2   /*                                                       */
     6kSUBVERSION = 3   /*                                                       */
    77/*                                                                         */
    88/*  HISTORY:                                                               */
     9/*                                                                         */
     10/*   * V0.3:                                                               */
     11/*       - added support for the elevation axis brake                      */
     12/*       - enabled check for operation mode (remote control/pc)            */
     13/*       - added 'reset' label                                             */
     14/*       - moved syncv/cstart to setting rf                                */
    915/*                                                                         */
    1016/*   * V0.2:                                                               */
     
    135141
    136142/*-------------------------------------------------------------------------*/
    137 /* Make sure 'Reglerfreigabe' not set                                      */
    138 /*-------------------------------------------------------------------------*/
    139 RF = 0
    140 out 1 0
    141 out 2 0     
    142 
    143 /*-------------------------------------------------------------------------*/
    144143/* Error routine                                                           */
    145144/*-------------------------------------------------------------------------*/
     
    151150/* mainloop rotation mode but stand still                                  */
    152151/*-------------------------------------------------------------------------*/
    153 if (get cannr==1) or (get cannr==3) then
    154    print "Starting..."             
    155 else         
    156    /*motor off /* switch off motor controlling: No 'Schleppfehler' */
    157    print "Synchronizing..."             
    158    motor on
    159    syncv
    160 endif     
     152                             
     153brake = 0
     154   
     155reset:   
     156   out 1 0
     157   out 2 0   
     158   RF = 0
     159   motor off   
     160   waitt 1000
     161   
     162   if (brake==1) then         
     163      waitt 3000          /* wait 3s for DKC to stop the motor */
     164      out (kIoModule+1) 0 /* brake the brake                   */
     165      waitt 1000
     166   endif   
    161167         
    162168mainloop:       
     
    168174   if (get cannr==1) or (get cannr==2) then
    169175       ready = in 1
    170    elseif get cannr==3 then
    171        ready = in (kIoModule+5)
     176   elseif (get cannr==3) then
     177       ready = in (kIoModule+5)  /* !!!FIXME!!! */
    172178   endif   
    173179       
    174    if fuse==0 then
     180   if (ready==0) and (RF==1) then
     181      print "DKC not ready, but RF set... setting RF=AH=0!"
     182      goto reset
     183   elseif fuse==0 then
    175184      print "Motor-Power Fuse not OK!"
    176       waitt 500
    177       goto mainloop
     185      goto reset
     186   elseif vltg==0 then
     187      print "Overvoltage control broken!"
     188      goto reset
    178189   elseif emcy==0 then
    179190      print "Please release Emergency Stop!"
    180       waitt 500
    181       goto mainloop
    182    elseif vltg==0 then
    183       print "Overvoltage control broken!"
    184       waitt 500
    185       goto mainloop
    186 /*     
    187    elseif mode==1 then
     191      goto reset
     192   elseif mode==0 then
    188193      print "Control not in manual mode!"
    189       out 1 0
    190       out 2 0
    191       waitt 500
    192       exit
    193 */                 
    194    elseif (ready==0) and (RF==1) then
    195       print "DKC not ready... setting RF=AH=0!"
    196       out 1 0
    197       out 2 0   
    198       RF = 0
    199       motor off
    200       waitt 1000
    201       goto mainloop   
     194      goto reset
    202195   elseif (ready==1) and (RF==0) then
    203196      print "DKC powered, RF=0... setting RF=AH=1!"
     
    216209      RF = 1
    217210      waitt 100
     211
     212      if (brake==0) then
     213         out (kIoModule+1) 1
     214         brake = 1
     215         waitt 1000
     216      endif
     217
    218218      motor on
    219       cstart
    220       /*waitt 100*/
     219         
     220      if (get cannr==2) then
     221         syncv
     222         print "Synchronizing speed..."             
     223      else   
     224         cstart
     225         print "Starting revolution mode..."             
     226         waitt 500
     227      endif   
    221228   elseif (ready==0) or (RF==0) then
    222229      goto mainloop
     
    246253      out 2 0
    247254      RF = 0
    248       waitt 100     
     255      waitt 100
     256     
     257      if (brake==1) then
     258         waitt 5000
     259         out (kIoModule+1) 0
     260         waitt 500
     261      endif         
    249262
    250263      print "Error #", errno
Note: See TracChangeset for help on using the changeset viewer.