#include <stdio.h>#include <stdlib.h>#include <string.h>#include "pmac.h"Include dependency graph for testprobe.cc:

Go to the source code of this file.
|
|
Definition at line 569 of file testprobe.cc. |
|
|
Definition at line 107 of file testprobe.cc. |
|
|
Definition at line 108 of file testprobe.cc. |
|
|
Definition at line 109 of file testprobe.cc. |
|
|
Definition at line 40 of file testprobe.cc. 00044 {
|
|
|
|
|
|
|
|
|
Definition at line 164 of file pmac.cc. 00165 {
00166 #ifndef DEBUG_PMAC
00167 char reply[PMAC_MSG_LEN];
00168
00169 if(pmac_initialized)
00170 {
00171 return;
00172 }
00173
00174 if(NULL == pmac_io_handle)
00175 {
00176 pmac_io_handle = new PHYSMEM_HANDLE(PMAC_IO_ADDR, NT_ISA_IO_ADDRESS, PMAC_IO_SIZE);
00177 if(NULL == pmac_io_handle)
00178 {
00179 #ifndef rtlinux
00180 rcs_print_error( "can't get PMAC IO\n");
00181 #endif
00182 return;
00183 }
00184 if(!pmac_io_handle->valid())
00185 {
00186 #ifndef rtlinux
00187 rcs_print_error( "can't get PMAC IO\n");
00188 #endif
00189 return;
00190 }
00191 }
00192 /* clear serial registers */
00193 pmac_outportb(PMAC_IO_ADDR+5, 0);
00194 pmac_outportb(PMAC_IO_ADDR+6, 0);
00195
00196 /* read any chars from port-- ignore any timeout status since
00197 it will probably time out */
00198 #ifndef WIN32
00199 getline(reply, TIMEOUT);
00200 #else
00201 getline(reply, TIMEOUT/10);
00202 #endif
00203
00204 if(NULL == pmac_dpram_handle)
00205 {
00206 pmac_dpram_handle = new PHYSMEM_HANDLE(PMAC_BASE_ADDR, NT_ISA_MEM_ADDRESS, PMAC_DPRAM_SIZE);
00207 if(NULL == pmac_dpram_handle)
00208 {
00209 #ifndef rtlinux
00210 rcs_print_error( "can't get PMAC DP RAM\n");
00211 #endif
00212 return;
00213 }
00214 if(!pmac_dpram_handle->valid())
00215 {
00216 #ifndef rtlinux
00217 rcs_print_error( "can't get PMAC DP RAM\n");
00218 #endif
00219 return;
00220 }
00221 }
00222
00223 /* put it in online mode */
00224 (void) pmac_online();
00225 pmac_initialized = 1;
00226 #endif
00227 }
|
|
|
Definition at line 229 of file pmac.cc. 00230 {
00231 #ifndef DEBUG_PMAC
00232 pmac_initialized = 0;
00233 if(NULL != pmac_dpram_handle)
00234 {
00235 delete pmac_dpram_handle;
00236 pmac_dpram_handle = NULL;
00237 }
00238 if(NULL != pmac_io_handle)
00239 {
00240 delete pmac_io_handle;
00241 pmac_io_handle = NULL;
00242 }
00243
00244 #endif
00245 }
|
|
||||||||||||
|
|
|
|
Definition at line 258 of file pmac.cc. 00259 {
00260 #ifdef DEBUG_PMAC
00261 return 0;
00262 #else
00263 PMAC_UINT8 byte;
00264 if(NULL == pmac_dpram_handle)
00265 {
00266 pmac_init();
00267 }
00268 if(NULL == pmac_dpram_handle)
00269 {
00270 if(!pmac_dpram_error_message_sent)
00271 {
00272 #ifndef rtlinux
00273 rcs_print_error("Can't read from PMAC's dual-ported RAM.\n");
00274 #endif
00275 }
00276 pmac_dpram_error_message_sent=1;
00277 return 0;
00278 }
00279 pmac_dpram_handle->offset = PMAC_DATA_BASE_OFFSET + index;
00280 pmac_dpram_handle->read(&byte, 1);
00281 return byte;
00282 #endif
00283 }
|
|
||||||||||||
|
Definition at line 293 of file pmac.cc. 00294 {
00295 #ifdef DEBUG_PMAC
00296 return;
00297 #else
00298 if(NULL == pmac_dpram_handle)
00299 {
00300 pmac_init();
00301 }
00302 if(NULL == pmac_dpram_handle)
00303 {
00304 if(!pmac_dpram_error_message_sent)
00305 {
00306 #ifndef rtlinux
00307 rcs_print_error("Can't write to PMAC's dual-ported RAM.\n");
00308 #endif
00309 }
00310 pmac_dpram_error_message_sent=1;
00311 return;
00312 }
00313 pmac_dpram_handle->offset = PMAC_DATA_BASE_OFFSET + index;
00314 pmac_dpram_handle->write(&val, 1);
00315 #endif
00316 }
|
|
|
Definition at line 327 of file pmac.cc. Referenced by pmac_readfloat(), and read_pmac_uint32().
00328 {
00329 #ifdef DEBUG_PMAC
00330 return 0;
00331 #else
00332 PMAC_UINT16 retval;
00333 if(NULL == pmac_dpram_handle)
00334 {
00335 pmac_init();
00336 }
00337 if(NULL == pmac_dpram_handle)
00338 {
00339 if(!pmac_dpram_error_message_sent)
00340 {
00341 #ifndef rtlinux
00342 rcs_print_error("Can't read from PMAC's dual-ported RAM.\n");
00343 #endif
00344 }
00345 pmac_dpram_error_message_sent=1;
00346 return 0;
00347 }
00348 pmac_dpram_handle->offset = PMAC_DATA_BASE_OFFSET + index*2;
00349 pmac_dpram_handle->read(&retval, 2);
00350 return retval;
00351 #endif
00352 }
|
|
||||||||||||
|
Definition at line 362 of file pmac.cc. Referenced by pmac_writefloat(), and pmac_writeint().
00363 {
00364 #ifdef DEBUG_PMAC
00365 return;
00366 #else
00367 if(NULL == pmac_dpram_handle)
00368 {
00369 pmac_init();
00370 }
00371 if(NULL == pmac_dpram_handle)
00372 {
00373 if(!pmac_dpram_error_message_sent)
00374 {
00375 #ifndef rtlinux
00376 rcs_print_error("Can't write to PMAC's dual-ported RAM.\n");
00377 #endif
00378 }
00379 pmac_dpram_error_message_sent=1;
00380 return;
00381 }
00382 pmac_dpram_handle->offset = PMAC_DATA_BASE_OFFSET + index*2;
00383 pmac_dpram_handle->write(&val, 2);
00384 #endif
00385 }
|
|
|
Definition at line 396 of file pmac.cc. Referenced by main(), pmac_at_home(), pmac_at_limit(), pmac_at_sw_limit(), pmac_in_position(), pmac_pos(), pmac_probe_tripped(), pmac_probe_value(), pmac_prog_running(), pmac_spindle_is_open_loop(), and pmac_target_pos().
00397 {
00398 #ifdef DEBUG_PMAC
00399 return 0;
00400 #else
00401 PMAC_UINT16 lo, hi;
00402 PMAC_UINT32 retval;
00403
00404 lo = read_pmac_uint16(index*2);
00405 hi = read_pmac_uint16(index*2+1);
00406 retval = ((PMAC_UINT32)hi << 16) + lo;
00407 return retval;
00408 #endif
00409 }
|
|
||||||||||||
|
Definition at line 435 of file pmac.cc. Referenced by main().
00436 {
00437 pmac_writeint(index, (unsigned int) val);
00438 }
|
|
|
Definition at line 449 of file pmac.cc. 00450 {
00451 #ifdef DEBUG_PMAC
00452 return 0;
00453 #else
00454 PMAC_UINT16 lo, hi;
00455 PMAC_UINT32 temp32;
00456
00457
00458 lo = read_pmac_uint16(2*index);
00459 hi = read_pmac_uint16(2*index+1);
00460
00461 temp32 = (hi << 16) + lo;
00462 return *((float *) &temp32);
00463 #endif
00464 }
|
|
||||||||||||
|
Definition at line 474 of file pmac.cc. 00475 {
00476 #ifdef DEBUG_PMAC
00477 return;
00478 #else
00479 PMAC_UINT16 lo, hi;
00480
00481 lo = (unsigned short) (*((unsigned int *) &val) & 0x0000FFFF);
00482 hi = (unsigned short) ((*((unsigned int *) &val) & 0xFFFF0000) >> 16);
00483
00484 write_pmac_uint16(index*2,lo);
00485 write_pmac_uint16(index*2+1,hi);
00486 #endif
00487 }
|
|
||||||||||||||||
|
Definition at line 668 of file pmac.cc. Referenced by main(), and pmac_sendstring().
00669 {
00670 #ifdef DEBUG_PMAC
00671 printf("%s\n", msg);
00672 return PMAC_ACK;
00673 #else
00674 return pmac_writemsg_bus(msg, reply, len);
00675 #endif
00676 }
|
|
|
Definition at line 679 of file pmac.cc. 00680 {
00681 int timeout = 10*700*PMAC_IO_SPEED;
00682
00683 #if defined(lynxosPC) || defined(linux)
00684 if (NULL == pmac_io_handle)
00685 return PMAC_ERR;
00686 #endif
00687
00688 /* send $$$ */
00689 return sendline("$$$", timeout);
00690 }
|
|
|
Definition at line 693 of file pmac.cc. Referenced by pmac_disable_spindle(), pmac_enable_spindle(), pmac_online(), pmac_probe_off(), pmac_probe_on(), and pmac_program().
00694 {
00695 #ifdef DEBUG_PMAC
00696 printf("%s\n", string);
00697 return 0;
00698 #else
00699 int dperr;
00700 char reply[PMAC_MSG_LEN];
00701
00702 #if defined(lynxosPC) || defined(linux)
00703 /* check for valid pmac address */
00704 if (NULL == pmac_io_handle)
00705 {
00706 /* PMAC not initialized-- init it */
00707 pmac_init();
00708 }
00709 #endif
00710
00711 /* send it out */
00712 if ((dperr = pmac_writemsg(string, reply, PMAC_MSG_LEN)) != PMAC_ACK)
00713 {
00714 /* something went wrong with the write */
00715 pmac_print_error(dperr, reply);
00716 #ifndef rtlinux
00717 rcs_print_error( "command is %s\n", string);
00718 #endif
00719 return -1;
00720 }
00721 else
00722 {
00723 /* command went okay */
00724 return 0;
00725 }
00726 #endif
00727 }
|
|
|
Definition at line 735 of file pmac.cc. 00736 {
00737 /* abort any programs */
00738 if (-1 == pmac_sendstring("A")) /* abort any prog */
00739 return -1;
00740 /* close any buffer */
00741 if (-1 == pmac_sendstring("CLOSE")) /* close any buffer */
00742 return -1;
00743 /* delete any rotary programs */
00744 if (-1 == pmac_sendstring("DELETE ROT")) /* delete any rot buffer */
00745 return -1;
00746
00747 return 0;
00748 }
|
|
|
Definition at line 751 of file pmac.cc. 00752 {
00753 /* abort any programs */
00754 if (-1 == pmac_sendstring("A")) /* abort any prog */
00755 return -1;
00756 /* close any open buffers */
00757 if (-1 == pmac_sendstring("CLOSE"))
00758 return -1;
00759 /* delete any rotary buffers */
00760 if (-1 == pmac_sendstring("DELETE ROT"))
00761 return -1;
00762 /* define the transformation matrix */
00763 if (-1 == pmac_sendstring("DEFINE TBUF 1"))
00764 return -1;
00765 /* define a rotary buffer */
00766 if (-1 == pmac_sendstring("DEFINE ROT 8192"))
00767 return -1;
00768 /* start the rotary buffer */
00769 if (-1 == pmac_sendstring("B0")) /* position rot buff at beginning */
00770 return -1;
00771 if (-1 == pmac_sendstring("OPEN ROT")) /* open it up */
00772 return -1;
00773 if (-1 == pmac_sendstring("R")) /* start running any motions */
00774 return -1;
00775 /* select the transformation matrix */
00776 if (-1 == pmac_sendstring("TSEL 1"))
00777 return -1;
00778 /* initialize the transformation matrix */
00779 if (-1 == pmac_sendstring("TINIT"))
00780 return -1;
00781 if (-1 == pmac_sendstring("ADIS 1")) /* Q1, Q2, and Q3 */
00782 return -1;
00783
00784 return 0;
00785 }
|
|
|
Definition at line 789 of file pmac.cc. 00790 {
00791 #ifdef DEBUG_PMAC
00792 return 1; /* always in position in simulation */
00793 #else
00794 int ipos;
00795
00796 /* set up the ipos index into DP RAM */
00797 switch (axis) {
00798 case 1:
00799 ipos = IPOS_1;
00800 break;
00801 case 2:
00802 ipos = IPOS_2;
00803 break;
00804 case 3:
00805 ipos = IPOS_3;
00806 break;
00807 case 4:
00808 ipos = IPOS_4;
00809 break;
00810 default:
00811 return 1;
00812 }
00813
00814 if (read_pmac_uint32(ipos) == 1)
00815 return 1;
00816 return 0;
00817 #endif
00818 }
|
|
|
Definition at line 822 of file pmac.cc. 00823 {
00824 #ifdef DEBUG_PMAC
00825 return 1; /* always at home in simulation */
00826 #else
00827 int homed;
00828
00829 /* set up the homed index into DP RAM */
00830 switch (axis) {
00831 case 1:
00832 homed = HOMED_1;
00833 break;
00834 case 2:
00835 homed = HOMED_2;
00836 break;
00837 case 3:
00838 homed = HOMED_3;
00839 break;
00840 default:
00841 return -1; /* only 3 axes supported */
00842 }
00843
00844 if (read_pmac_uint32(homed) == 1)
00845 return 1;
00846 return 0;
00847 #endif
00848 }
|
|
|
Definition at line 851 of file pmac.cc. 00852 {
00853 #ifdef DEBUG_PMAC
00854 return 0; /* never at limit in simulation */
00855 #else
00856 int limit;
00857
00858 switch (axis)
00859 {
00860 case 1:
00861 limit = read_pmac_uint32(NEG_LIM_1) == 1 ? -1 :
00862 read_pmac_uint32(POS_LIM_1) == 1 ? 1 : 0;
00863 break;
00864 case 2:
00865 limit = read_pmac_uint32(NEG_LIM_2) == 1 ? -1 :
00866 read_pmac_uint32(POS_LIM_2) == 1 ? 1 : 0;
00867 break;
00868 case 3:
00869 limit = read_pmac_uint32(NEG_LIM_3) == 1 ? -1 :
00870 read_pmac_uint32(POS_LIM_3) == 1 ? 1 : 0;
00871 break;
00872 default:
00873 return -1; /* only 3 axes supported */
00874 }
00875
00876 return limit;
00877 #endif
00878 }
|
|
|
Definition at line 881 of file pmac.cc. 00882 {
00883 #ifdef DEBUG_PMAC
00884 return 0; /* never at limit in simulation */
00885 #else
00886 int limit;
00887
00888 switch (axis)
00889 {
00890 case 1:
00891 limit = read_pmac_uint32(SW_NEG_LIM_1) == 1 ? -1 :
00892 read_pmac_uint32(SW_POS_LIM_1) == 1 ? 1 : 0;
00893 break;
00894 case 2:
00895 limit = read_pmac_uint32(SW_NEG_LIM_2) == 1 ? -1 :
00896 read_pmac_uint32(SW_POS_LIM_2) == 1 ? 1 : 0;
00897 break;
00898 case 3:
00899 limit = read_pmac_uint32(SW_NEG_LIM_3) == 1 ? -1 :
00900 read_pmac_uint32(SW_POS_LIM_3) == 1 ? 1 : 0;
00901 break;
00902 case 4:
00903 limit = read_pmac_uint32(SW_NEG_LIM_4) == 1 ? -1 :
00904 read_pmac_uint32(SW_POS_LIM_4) == 1 ? 1 : 0;
00905 break;
00906 default:
00907 return -1; /* only 3 axes supported */
00908 }
00909
00910 return limit;
00911 #endif
00912 }
|
|
|
Definition at line 918 of file pmac.cc. 00919 {
00920 #ifdef DEBUG_PMAC
00921 return !pmac_online_state;
00922 #else
00923 return read_pmac_uint32(CS_PROG_RUNNING);
00924 #endif
00925 }
|
|
|
Definition at line 932 of file pmac.cc. 00933 {
00934 #ifdef DEBUG_PMAC
00935 return 0.0; /* use _pos[] array if you start
00936 simulating PMAC pos; for now it's
00937 0 for all axes */
00938 #else
00939 int index;
00940 int pos;
00941
00942 /* set up the position index into DP RAM */
00943 switch (axis) {
00944 case 1:
00945 index = ACT_POS_1;
00946 break;
00947 case 2:
00948 index = ACT_POS_2;
00949 break;
00950 case 3:
00951 index = ACT_POS_3;
00952 break;
00953 case 4: /* 4 is spindle */
00954 index = ACT_POS_4;
00955 break;
00956 default:
00957 return -1;
00958 }
00959
00960 pos = (int) read_pmac_uint32(index);
00961 return pos; /* in counts! */
00962 #endif
00963 }
|
|
|
Definition at line 966 of file pmac.cc. 00967 {
00968 #ifdef DEBUG_PMAC
00969 return 0.0;
00970 #else
00971 int index;
00972 int target;
00973
00974 /* set up the position index into DP RAM */
00975 switch (axis) {
00976 case 1:
00977 index = TARGET_POS_1;
00978 break;
00979 case 2:
00980 index = TARGET_POS_2;
00981 break;
00982 case 3:
00983 index = TARGET_POS_3;
00984 break;
00985 case 4: /* 4 is spindle */
00986 index = TARGET_POS_4;
00987 break;
00988 default:
00989 return -1;
00990 }
00991
00992 target = (int) read_pmac_uint32(index);
00993 return target; /* in counts! */
00994 #endif
00995 }
|
|
||||||||||||
|
Definition at line 1000 of file pmac.cc. Referenced by main(), and pmac_sendstring().
01001 {
01002 int error_number;
01003
01004 switch (dperr)
01005 {
01006 case PMAC_ACK:
01007 return;
01008
01009 case PMAC_BUF_TOO_SMALL:
01010 #ifndef rtlinux
01011 rcs_print_error( "buffer too small to hold reply\n");
01012 #endif
01013 return;
01014
01015 case PMAC_BAD_PARAMS:
01016 #ifndef rtlinux
01017 rcs_print_error( "bad parameters to call to pmac_writemsg()\n");
01018 #endif
01019 return;
01020
01021 case PMAC_TIMEOUT:
01022 #ifndef rtlinux
01023 rcs_print_error( "timeout on read from PMAC\n");
01024 #endif
01025 return;
01026
01027 case PMAC_WRITE_TIMEOUT:
01028 #ifndef rtlinux
01029 rcs_print_error( "timeout on write to PMAC\n");
01030 #endif
01031 return;
01032
01033 case PMAC_INVALID_COMM_PARAMS:
01034 #ifndef rtlinux
01035 rcs_print_error( "invalid PMAC comm params\n");
01036 #endif
01037 return;
01038
01039 case PMAC_ERR:
01040
01041 /* line will look like "ERR003" -- scan past the "ERR" */
01042 if (1 != sscanf(&reply[3], "%d", &error_number))
01043 {
01044 #ifndef rtlinux
01045 rcs_print_error( "invalid error string: %s\n", reply);
01046 #endif
01047 return; /* invalid string */
01048 }
01049
01050 /* print the descriptive text */
01051 switch (error_number)
01052 {
01053 case 1:
01054 #ifndef rtlinux
01055 rcs_print_error( "command not allowed during program execution\n");
01056 #endif
01057 break;
01058
01059 case 3:
01060 #ifndef rtlinux
01061 rcs_print_error( "data error or unrecognized command\n");
01062 #endif
01063 break;
01064
01065 case 5:
01066 #ifndef rtlinux
01067 rcs_print_error( "command not allowed unless buffer is open\n");
01068 #endif
01069 break;
01070
01071 case 6:
01072 #ifndef rtlinux
01073 rcs_print_error( "no room in buffer for command\n");
01074 #endif
01075 break;
01076
01077 case 7:
01078 #ifndef rtlinux
01079 rcs_print_error( "buffer already in use\n");
01080 #endif
01081 break;
01082
01083 case 9:
01084 #ifndef rtlinux
01085 rcs_print_error( "program structural error (e.g., ENDIF without IF)\n");
01086 #endif
01087 break;
01088
01089 case 10:
01090 #ifndef rtlinux
01091 rcs_print_error( "both overtravel limits set for a motor in the C.S.\n");
01092 #endif
01093 break;
01094
01095 case 11:
01096 #ifndef rtlinux
01097 rcs_print_error( "previous move not completed\n");
01098 #endif
01099 break;
01100
01101 case 12:
01102 #ifndef rtlinux
01103 rcs_print_error( "a motor in the coordinate system is open-loop\n");
01104 #endif
01105 break;
01106
01107 case 13:
01108 #ifndef rtlinux
01109 rcs_print_error( "a motor in the coordinate system is not activated\n");
01110 #endif
01111 break;
01112
01113 case 14:
01114 #ifndef rtlinux
01115 rcs_print_error( "no motors in the coordinate system\n");
01116 #endif
01117 break;
01118
01119 case 15:
01120 #ifndef rtlinux
01121 rcs_print_error( "not pointing to a valid program buffer\n");
01122 #endif
01123 break;
01124
01125 case 16:
01126 #ifndef rtlinux
01127 rcs_print_error( "running improperly structured program (e.g., missing ENDWHILE)\n");
01128 #endif
01129 break;
01130
01131 default:
01132 break;
01133 } /* case PMAC_ERR */
01134
01135 default:
01136 return;
01137 } /* case dperr */
01138 }
|
|
||||||||||||
|
Definition at line 1215 of file pmac.cc. Referenced by pmac_disable_spindle().
01216 {
01217 int val;
01218
01219 /* clip rpms */
01220 rpms = clip_rpms(rpms, gear);
01221
01222 /* convert rpms to counts */
01223 val = rpms_to_counts(rpms, gear);
01224
01225 /* clip counts */
01226 if (val < -MAX_COUNTS)
01227 {
01228 val = -MAX_COUNTS;
01229 }
01230 else if (val > MAX_COUNTS)
01231 {
01232 val = MAX_COUNTS;
01233 }
01234
01235 val = -val; /* FIXME--works for kt800, remove for
01236 minimill-- need an ini file variable */
01237
01238 pmac_writeint(SPINDLE_SPEED, val);
01239 #ifdef DEBUG_PMAC
01240 printf("setting pmac spindle speed to %d\n", val);
01241 _spindle_speed = rpms;
01242 #endif /* DEBUG_PMAC */
01243 }
|
|
|
Definition at line 1247 of file pmac.cc. 01248 {
01249 /* if we're in on-line mode, *don't* force on-line-- we may have
01250 motions queued that can't be aborted */
01251 if (pmac_prog_running())
01252 {
01253 /* the spindle cannot be enabled when a motion program is running--
01254 it should be done */
01255 /* FIXME-- check queue and report error if any motions are queued */
01256 if (-1 == pmac_online())
01257 return -1;
01258 }
01259
01260 /* format and send on-line kill command */
01261 if (-1 == pmac_sendstring("#4K"))
01262 return -1;
01263
01264 /* disable motor calcs */
01265 if (-1 == pmac_sendstring("I400=0"))
01266 return -1;
01267
01268 #ifdef DEBUG_PMAC
01269 _spindle_enabled = 1;
01270 #endif
01271
01272 return 0;
01273 }
|
|
|
Definition at line 1277 of file pmac.cc. 01278 {
01279 /* command no velocity */
01280 pmac_spindle_speed(0.0, 1);
01281
01282 /* assure on-line command mode */
01283 if (pmac_prog_running())
01284 {
01285 if (-1 == pmac_online())
01286 return -1;
01287 }
01288
01289 /* enable motor calcs and servo here*/
01290 if (-1 == pmac_sendstring("I400=1"))
01291 return -1;
01292 if (-1 == pmac_sendstring("#4J/"))
01293 return -1;
01294
01295
01296 #ifdef DEBUG_PMAC
01297 _spindle_enabled = 0;
01298 #endif
01299
01300 return 0;
01301 }
|
|
|
Definition at line 1303 of file pmac.cc. 01304 {
01305 /* returns 1 if it's open loop, or 0 if it's closed loop.
01306 1 means that we're using it in cutting mode, by writing to
01307 the DAC; 0 means that we're using it for orienting */
01308
01309 return read_pmac_uint32(OPEN_LOOP_4);
01310 }
|
|
|
Definition at line 1317 of file pmac.cc. 01318 {
01319 /* make sure we're in online mode */
01320 if (pmac_prog_running())
01321 {
01322 if (-1 == pmac_online())
01323 {
01324 return -1;
01325 }
01326 }
01327
01328 /* set the I-vars to 2 for rising edge of flag */
01329 pmac_sendstring("I902=2");
01330 pmac_sendstring("I907=2");
01331 pmac_sendstring("I912=2");
01332
01333 /* set the flag to FAULT */
01334 pmac_sendstring("I903=3");
01335 pmac_sendstring("I908=3");
01336 pmac_sendstring("I913=3");
01337
01338 return 0;
01339 }
|
|
|
Definition at line 1344 of file pmac.cc. 01345 {
01346 /* make sure we're in online mode */
01347 if (pmac_prog_running())
01348 {
01349 if (-1 == pmac_online())
01350 {
01351 return -1;
01352 }
01353 }
01354
01355 /* restore the I-vars from P-vars */
01356 pmac_sendstring("I902=P902");
01357 pmac_sendstring("I907=P907");
01358 pmac_sendstring("I912=P912");
01359
01360 /* set the flag to HOME */
01361 pmac_sendstring("I903=0");
01362 pmac_sendstring("I908=0");
01363 pmac_sendstring("I913=0");
01364
01365 return 0;
01366 }
|
|
|
Definition at line 1389 of file pmac.cc. Referenced by PMAC_RETURN_VAL(), and PMAC_UINT32().
01390 {
01391 switch (axis)
01392 {
01393 case 1:
01394 return read_pmac_uint32(CAPTURE_READY_1);
01395 case 2:
01396 return read_pmac_uint32(CAPTURE_READY_2);
01397 case 3:
01398 return read_pmac_uint32(CAPTURE_READY_3);
01399 default:
01400 return 0;
01401 }
01402 }
|
|
|
Definition at line 1368 of file pmac.cc. 01369 {
01370 switch (axis)
01371 {
01372 case 1:
01373 pmac_writeint(CAPTURE_READY_1, 0);
01374 break;
01375 case 2:
01376 pmac_writeint(CAPTURE_READY_2, 0);
01377 break;
01378 case 3:
01379 pmac_writeint(CAPTURE_READY_3, 0);
01380 break;
01381 default:
01382 return -1;
01383 }
01384 return 0;
01385 }
|
|
|
Definition at line 1405 of file pmac.cc. Referenced by PMAC_RETURN_VAL().
01406 {
01407 int value;
01408 int offset;
01409
01410 /* check axis */
01411 if (axis < 1 || axis > 3)
01412 {
01413 return 0;
01414 }
01415
01416 /* read output */
01417 switch (axis)
01418 {
01419 case 1:
01420 value = read_pmac_uint32(CAPTURED_1);
01421 offset = read_pmac_uint32(HOME_OFFSET_1);
01422 break;
01423 case 2:
01424 value = read_pmac_uint32(CAPTURED_2);
01425 offset = read_pmac_uint32(HOME_OFFSET_2);
01426 break;
01427 case 3:
01428 value = read_pmac_uint32(CAPTURED_3);
01429 offset = read_pmac_uint32(HOME_OFFSET_3);
01430 break;
01431 }
01432
01433 /* compute probe value in mm */
01434 return (value - offset);
01435 }
|
|
||||||||||||||||
|
Definition at line 580 of file testprobe.cc. Referenced by PMAC_RETURN_VAL().
|
|
|
Definition at line 603 of file testprobe.cc. |
|
|
Definition at line 639 of file testprobe.cc. |
|
|
Definition at line 585 of file testprobe.cc. |
|
|
Definition at line 598 of file testprobe.cc. |
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001