PDA

View Full Version : Unit Error



nat_wheatley
05-15-2016, 09:10 AM
I'm getting the error message 'The file you're running is written for use in inch mode" when I run the attached file. The values are all in millimeters, but how do I tell the control software this?

28221

Gary Campbell
05-15-2016, 11:01 AM
Nat...
That error is the "%(25) kickout to the CN91 unit error message. The line that does it is: "IF %(25)=1 THEN GOTO UNIT_ERROR" near the top

Since Inch units are 0 and metric is 1, I think there is an error in your post Processor. Try changing the "1" to a "0' (zero) and rerun the file.

You should also check that your system is set to metric via the [VD] sheet. If you machine is set to metric then change your post processor.

nat_wheatley
05-15-2016, 11:25 AM
Thanks Gary. This is code generated by the post processor that Enroute is putting together, so I just need to know what to tell them to edit. What generates the the 0 or 1 which dictates whether the file is metric or imperial? I'd expect to see the value called out at the start of the file but don't see it anywhere.

Nat

Gary Campbell
05-15-2016, 11:42 AM
Nat...
The unit error (CN,91) checks the current state of the machine unit setting "%(25)". That system variable is "0" if set to inches and "1" if set to metric. Have Enroute change the 1 to 0 for metric files. Inch files would stay as it is. That line is generated by the post processor and is there to keep users from running a metric file when machine is set to inches and "versa visa"

On a personal note: Metric??? Stilll??? I thought you would have got over that when your mom put you in long pants!!! :) GCMF

nat_wheatley
05-15-2016, 12:05 PM
At the beginning of the file does it need to have the command "%(25)=1" or "%(25)=0" to tell the control software which unit the file has been set up in? I'm just not clear where it's getting that value from.

Metric foreva. 'Once it's set up right, it's fine' he tells himself as he battles with the 4th different software package that just doesn't want to be run in metric...

Gary Campbell
05-15-2016, 12:15 PM
Nat...
That line, which is added to the post, so that it is in the file, checks the SYSTEM variable (in the control brain) for the inch or metric setting.

In the long run you can eliminate it, and you can run just fine without it, but should you need it....... you know.

nat_wheatley
05-15-2016, 12:29 PM
I realize that line is checking the value, I'm just not clear on what is generating the value of that variable. (What puts the 0 or 1 into the control brain, and how is it changed?)

(Maybe I should say, why does the control software look at this file and assign a value of 0 or 1 to the %25 variable?)

I will likely just eliminate the line.

Thanks

Gary Campbell
05-15-2016, 12:59 PM
Nat...
That system variable is one of the "VD" parameters. Open [V] [D] and look under units. Its cleverly hidden in the SB3 menu system. :)

srwtlc
05-15-2016, 01:14 PM
Nat,

SB3 loads that variable into memory upon starting SB3. It's set by changing the value in the VD fill-in sheet.

http://www.talkshopbot.com/forum/attachment.php?attachmentid=28222&stc=1

Here's the explanation of that setting...

Linear Units (default = inches)
Sets the X, Y and Z axes to run in inches (0) or millimeters (1). One inch = 25.4mm. The default is in inches, so the values given in the Unit Values for Different Gear Ratios assume that you are working in inches.
When the unit value is changed, all system values are recalculated according to the new unit type and saved. That means that locations, calibrations, tool sizes, speeds, ramps and so on will automatically be converted to the correct value in the alternate unit system. If you are in inches, all added measurement values need to be entered in inches. If you are in mm, all values need to be entered in mm.

If you remove the line and run the file without changing the 'Linear Units' to metric, your part will come out the wrong size. In this case it would be very large and you will also get numerous parameter out of range errors. Thus the need for the warning.

Parameter out range errors are due to MS values being set to 0,0.

nat_wheatley
05-15-2016, 02:54 PM
Thanks for replies. The control software is set up for metric, and the values in the file are also metric. I've removed the line, and the file is running as needed.

Out of curiousity (and at the risk of asking too many questions) just wondering when the file is run, how does the software know if it was created for metric or imperial? Seems I may be missing something.

Thanks again.

Gary Campbell
05-15-2016, 03:12 PM
Because... (wait for it)....

The "IF %(25)=0/1 THEN GOTO UNIT_ERROR" line tells it to return the error message if control is in one unit and the file is designed in the other. This is the reason this line is in virtually all files.

nat_wheatley
05-15-2016, 03:31 PM
Got it, thanks for your patience.