Site Logo
Site Logo
 
It is currently Sun Apr 02, 2017 10:21 pm

All times are UTC [ DST ]




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: How to pass a parameter value as macro input argument
PostPosted: Mon Feb 29, 2016 12:04 pm 
Offline
New User
New User

Joined: Sat Jan 09, 2016 9:09 am
Posts: 4
I have following piece of code. I would like to pass values iteritively in the powermill macro execute command as follows:

Code:
int d = 4000;
powerMill.Execute("EDIT FRATE ; d");

The above code doesn't seem to work and returns the following error.

Code:
PowerMILL >
****  EDIT FRATE ; d\n
****  ----------^ Unexpected input !!

Error in Network  :  feedrate ( CuttingFeed )
Last Valid Token  :  FRATE extracted by graph [ COMMAND ]
Received input    :  " ; d\n"

Is there any alternative method to do this?

thanks


Top
 Profile  
 
 Post subject: Re: How to pass a parameter value as macro input argument
PostPosted: Mon Feb 29, 2016 12:26 pm 
Offline
DELCAM Staff
DELCAM Staff
User avatar

Joined: Mon Aug 09, 2004 3:55 pm
Posts: 1463
Location: Birmingham UK
PowerMILL cannot see your .NET program variables. So you'll need to convert the value of 'd' so that you can pass it into the .NET Execute function

powerMill.Execute("EDIT FRATE ; 4000");


Top
 Profile  
 
 Post subject: Re: How to pass a parameter value as macro input argument
PostPosted: Mon Feb 29, 2016 12:32 pm 
Offline
New User
New User

Joined: Sat Jan 09, 2016 9:09 am
Posts: 4
Thanks for your reply. We able to run that however some specific values for the feedrate that are computed using my code which i want to pass into feedrate execute command. Basically there are values for 'd' which are atomatically computed by the code and not entered manually by the user.


Top
 Profile  
 
 Post subject: Re: How to pass a parameter value as macro input argument
PostPosted: Mon Feb 29, 2016 12:37 pm 
Offline
DELCAM Staff
DELCAM Staff
User avatar

Joined: Mon Aug 09, 2004 3:55 pm
Posts: 1463
Location: Birmingham UK
I'm not a .NET programmer but I'm fairly sure that there is a way to convert your values to strings.

Something like this in C#

powerMill.Execute("EDIT FRATE ; " + d);

VB it might be something different I think. Otherwise there is a stringify function.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB