CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > CAM Software > OneCNC


OneCNC Discuss OneCNC software here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-09-2003, 06:03 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,823
HuFlungDung is on a distinguished road
Find and Replace

I'm hoping someone has a simple answer to this question: my Shadow controllers use a "/" to designate a rapid move. The / must appear before each axis in a move like this
/X /Y /Z
for a three axis move.

So I have my XP post driver set up to do Rapid Line format like this:

{G}{X} {G}{Y} {G}{Z}

This works fine all the time if I uncheck "coordinates modal."

However, I hate that method because of the clutter and would much prefer to run with "coordinates modal". The problem occurs that whenever a duplicate move would have been inserted, that the rapid axis movement is deleted but the "/" remains.

I can easily use "find and replace" to get rid of most of these "/"'s by entering a "/+space" in the find box and leave the replacement box empty.

However, there are some instances when the "/" is alone at the end of a line, preceded by an X and/or Y move. This means that a Z was deleted because of the coordinate modality.

I cannot figure out a way to quickly delete all these "end of line" slashes without painstakingly going through all the code to check. If they are present they do cause the controller to hang.

Any Ideas? Is there a secret way to search for a character at the end of a line, which I presume is followed by a return character?
__________________
First you get good, then you get fast. Then grouchiness sets in.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #2  
Old 05-09-2003, 06:53 PM
wms's Avatar
wms wms is offline
Moderator
 
Join Date: Mar 2003
Location: United States
Posts: 938
wms is on a distinguished road
Hu,
Have you tried a replace " / (carriage return)" with a "carriage return" ?
__________________
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #3  
Old 05-09-2003, 06:59 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,823
HuFlungDung is on a distinguished road
There seems to be no way that I can insert an ASCII character 10 or an ASCII character 13 in the search field.

Is there any special prefix character a person can use to fool the seach function?
__________________
First you get good, then you get fast. Then grouchiness sets in.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #4  
Old 05-09-2003, 07:22 PM
wms's Avatar
wms wms is offline
Moderator
 
Join Date: Mar 2003
Location: United States
Posts: 938
wms is on a distinguished road
Hu,
In the find and replace window type:

Find what box) / then enter
replace with box) just enter
Then click on replace all.

I just tried this and it worked for me.
__________________
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #5  
Old 05-09-2003, 07:34 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,823
HuFlungDung is on a distinguished road
Pressing enter causes me to leave the search dialogue immediately because enter is the hotkey that makes the dialogue's "find next" button run.

Here is a sample for you to try. Get rid of only the slash at the end of the first line, without any search pauses at any other slash:

/X1.2717 /Y-2.8443 /
/Z0.13
__________________
First you get good, then you get fast. Then grouchiness sets in.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6  
Old 05-09-2003, 08:07 PM
wms's Avatar
wms wms is offline
Moderator
 
Join Date: Mar 2003
Location: United States
Posts: 938
wms is on a distinguished road
Hear that Sound?
That's the SOUND of me wiping the EGG off my face.
Once again you are right.

I knew that if I tried to help YOU with an scripting or ASCII problem I would end up eating a big bucket of CROW.
I don't know what I was thinking.
Bad WMS, bad WMS.
__________________
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #7  
Old 05-09-2003, 11:22 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,823
HuFlungDung is on a distinguished road
Heheh.

I was really hoping that I was the dense one, that you had the solution. I'll just have to wait and see if the next patch addresses this tiny issue. I have alerted them about this problem some time ago.
__________________
First you get good, then you get fast. Then grouchiness sets in.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #8  
Old 05-10-2003, 12:28 PM
wms's Avatar
wms wms is offline
Moderator
 
Join Date: Mar 2003
Location: United States
Posts: 938
wms is on a distinguished road
Brain Fart

Hu,
I woke up at 3.30 am this morning with this "brain fart". It took me until now to work it out . See what you think.

In your modal setting for your post:

Check the cords
Uncheck the G code
check the feed rate

In your post format: ( note a (s) below is a space in your format)

Rapid line format:

{G}{X}(s){G}{Y}(s){G}(s){Z}(s)

(so there is a space before the{Z} and a space after)

Ok now don't give I'm going somewhere with this.
Post your code and open up your program in the editor.

Your first find and replace looks like this:

Find=G00
Replace=/

Then:
Find=/(s)Z
Replace=/Z

Then:
Find=/(s)
replace=(nothing)

I know this is alot of "find and replace" but I think it beats going thru the code by hand IMO.
__________________
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #9  
Old 05-10-2003, 01:47 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,823
HuFlungDung is on a distinguished road
Your brain fart got me thinking, Ward. I neglected to tell you that the slash at the end of a line could be due to a deleted X, Y or Z, which would mean I would have to have a space after every slash, not just before the Z.

But, good news, you set me on a slightly different track that seems workable.

Here was my old RAPID LINE FORMAT G00:
{G}{X} {G}{Y} {G}{Z}, where the code {G} was given a prefix of / instead of G

Here is the new one:
{{G}{X}} {{G}{Y}} {{G}{Z}}

Now, with coordinates modal ON, every instance of a solitary / appears as:
{/} {/} {/Z1.2345}
or
{/X1.2345} {/}

no matter if it is at the end of a line or not. These are all quickly and easily deleted.

However each rapid move is also enclosed in {}, so the code looks like this:
{/X1.6717} {/Y-1.2318} {/Z0.2}
Again, a double application of find and replace all removes first the "{" and then the "}".

Thanks for the insight that got me on track
__________________
First you get good, then you get fast. Then grouchiness sets in.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #10  
Old 05-10-2003, 02:51 PM
wms's Avatar
wms wms is offline
Moderator
 
Join Date: Mar 2003
Location: United States
Posts: 938
wms is on a distinguished road
Hu,
More that one way to skin a cat. Not that I would skin a cat.
Glad It worked out.
__________________
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #11  
Old 05-12-2003, 04:06 PM
wms's Avatar
wms wms is offline
Moderator
 
Join Date: Mar 2003
Location: United States
Posts: 938
wms is on a distinguished road
Faster less work

Hu,
Try this:

{G}{X}(s){G}{Y}(s){G}{Z}(s)(cr)

Don't forget the cairage return after the (space) after the {Z}. Or the program will strip the space out.

This will put a (space) after any lone / even at the end of a line.
This way you only have to find /(s) and replace with (nothing).
Again the(s) is a keyboard space. And (cr) is a cairage return, that is (enter).
__________________
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #12  
Old 05-12-2003, 06:08 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,823
HuFlungDung is on a distinguished road
That is a vailant attempt, WMS and I appreciate your time spent thinking about this problem.

Unfortunately, it seems that the NC editor automatically deletes that space at the end of the line anyways, so we still lose out. I did insert the enter after the space, but I think that this gets deleted too, because otherwise, we would see the lines of gcode double spaced.

I did manage to narrow the search and replace down to just two operations. I now use this as my Rapid line format:

{G}{X}} {G}{Y}} {G}{Z}}

This gives me this format:

/X1.2345} /Y1.2345} /Z1.2345}

or, if the Z was deleted

/X1.2345} /Y1.2345} /}

Thus, I can do a search and replace first for all instances of:
/}

and then for just the one brace
}

However, your idea has the best germ for a true fix, the developers would just need to allow one space to exist at the end of every line. Hopefully, they can get around my having to do this completely, though.
__________________
First you get good, then you get fast. Then grouchiness sets in.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

Last edited by HuFlungDung; 05-12-2003 at 06:20 PM.
Tweet this Post!Share on Facebook
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to mirror GCode file? anoah General CAM Discussion 6 07-08-2003 01:26 PM




All times are GMT -5. The time now is 03:23 AM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353