Originally Posted by guypb Hi Andre - looks great!
I'm don't understand why you have #102=0 at the beginning of the O1000 program, as this gets overwritten in the O9900 or is part of the sub missing. |
Just a habit of making sure any global vars. are set to some known value.
Also I like to make a list of global variables used within the program and put it at the top with comments so I can find out what it is intended to do. And if I need to add a variable to a program I just use one that is not in the list therefore not step on some other part of the program. That type of thing tends to happen on the shop floor at the control where the text editor and search is not the easiest to use, and things are often a bit tense.
Generating #24 & #25 values is perfect, as I am trying to mimic the variation of a probe on a simulator, so I want values that are randomly within 110% of the tolerance limit of a nominal. |
Like many random number generator functions you just need to you just need to multiply or divide and add on offsets to get numbers in the range you want.
Not quite sure what the relevance of some of the numbers are in your sub, but I'm sure it works and will tell me the number I first though of or my shoe size or something.
When I have access to a control I will give it a try. |
So far I have only run it on back plotter software and not on a real mill.
Got the idea from some web page like this.
http://en.wikipedia.org/wiki/Random_number_generator