•Port Settings
◦Baud rate, Data bit's, Stop bit's, Parity, Flow control (handshake) must match exactly settings in your CNC control otherwise nothing or unreadable characters will be received.
◦XON/XOFF – Characters are used only in EdytorNC (they are not passed to serial port) and if set they work in all Flow control modes.
◦Auto close transmission dialogue – After sending or receiving dialogue will be closed automatically after this time.
•Options – receiving
◦Remove white space at end of line – Remove white space added by some CNC controls at end of line.
◦Remove empty lines – Remove empty lines.
◦Delete control chars – Remove ASCII control characters (usually not printable).
◦End of receiving – Receiving will be ended and received data become processed and/or auto close timer will be started when (which one first):
▪Time out – This timer is started after receiving first character and it is reset every next character received. If transmission stops for time longer than set receiving will be ended.
▪End of program characters – Regular expression used to detect end of program.
Example:
(M30|M02|M2|M99)[\n\r\s]{1,}%
•Options – sending
◦Start delay – Before sending program waits for (which one first):
▪Wait for CTS – Wait for hardware Clear To Send signal.
▪Wait for XON – Wait for XON character.
▪Start sending after – Waiting for the time to expire.
◦Send at start – Add text at the beginning of the file.
You can write here:
•Plain text
•Hex codes of ASCII characters.
Example:
% 0x0A 0x0D - % and new line characters
0x20 0x0A 0x0D – space character and new line characters
Space and control characters can only be written as hex numbers:
0x20 (space), 0x13 (XOFF), 0x11 (XON)...
•Special characters codes can be used:
LF – Line Feed also Carrige Return (replaced later by end of block characters)
SP – Space
TAB – Tabulation
FN – File name without extension
FE – File name Extension (part after dot)
FA – File name extension Appended at end of file name (part after _ character and before dot)
◦Send at end – Add text at the end of the file.
◦End of block characters – Select end of block (line) characters.
◦Delay before sending next block – Wait set time before sending next program block (line). Useful for slow CNC controls.
◦Send time out – After this time transmission will be cancelled. Timer starts after sending first character.
◦Remove characters before % – Remove characters from beginning of the file to percent sign.
•Auto save
This function is used to automatically save received program.
◦Save path – Set path to directory where received files will be saved. It is recommended to use different path than for files to send.
◦Default extension – Default file extension for saved files
◦Build-in name detection – Program name will be detected using build-in expressions and then used as file name.
Regular expressions used:
▪New SINUMERIK (like 840D)
%_N_[a-zA-Z0-9_]{1,31}_(MPF|SPF|TEA|COM|PLC|DEF|INI)
▪OKUMA OSP
\$[A-Z]{1,1}[A-Z0-9_-]{1,}\.(MIN|SSB|SDF|TOP|LIB|SUB|MSB)[%]{0,1}
▪Fanuc (colon character (:) is always replaced by letter 'O')
(?:\n|\r)(O|:)[0-9]{1,}
▪Old Sinumerik (like 810M)
%\b(MPF|SPF|TEA)[\s]{0,3}[0-9]{1,4}\b
▪HEIDENHAIN ISO
%[a-zA-Z0-9_]{1,30}(\s)
▪HEIDENHAIN
(BEGIN)(\sPGM\s)[a-zA-Z0-9_-+*]{1,}(\sMM|\sINCH)
▪Philips
%PM[\s]{1,}N[0-9]{4,4}
◦User expression – User defined expression is used to find file name in program (e.g. written in comment (O1234.CNC)).
Examples:
▪Fanuc like program name (e.g. O1234 or :1234) four digits long with extension (e.g. .NC or .A or .B) written in parenthesis
\((O|:){0,1}[0-9]{4,4}\.(NC|A|B){1,1}\)
▪Only four digits program name in parenthesis
\([0-9]{4,4}\)
▪to match parenthesis
\( some text \)
▪to match letters
[A-Z]{min amount, max amount} e.g. [A-Z]{1, 10} match minimum one letter and maximum 10
▪to match letters, digits and other characters
[A-Z0-9,;-]{min amount, max amount} e.g. [A-Z]{2, 5} match minimum two letters and/or digits and/or ,;- and maximum 5
▪to match some text
(ABC|DEF) matches text ABC or DEF
▪In EdytorNC you can test regular expression in menu Tools →function Clean up
▪colon character (:) is always replaced by letter 'O'
▪( ) [ ] , * ; characters are removed from detected file name
◦Use program name extension as file extension – If detected file name contains "extension" (e.g. MPF in %_N_PR25475002_MPF, MIN in $O0004.MIN% or MPF in %MPF456...) it will be used as extension of saved file. Setting "Default extension" will be ignored.
◦Remove letters from file name – Letters in detected file name will be removed (only digits will be left). If in result file name becomes empty, version with letters will be used.
◦Change file name to lower case – Letters in file name will be in lower case (useful for case sensitive file systems).
◦Append extension at end – If detected file name contains "extension" (e.g. MPF in %_N_PR25475002_MPF, MIN in $O0004.MIN% or MPF in %MPF456...) it will be used as part of file name. At end of the file name after character '_' (e.g. O0004_MIN.nc). Default file extension will be used.
◦Split programs – If received data will contain more than one CNC program they will be saved in independent files. Data loss can happened if detection of program name fails.
◦Create backup if file exists – If save path already contains saved file, old file will be renamed to *.bak
◦Create log file – Some debug information will be saved to file. File will be created in “Save path” with name “Settings name”_serial_log.txt
◦Write data to log file – Received data will be saved in log file.
•File server
With file server you can download CNC program to machine and/or save it into computer remotely. Auto save must be enabled to use File server function.
How this works:
•In CNC control create small program “Caller”, for example (Fanuc) O5555 in parenthesis write program number that you want download to CNC
%
:5555
(O4568)
M30
%
•Send (punch) this program to computer, in response computer will send you requested program.
•As soon as possible, set CNC to receiving mode (Read), after few seconds (Receiving time out plus Start sending after) you should see incoming transmission with program O4568.
•Any time you can also send CNC program to computer, it will be saved.
◦Caller file name – File name without extension of the program used to initiate transmission. Caller file name is always detected using build-in name detection.
◦Search for file name – Regular expression used to find file name which will be sent back to CNC
Examples:
▪Match, zero or one letter 'O' or colon four digits, zero or one dot and zero or one text NC or CNC in parenthesis
\((O|:){0,1}[0-9]{4,4}(\.){0,1}(NC|CNC){0,1}\) e.g. O7582, O4589.NC, 8526, 1234.CNC
▪In EdytorNC you can test regular expression in menu Tools →function Clean up
▪colon character (:) is always replaced by letter 'O'
▪( ) [ ] , * ; characters are removed from detected file name
◦Search path 1,2,3 – Folders to look for files to send. First is checked path 1 then 2 and last path 3.
◦Extension – If found file name will not contain extension this extension will be used.
◦Reconnect time – If serial port will not be open, try to open it after this time.
“Caller” program for Fanuc CNC:
%
:5555
(O4568)
M30
%
Some settings should be:
File server:
Caller file name: O5555
Search for file name: \((O|:){0,1}[0-9]{4,4}(\.){0,1}(NC|CNC){0,1}\)
Options – receiving:
Time out: 3-5s
Options – sending:
Start sending after: about 10s (time for operator to set CNC into receiving mode (Read))
or
Set Wait for CTC or XON
For more help:
https://plus.google.com/communities/117267107585407507443
* This file is part of EdytorNC. *
* *
* EdytorNC is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *