#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default NC tape conversion

I do NC programming and we have a new machine that rotated Z axis -90
degrees. I need to convert a few hundred NC tapes to the new machine. The
old code looks like this G17 G9 X58.4296 Y100.7598 I60.0696 J99.0699 Z-21.43
C270
and converts to G17 G9 X100.7598 Y-58.4296 I99.0699 J-60.0696 Z-21.43 C180
X = Y
Y = X-
I = J
J = I-
Z = Z
C = C-90

Any help would be very much appreciated, at the current rate I can do about
4 tapes a day.
--
clcnewtoaccess
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default NC tape conversion

One way to do it: import all the text strings into Excel, and use the
Text to Columns feature to separate each value into a separate column.
Then delete all the alpha characters: search for G, for instance, and
replace with "" which will leave only numeric characters- then you can
do the required math on them. For clarity, insert a row to contain
headers, such as G, X, Y, Z, etc.

When that's done, use columns off to the right to calculate the
converted values. Then use a CONCATENATE function to tie it all back
together: =CONCATENATE("G", a5, " ", "G", b5, " ","X",c5, " ", "Y",
d5, " ", .....etc)

Save the Excel file as a text file and the concatenated fields will be
the text string you need.

Dave O
Eschew obfuscation
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default NC tape conversion

Another way is to use a User Defined Function - see below
If you are new to VBA see David McRitchie's site on "getting started" with
VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm
best wishes

Function Twister(oldcode)
x = InStr(1, oldcode, "X")
y = InStr(1, oldcode, "Y")
i = InStr(1, oldcode, "I")
j = InStr(1, oldcode, "J")
z = InStr(1, oldcode, "Z")
c = InStr(1, oldcode, "C")

xval = Mid(oldcode, x + 1, y - x - 2)
yval = Mid(oldcode, y + 1, i - y - 2)
ival = Mid(oldcode, i + 1, i - y - 2)
jval = Mid(oldcode, j + 1, j - i - 2)
zval = Mid(oldcode, z + 1, z - j - 2)
cval = Mid(oldcode, c + 1, 20)
cval = cval - 90

newcode = Mid(oldcode, 1, x)
newcode = newcode & yval & " Y-" & xval
newcode = newcode & " I" & jval & " J-" & ival
newcode = newcode & "Z" & zval
newcode = newcode & "C" & cval
Twister = newcode
End Function

--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Dave O" wrote in message
...
One way to do it: import all the text strings into Excel, and use the
Text to Columns feature to separate each value into a separate column.
Then delete all the alpha characters: search for G, for instance, and
replace with "" which will leave only numeric characters- then you can
do the required math on them. For clarity, insert a row to contain
headers, such as G, X, Y, Z, etc.

When that's done, use columns off to the right to calculate the
converted values. Then use a CONCATENATE function to tie it all back
together: =CONCATENATE("G", a5, " ", "G", b5, " ","X",c5, " ", "Y",
d5, " ", .....etc)

Save the Excel file as a text file and the concatenated fields will be
the text string you need.

Dave O
Eschew obfuscation



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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
Tape recording time code? Gervin Callo Excel Discussion (Misc queries) 5 September 21st 07 01:54 AM
Created date in "General" tape and "Statistics" tape Winnie Excel Discussion (Misc queries) 1 January 5th 07 02:43 PM
Between conversion Dan Wilson Excel Worksheet Functions 0 March 13th 05 03:02 PM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
Formating fractions so they read like a measuring tape Cabinet_maker Excel Discussion (Misc queries) 1 December 15th 04 08:27 PM


All times are GMT +1. The time now is 07:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"