Description
Searches the string within the NC program.
The basic order to search is as follows.
The conditions of the function about CNC mode and the kind of programare as follows.
EDIT mode | MDI mode | Other mode | |
MDI program | × | O | × |
Selected program | O | × | × |
Not selected program | O | O | O |
If you have the playback option, TJOG/THND mode is the same as EDIT.
This function works normally if OP signal is 1 but STL signal is 0 (for example, feed hold stopping, single block stopping, etc).
After you use this function for the MDI program or the selected program in the following situations, the execution pointer goes to a certain place.
- MDI program in MDI mode.
- Selected program in EDIT mode.
- Selected program in TJOG/THND mode with the playback option.
In those cases, the execution pointer moves to the following place.
- If the target string could be found, the pointer would move to the line where includes the target string.
- If the target string could not be found, the pointer would move to the top of the program in case of the parameter "direct=0", or the bottom of the program in case of the parameter "direct=1".
Universal Fanuc Driver
Fanuc Focas Library CD
Declaration
Arguments : HSSB
Specify the library handle. See "Library handle" for details.
Specify the program number to search.
When you write the MDI program, you have to specify -1.
Specify the line number to search from.
When you search from the first line of a program, you have to specify 0.
When you specify other than the existing line number, this function never returns error result as the return code.
In this case, next cnc_searchresult function would return EW_NUMBER error.
Specify the type of the search operation.
0 | : | Character search (Search the one address character.) |
1 | : | Word search (Search the string by word basis.) |
2 | : | Last line search (Search the bottom of line) |
When you commands "Character search", you have to set the only one address character as the target string.
If you set except the address character or more than two characters, this function returns EW_DATA error.
When you commands "Word search" for the only one address character, you have no error and the address character is going to be searched.
When you commands "Last line search", this function ignores the parameters direct, repeat and prog_data.
Specify the direction to search.
0 | : | Search towards the top of the program. |
1 | : | Search towards the bottom of the program. |
Specify the limitation of times the string is found when there are many strings matching within the program.
If you specify 0, this function returns EW_DATA error.
Specify the pointer to the buffer holding the target string to search.
It is a NULL terminated ASCII string. The size of string, including NULL character, must be within 34(30i/31i/32i, 0i-D/F, PMi-A:127). If it were more than maximum charactors, this function would return EW_DATA error.
The first character of the string must be an address character (G, F, etc).
After the address character, the next character must be a number, '+', '-' or '-'.
If you use one of the following characters, you get EW_DATA error as the return code.
- Except the available code for CNC
- The small letter of alphabets
- Address 'O' or the string consisted of 'O' + program number
- '%'(EOR)
Return
EW_OK is returned on successful completion, otherwise any value except EW_OK is returned.
The major error codes are as follows.
Return code | Meaning/Error handling | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
(-1) |
|
||||||||||||||||||
(5) |
In order to get more information for this err_no return value, execute cnc_getdtailerr function. The following detail status will be set onto the member, err_no of ODBERR structure.
|
||||||||||||||||||
(6) |
The extended driver/library function is necessary. |
||||||||||||||||||
(12) |
|||||||||||||||||||
(7) |
CNC parameter is a state of write-protection(O8000-/O9000- protection, encoding). |
||||||||||||||||||
(13) |
|
As for the other return codes or the details, see "Return status of Data window function"
CNC option
For HSSB connection,
The extended driver/library function is necessary.
CNC parameter
This function is not related to CNC parameter.
CNC mode
Available CNC
0i-A | 0i-B/C(Note) | 0i-D | 0i-F | 15 | 15i | 16 | 18 | 21 | 16i-A | 18i-A | 21i-A | 16i-B | 18i-B | 21i-B | 30i-A | 30i-B | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
M (Machining) | |||||||||||||||||
T (Turning) | - | ||||||||||||||||
LC (Loader) | - | - | - | - | - | - | - | - |
0i-D | 0i-F | 16i | 18i | 30i-A | 30i-B | |
---|---|---|---|---|---|---|
P (Punch press) | - | |||||
L (Laser) | - | - | - | - | ||
W (Wire) | - | - |
Power Mate i-D | |
Power Mate i-H | |
Power Motion i-A | O |
"O" | : | Both Ethernet and HSSB | |
"E" | : | Ethernet | |
"H" | : | HSSB | |
"X" | : | Cannot be used | |
"-" | : | None |
Note) 0i-C does not support the HSSB function.
See Also
cnc_rdprogline cnc_rdprogline2 cnc_wrprogline cnc_delprogline cnc_searchresult