John,

That is a good question.  I had not thought about making changes to the smf
file on the fly.  We have two or more smf files for a couple of machines and
pick the smf thats needed.  Anyway I did some work and it is possible to
change the smf on the fly using the macro language.  The smf file is a fixed
format file and the line that you want to change is 471.  It seemed to work
fine.  What it does is create a temporary smf file then it overwrites the
original.  Anyway the following is what I came up with.  I would recomend
that you backup the original smf file.


STRING:#tempsmf
STRING:#smf
STRING:#tmpstr
integer:#counter
#var436=0

#smf=SMFFILE()
        // #tempsmf = temporary smf file with new value for 436
        #tempsmf="C:\temp.smf"
        F_OPEN[FN=STRTMP("%smf"), TY="R"]
        F_OPEN[FN=STRTMP("%tempsmf"), TY="W"]

        // start of while loop
        #counter=1
        WHILE (#counter<608)
                IF(#counter=471)
                        F_READ[FN=STRTMP("%smf"), FMT="%D3.6", VR="var436"]
PROMPT[TX=STRTMP("What is the value for question 436"),
VN="var436",LR=15,LC=15, SR=2]
                        F_WRITE[FN=#tempsmf, FMT="%p1.6~n", VR="var436"]
                ELSE
                        F_READ[FN=STRTMP("%smf"), FMT="%S", VR="tmpstr"]
                        F_WRITE[FN=#tempsmf, FMT="%S~n", VR="tmpstr"]
                ENDIF
                #counter=#counter+1
        ENDW
        // end of while loop
        F_CLOSE[FN=STRTMP("%smf")]
        F_CLOSE[FN=STRTMP("%tempsmf")]

        SHELL[CMD_LN=STRTMP("del %smf"), WA=1, DP=1]
        SHELL[CMD_LN=STRTMP("copy %tempsmf %smf"), WA=1, DP=1]


Bill Wepking
Landis Gardner


-----Original Message-----
From: John Morris [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 7:48 AM
To: Smartcam User Group (E-mail)
Subject: [mfg-smartcam] Change .smf through a Macro?


Is it possible to change data in the .smf file with a macro in smartcam?

In my case I have a macro that I use with a .pcb panel that lets me choose
the machine I'm posting code to (as well as variations of the Code generator
for with or without 4th axis attached), I also set the program number which
is passed to the processor, name the file ect.  I got to thinking today, I
regularly wrap profiles for the 4th axis and have to change question #436 to
match the circumference which until today I have done by opening Machine
Define and doing manually.  My question is can I add a data field that would
pass the circumference value to the macro and have the macro change the .smf
file?


John Morris

(or if we wanted to get really fancy extract the data from the automatically
generated plane that is created when you wrap, and pass that to the macro to
change the .smf)

======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================
======================================================================
To find out more about this mailing list including how to unsubscribe,
send the message "info mfg-smartcam" to [EMAIL PROTECTED]
======================================================================

Reply via email to