Version 6 works in graphic mode so there is no delay when switching between alpha and graphic displays.
In this mode there is 20% more room on the screen; this enables displaying 8 axes simultaneously on the screen and displaying 30 lines in the editor (instead of 25).
To run version 5 user programs w/o modifications add in the INI file:
Note: old cnx files must be modified.
The current version number is displayed in the info window after compilation.
To modify user programs to version 6:
 mf(5+$100) mend
This setting is done same as setting Homes (fixture offsets).
For a better security, the superuser has first to set the security level at plc#50 to zero.
Cnx lines n10 to n12 are ignored.
After the setting is done press F10 | End to resume normal security level.
To set the machine zero for an axis move it to the desired position, select Offset #0, and set the axis same as any other home.
Table limits are set the same way, and to select them use alt-P or alt-N for the positive and negative limits. While selected, 'Pos Limit' or 'Neg Limit' is displayed instead of Offset #.
The machine zero and the limits can be set to a position relative to current position, same as regular homes.
You can always see your position or move relative to the limits by selecting them by alt-N or alt-P like the offsets 0 to 9.
To see your position relative to the reference select either Set-Ref or Chk-Ref mode. In these modes the word Reference is displayed instead of Offset #.
For an upgrade, the zero and limits can be manually entered as they were written in the old cnx file as follows:
Open a new file update.txt in the editor.
You have to enter 3 lines, for the negative limit, positive limit, and the machine zero (machine zero is not required if it is all zeros).
In each line there are 8 numbers, for axes 1-8; don't write the letter addresses and enter zeros for non-existing axes. At least one space should separate the numbers.
In the first line copy the negative limit from line n12.
The second line is the positive limit from line n11.
The third line is the machine zero from line n10. Note: enter the negative values of the data in line n10.
CNX n10 x4.5 y2 z1.148 \machine zero n11 x760 y380 z101.6 \pos limit n12 x-762 y-381 z-640 \neg limit UPDATE.TXT -762 -381 -640 0 0 0 0 0 760 380 101.6 0 0 0 0 0 -4.5 -2 -1.148 0 0 0 0 0Save the file in the CNX directory for the new version 6.00.
For a new installation, when the update.txt file does not exist, axes can move up to 1000 mm (40") in SetRef mode (with plc#50 set to zero).
Even before the final setup you can enter temporary limits from the Set-Home screen.
Note that you don't enter the limit but the current position relative to the limit, therefore when you select Positive-limit you enter a negative value.
Enter initial values that are about one half of the table travel.
Enter data in the current unit (inch-mm).
For example, for a 3-axis machine using Inch unit:
The setting is saved in the update.txt file.
If this file is not found when booting, a fatal error is displayed. Superuser can boot w/o this file.
The positive and negative limits are stored as home -1 and home -2.
3 more offsets are available to the user: 10 to 12; they are called by g59.1 to g59.3, and can be selected from the keyboard by alt-A to alt-C.
Offset #3 is called by G+53 and can be set by a superuser same as offset #0.
The position of all homes can be read by Home(H,X) where H is home number and X is axis number.
Note that the positive and negative limits, as well as the machine zero, are relative to the reference, but homes 1 to 12 are relative to the machine zero.
If this data is required for the Plc it can be copied in then body of cnx-114, so that changes made in Set-Home will be effective as soon as another mode is selected.
 ..... putplc(560,home(-2,1)) \put into plc #560 the neg limit for X putplc(561,home(-1,2)) \put into plc #561 the pos limit for Y putplc(562,home(0,3)) \put into plc #562 the machine zero for Z
Previous Cnx overriding codes and calls to them should be deleted. The machine zero should be set at the tool-change position and g-53 moves in m6 re-checked.
Assuming that the above is X-axis, to go to the machine zero write:
g-53 g x
With g53, the most positive X you can go in this example is x-200 (50 relative to 250)
Jogging beyond limits in SetRef mode is available to a superuser only. However, a programmed move (like in cnx-103 or cnx-105) ignores soft limits.
Cnx-114, for all Place's of 16 and above: replace place(xx... ) by place(3xx...)
For new installations there is no reason to use the 300's registers since any register can be displayed.
Place's that display parameters and messages (size=$80) are in the correct location (a space was inserted before).
5.11: locate(22,40) pr 'S=';place(500,0,41,$31) 6.11: locate(22,40) pr 'S=';place(500,0,0,$31) (or place(500,0,42,$31)
The new tool table name is tool.003, and its record size is 56 byte.
The additional TS field, for ball/bull nose radius, is at the end, so there is no change to existing fields.
In the Cnx, find "tool$" and replace 48 by 56:
Open r, #10, tool$, 48Cnx-101: Insert tool length – replace TR by TS
locate(3,22) #112=input(TS)To convert the old table tool.002 to tool.003 use the utility tool.cnc:
open r,#10,cnx$+'\bin\tool.002',48 \old table open r,#11,tool$,56 \new table #107=0.0 \TS=0 while not eof(10) get#10 @(101) put#11 @(101) wend close pr 'Done' m2
#65 by #443 #66 by #453 if #64==3 by if #440&$04
As more NC utilities are available there is a need for extended main menu.
Normally F10 calls cnx-110 with #191=1; however, if a superuser presses F10 for about 0.5 sec then cnx-110 is called with #190=0.
 Main menu if #190==0 then Call 'menu1' \or write it here mend end if #190<>1 then mend end openwindow(25,5,56,21,white,blue) title 'Main Menu' \regular F10 . . . .Both menus return the last key to NCPlus, so by using kb(xx) a menu can leave it to NCPlus to handle the call.
MENU1.CNC menu Utility Menu Trace Test Delta Tau Terminal PLC Registers I/O Map Change Path Fixture Offsets Leadscrew Calibration Program ' Leadscrew Compensation Tables Menu 2 \ key=picklist(40,18,0) closewin if key==1 then kb($31) m2 end if key==2 then call '!!deltau' kb($31) m2 end if key==3 then call 'plc' m2 end if key==4 then kb($34) m2 end if key==5 then kb($35) m2 end if key==6 then call 'ofs' m2 end if key==7 then call 'lead-cal' m2 end if key==8 then call 'lead' m2 end if key==9 then call 'menu2' m2 endm2
This new command is used for placing a vertical or horizontal dynamic color bar on the screen.
The ON command can optionally take ELSE - END to handle out of range values.
This is useful when calling subroutines. Example:
On #1 gosub 100,200,300,400 else . . . . \goes here if #1 is not 1 to 4 end \return here from calls
VGA-BIG.F16 is a font file for big characters, replacing VGA.GHI.
It is used by version 6 and later.
Supported characters are: Space A to Z 0 to 9 . : -
The number of I/O's increased from 288 to 640 (more IO boards are required).
No changes are required for existing Plc programs.
The new driver for up to 40 ports is IOPDRIVE.SYS.
Calling a port with address F** doesn't return error; writing is ignored and reading returns zero.
The old driver PORTSDRV.SYS can be used if less than 288 I/O's are required.
Plc registers 1 to 20 and 101 to 120 are reserved for I/O.
The high byte of each register is used for ports above 20 (input port 21 uses the high byte of port 1). Registers associated with unused ports are free for use but that is not recommended.
The IO test window shows all 16 bits for both inputs and outputs.
To manually set the high bits, hold the Alt key down while typing the bit number.
A new IOPSET.EXE is backward compatible with the old driver.
Upon running IOPSET if either the old or the new driver are found it is opened.
If both are found a menu lets the user select which one to load.
It can also be run as: IOPSET <filename>
A new feature is saving and loading a text file mirror of the IO map.
After editing, <Enter> saves the changes and creates a printable file IOP.TXT.
When a new driver is loaded <F3> can be used to load it with data from IOP.TXT.
IOP.TXT generated with one driver can be loaded into the other. If it is loaded in an old driver then ports above 18 are ignored.
The copying of data from driver to driver that was built in the old IOSET is not required and canceled.
For MPG operated W in Auto mode:
A time constant added. Default is 64 msec. and can be overridden by adding t_ in line n22 where virtual W is set (2 to 250 msec.)
Scale for Mpg can be set in plc#428 to convert tics into mm or inch.
The scale is multiplied by 100 (enter 254 for 2.54).
W is limited to the Z soft limits or zero if Jog-zero is on.
If attempted to move beyond these limits it stops smoothly w/o error, but if a program tries to move Z beyond the limits an error occurs.
Data written to plc#427 can be multiplied by 1, 10 or 100.
It may work with higher multiplier and that should be tested on each machine.
Mpg works in Feed-Hold mode as well.
The Mpg function in Set-Home hasn't changed.
Ks can be used to set the max rpm.
Ks=RPM sets a new value to max-rpm, overriding S-max in n19, and then sets the correct ratio for Ks, to convert Rpm to the PLC scale of 0 to 12,000.
When using Trans to move A instead of Y, setting plc#78 to the A axis number makes the graphic display use A instead of Y too.
See AN-28 (Trans - Leader - Gearbox).
Tapping(C_axis, ratio) begin rigid tapping Tapping(0,0) end rigid tappingThis function is explained in AN-24 (Drilling Canned Cycles).
Highest encoder resolution is 1 nano-meter. This resolution is used internally to increase accuracy.
The unused part of the array memory can be used for extra parameters.
These extra parameters begin at #100 and go up to the maximum available memory.
If arrays are used they should be defined before using any parameter or they'll step on previous parameters.
If used they hide the regular parameters above #100.
The highest available parameter number is displayed in the info window after every compilation.
M101 enables and M100 disables this function. These are compiler directive that do not generate any code. They can be used inside a program more than once as needed.
To set M101 as default enter m101 in the machine data, line n100.
MDI default is M100. Use M101 with caution to access the extra parameters in MDI because they may reside in different memory locations for different programs.
It is recommended to always use either m100 or m101 in utilities that may be used on different machines.
This is done by setting plc#66 to the percentage. 0% is same as 100%.
Plc#66 can be set by a selector, up/down pushbuttons or keys, e.g. 1 to 4 for 25% steps.
This percentage is applied to G0 only. The regular feed override affects all motions.
The G0 no-override (100%) can be set to follow the regular override below some threshold.
For that a selection of 300% or 400% (up to 999%) can be used.
Since G0 cannot run faster than 100%, it will stay 100% until the feedrate override is down to 33% or 25%.
Below that the feed override will reduce G0 feed as well.
PLC  if #59<>0 then else . . . . if #88>=$30 and #88<=$34 then if (#66=(#88-$30)*25)==0 then #66=300 end endNote that using the number-keys may interfere with menus.
PLC  getport(6) \existing feed override code if (#6^#134)&$30 then #33+=encoder(#135,#6/16) #134=#6 end if #33 then if #59==5 then #133+=#33 #33=0 end if #59==0 and #54&3<>0 then \G0-override --> if shift if (#66+=#33*20)<=20 then #66=20 end if #66>=100 then #66=100 end \for 300% use: if #66>=300 then #66=300 end #33=0 end end CNX  . . . . color(15,0) if #190<=2 then \Auto/graphic locate(2,55) pr 'G0= %'; place(66,0,col-6,$31); place(191,2,44,$71) \Program Timer, see Place Command else putplc(66,100) end
DT channels can be associated with NCPlus axes not in their sequential order.
In the INI file define the order, for example:
Axes=xyzab dtsx=12356This can be used to reserve DT's channel #4 for the spindle and use channels #5 and #6 for the 4th and 5th axes.
Axes=xyzabu dtsx=123564Notes: If the dtsx= line is missing or not the same length as the Axes= line then sequential order is used.
This function should be used with DT mapping to convert axis number to DT channel number.
For the example above, dts(41) returns 51 (axis #4 uses DT channel #5).
In cnx-103 and cnx-113, where axis number is negotiated with DT use:
pokel($820,dts(31)) instead of pokel($820,31) until peekl($820)==dts(21) instead of until peekl($820)==21The DTS function calculates the conversion at compile time, therefore the CNX file should be recompile after modifying either the axes= or dtsx= lines.
Both G and M accept numbers with one decimal:
While reading the value of G or M in the cnx or plc#29 in the plc, numbers w/o decimals are returned as they are entered.
If a decimal exists it is added to the number multiplied by $100 (256).
M-functions call their corresponding cnx routine based on the integer part of the number. The routine may check for decimals or ignore them. The programmer should decide whether to display error messages for invalid decimals.
User defined g-codes are checked in cnx-115 and if no routine is found an error is returned.
Using parameters with G or M:
Incorrect Correct Correct #100=1.1 #100=$101 #100=g . . . . . . . . . g#100 g#100 g#100
G51 has been replaced by g5.1 (graphic zero). This frees g51 for a user defined function.
Note: Replace G51 in CNX-110.
G-codes G20 to G25 have been replaced by G10.1 to G15.1
This frees g20/21 to be used instead of g70/71.
Either G20/G21 or G70/G71 can be used.
To select G20/G21 set bit $8000 of plc#79 (drilling CC-set, currently set in plc-3 to $102 or $106).
These codes are used with tool compensation to approach a contour similar to positioning (tangent to the next move) but using feed.
They are one shot and are converted to g1 and g11.
Same approaching procedure is used if g1 or g11 is the first g-code after g41/g42.
G59.1 to g59.3 use offsets 10 to 12.
To select these offsets from the keyboard use alt-A to alt-C.
These codes can be programmed with other g-codes in the same block.
G53 and offset #0 use xyz data in current unit (inch-mm). However, tool length, scale, rotation, and g91 are ignored.
G-53 is for use in the Cnx file.
G+53 is for use in the cnx. It is a single shot like g-53 but it uses offset #3 as reference. It can be used in a g28 routine so that a Superuser can set it in set-home mode.
G-53, G+53, set-ref and chk-ref always use xyz data in mm.
Current home is saved in plc#96 (-2 to 12).
G-home 53 to 59.3 is saved in plc#95.
If a routine sets any home below g53 the user's home can be restored by:
g=getplc(95)The letter address O is not used anymore.
g92 g5* (g54 to g59.3) sets the offset relative to the machine zero.
To set offset #5 at x10 y20:
g92 g55 x10 y20Axes that are not written do not change.
g92 g55 x=home(4,1)+10 y=home(4,2)+20g92 must be written before g55, or g55 will be active first and then a regular g92 will be executed, same as:
g55 g92 x_ y_Note that setting home sets the offset so that the programmed position becomes current.
Compensation data is entered via a built-in data-entry program.
The span between the data points must be a whole number of millimeters.
NCPlus dynamically interpolates the compensation data for every mm between the given points.
The compensation data has the following structure:
Most Negative ... [mm] Most Positive ... [mm] Span ... [mm] pos1 comp1 pos2 comp2 ... ... posn compn
The program asks for axis number and unit for the comp data, which can be either microns or tenths.
If a data file exists it is displayed, otherwise a blank page opens.
After the first 3 values are entered the program builds the position table and the user can enter the comp data.
When the program terminates the file is saved.
Upon Corr(on) the new file is loaded.
Graph command is replaced by new commands.
x,y are coordinates or x-y related data, c=color:
pixel(x,y,c) lineto(x,y,c) gain(x,y1,y2) scope(reg,Ypos,c)
Light color names can be shortened to Lcolor:
Lred instead of Lightred
Lgray (7) Lblue (9) Lgreen (10) Lcyan (11) Lred (12) Lmagenta (13)
To begin graph mode use the current grid command:
where x and y are the graph zero.
The graphic screen is 640x480 pixels, therefore screen center is at 320,240; bottom-left is 0,0.
All subsequent commands use these XY as zero.
Pixel displays a pixel at x,y.
Lineto draws a line from current xy to the new xy.
To go to a starting point draw a line with color=0 or put a pixel.
Gain sets the gain for a dual trace oscilloscope mode.
X is the time base, in msec per pixel, 1 to 30000 (0 for XY mode).
Y1 is the gain for channel #1 and Y2 is for channel #2. The range is 0.001 to 30.
When selecting the gain, note that the plc regs hold numbers up to +-32767.
Y1 and/or Y2 can be negative to reverse the polarity.
Scope takes a plc register-number to display.
Reg zero (or above highest) is not displayed.
PosY is an offset in pixels from Y-zero.
C is the color.
Channel selection is done by adding a constant to the color:
none = Set channel #1 only
$100 = Set channel #1, leave #2 unchanged
$200 = Set channel #2, in addition to #1
If the time base is zero the scope runs in XY mode where channel #2 is X. The color for channel #2 is ignored (can be zero).
This continues even when the program ends.
If motion is displayed it should be programmed after Scope.
Motion parameters that are of interest are trace error (#391 to #398) position (#21 to #28), leadscrew comp (#401 to #408).
The following example displays the leadscrew comp graph vs. for X-axis.
Note the use of home() to find the positive and negative limits.
n\XY scope, leadscrew comp corr(on) g-53 g x=home(-2,1)-home(0,1) \negative limit grid(0,240,blue) format(5,0) color(lblue,0) locate(15,2) For #1=1 to 15 pr #1; next #1 gain(0,1,1) \XY mode scope(401,0,white) \Y=leadscrew comp scope(21,600,$20E) \X=X-pos g-53 g x=home(-1,1)-home(0,1) \positive limit m2The following example displays the trace error for X and Y when cutting a 90 deg corner where Y changes direction.
n\Dual channel scope, Corner and TC test g mm x-200 y z #2=2 \X time base msec/pixel corner(10) tc(20) \L and n in n18 grid(0,240,blue) format(5,0) color(lblue,0) locate(15,2) for #1=1 to 15 pr #1; next #1 locate(16,63) pr #2*40,' msec/div' gain(#2,.03,.03) scope(391,80,white) \Trace error scope(392,-40,white+$200) g1 x+50 y+20 f10000 g1 x+50 y+-20 d.1 corner(100) tc(60) scope(391,80,yellow) scope(392,-40,yellow+$200) g1 x+50 y+20 f10000 g1 x+50 y+-20 m2
This command was modified as follows:
1 - 15: as before. 16 : column for the min-max values in SetHome. 17 - 20: reserved. 21 -699: PLC register to display.
Size of $71 (or $73) displays time format- HH:MM:SS
R is the first in a pair of 2 plc regs.
The first is the time in seconds up to 3599,
The second is time in hours, up to 99 (100 rollovers to zero).
if #190 then \one shot from cnx-107 #190=#191=#192=#193=(0) \Reset Timer end if #60|1==3 and #61 then \if running or dwell, excluding feed-hold if (#193+=1670)>30399 then \New Sec. #193-=30399 if (#191+=1)>=3600 then #191=0 #192+=1 end end end
place(191, row,col,$71) \See G0 Override
 Cycle Start . . . . if getplc(60)==0 then . . . . putplc(190,1) \Program Timer Clear end Mend
When the size is 5 (or 7), if the ones digit of Reg is an axis number, the contents of that register is displayed as dimension for that axis, assuming that it holds encoder counts.
The display begins with the axis letter and follows inch-mm switching.
If the size is a single digit the number is formatted as an axis and displayed in the axis' color.
Place(1,20,2,1) \Display X Place(331,21,2,5) \Display X from encoder counts in plc#331 Display: x 456.000 x 0.012If the size includes the number of digits to display then the current color is used, same as with other Places.
For on-the-fly assign in the PLC:
#321=#412*#410 #322=#414*#410 #323=#416*#410#409 is not required.
. . . . openw(43,16,78,22,black,7) title 'Offset' color(black,7) place(321,1,13,$35) place(322,2,13,$35) place(323,3,13,$35) . . . .
All axes can be followers in any combination.
Follower() takes axis number for On and negative number for Off;
Zero clears all followers.
Follower(2) Follower(3) follower(-2)
Follower plc regs:
#440 - bit per axis x=1, y=2, z=4 ... (info only) #441 to #448 correction (used to be #65) #451 to #458 gain (used to be #66)
plc regs #64, #65, #66, #94, #95, #96 are reserved.
putini('var', dat) dat can be either a string (as before) or a number (up to 8 decimals are saved).
Getini$('var") returns a string, as before.
Getini('var') returns a number.
Length(x,y) - SQRT(sum Squares) can take more arguments:
#1=len(1,2,3,4,5) - up to 255
It also does tool radius comp for 5-axis profiling.
This function requires a post-processor generated contouring file of g1 moves with the normal vector given in each block under IJK.
G41.1 and G42.1 activate the 3D cutter radius compensation.
G42.1 uses negative IJK vector, same as using negative TR & TS.
The tool table has been expanded to hold the bull nose smaller radius.
For a ball nose enter tool radius in that column.
The additional radius is stored at the end of the old record, so there is no change in access to current fields.
While reading tool data, the new radius is copied to variable TS, along with TL and TR.
if #1<>0 and #2<>0 then... #1= #1&$04<>0 and #2&$08<>0In version 6 these statements work just fine (in both plc and cnx programs):
if #1 and #2 then... #1= #1&$04 and #2&$08
M2 resets internally the Program-Line-Display
Tabs: the compiler treats Tab same as space (couldn't be compiled before).
Help window is wider and accepts lines of up to 77 characters (instead of 64).
Input is left by:
Enter, Esc, Tab, @Tab, Up, Dn, PgUp, PgDn.
Trace command was renamed to buffers. This command lets you reduce the number of buffers if so desired. (required in cases of real-time feedback).
sign(x) returns -1 if x is negative and 1 otherwise.
This cnx function is used to change sign by multiplication instead of if-then statement.
RandSeed sets the built-in random number generator's seed.
By assigning a specific value to RandSeed, the Rnd function can be made to repeatedly generate a specific sequence of random numbers.
To generate an unpredictable sequence use:
CNXdir$ returns the CNX directory.
Big('text') displays text in double size characters. (See Font File above for 6).
Aspect ratio is the ratio between screen's X and Y. For a screen with resolution of 640x480, 800x600 or 1024x768 it is 1 and needn't be set. For resolution of 1280x1024 it is 0.9375 and it is entered in line n100 under @R (where the screen default zoom is entered under R).
G-7 (for 3 point arc or circle) has been replaced by g7; use g7 in the first block and no g-code in the second.
After the second block the g-code becomes g1.
User defined g-codes in cnx-115
Using G4 in the last line of a G-code routine (to make it non-modal) resumes the user g-code before the user-defined code was called. (Used to return G4).
Trace test: all axes can be displayed. It is recommended to use small font in the Place command (size=1).
 . . . . n11440 \chktrace place(1,4,2,1) \X place(2,5,2,1) \Y place(3,6,2,1) \Z . . . .
Trace error in plc#391 to #398 is normalized to +-1000, based on G-zero max feed, by setting S in n18 to the actual servo time constant (it takes decimals too).
Virtual W can work together with the old on-the-fly.
Projection, Jig, Virtual, Magnify, Loctable, Location.
L and O addresses are not used (may be used for passing data to subroutines, like n).
Cnx n26 and plc#78 for collision between 2 robots.
Teach-box support, Location-Table, and 3D correction have been canceled.