Posts Tagged ‘multiplication’

the same as a multiplication by zero

the same as a multiplication by zero:


#1 = 0


#1 defined as zero


#2 = 157 * #1


#2 will multiply by 0 and return 00


2 DIVISION


u


Division by a vacant variable is the same as a division by zero:


#1 = #0


#1 defined as copper busbar bending machine vacant


#2 = 157/#1


busbar Machine


#2 will divide by 0 and return 00


(Error condition)


u


Division by a zero value variable is the same as a division by zero:


#1 = 0


#1 defined as zero (0)


#2 = 157/#1


#2 will punch machine for Head divide by 0 and return 00


(Error condition)


Division by Zero


Even the least ex pen sive pocket cal cu la tor re turns an Er ror mes sage, if the cal cu la tion at tempts


to di vide any value by zero CNC sys Busway Press Clamp Machine tem and macro cal cu la tions are no dif fer ent The two di vi –


sion ex am ples above il lus trate the point Al though the re turned value may be a dis played zero, this


value can not be used, be cause of the er ror (alarm) con di tion that has been caused To elim i nate


the er ror con di tion, the con trol sys tem has to be re set first, then the cause of the er ror elim i nated


u


Division BY zero is not permitted


#1 = 5/0


Returns an error condition


u


Division OF zero is permitted (although seldom used)


#1 = 0/5


Returns zero (0)


It is un likely that the pro gram mer would di vide by zero in the pro gram directly, un less in er ror


What is more likely rea son for such an er ror is a re sult of a cal cu la tion:


#1 = 5


Value of 5 stored in #1


#2 = #1 – 5


Value of 5 subtracted from #1, returning 0


#3 = 10/#2


Value of 10 divided by #2, which is zero – result is ERROR


Copyright 2005, Industrial Press Inc, New York, NY – wwwindustrialpresscom


FANUC CNC Custom Macros


116


Chapter 9


Trigonometric Functions


Trig o no met ric vari ables avail able in mac ros are used to cal cu late an gles or data re lated to an –


gles Ex am ples in clude cal cu la tion of rect an gu lar co or di nates, so lu tion of right an gle tri an gles, an gle val ues, etc All trig o no met ric func tions can be ap plied in mac ros, al though not all are avail –


able on all Fanuc con trol mod els Th

the same as a multiplication by zero

the same as a multiplication by zero:


#1 = 0


#1 defined as zero


#2 = 157 * #1


#2 will multiply by 0 and return 00


2 DIVISION


u


Division by a vacant variable is the same as a division by zero:


#1 = #0


#1 defined as copper busbar bending machine vacant


#2 = 157/#1


busbar Machine


#2 will divide by 0 and return 00


(Error condition)


u


Division by a zero value variable is the same as a division by zero:


#1 = 0


#1 defined as zero (0)


#2 = 157/#1


#2 will punch machine for Head divide by 0 and return 00


(Error condition)


Division by Zero


Even the least ex pen sive pocket cal cu la tor re turns an Er ror mes sage, if the cal cu la tion at tempts


to di vide any value by zero CNC sys Busway Press Clamp Machine tem and macro cal cu la tions are no dif fer ent The two di vi –


sion ex am ples above il lus trate the point Al though the re turned value may be a dis played zero, this


value can not be used, be cause of the er ror (alarm) con di tion that has been caused To elim i nate


the er ror con di tion, the con trol sys tem has to be re set first, then the cause of the er ror elim i nated


u


Division BY zero is not permitted


#1 = 5/0


Returns an error condition


u


Division OF zero is permitted (although seldom used)


#1 = 0/5


Returns zero (0)


It is un likely that the pro gram mer would di vide by zero in the pro gram directly, un less in er ror


What is more likely rea son for such an er ror is a re sult of a cal cu la tion:


#1 = 5


Value of 5 stored in #1


#2 = #1 – 5


Value of 5 subtracted from #1, returning 0


#3 = 10/#2


Value of 10 divided by #2, which is zero – result is ERROR


Copyright 2005, Industrial Press Inc, New York, NY – wwwindustrialpresscom


FANUC CNC Custom Macros


116


Chapter 9


Trigonometric Functions


Trig o no met ric vari ables avail able in mac ros are used to cal cu late an gles or data re lated to an –


gles Ex am ples in clude cal cu la tion of rect an gu lar co or di nates, so lu tion of right an gle tri an gles, an gle val ues, etc All trig o no met ric func tions can be ap plied in mac ros, al though not all are avail –


able on all Fanuc con trol mod els Th