Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Buffer won't take string value


Recommended Posts

I'm trying to output data into .txt file for use in our intranet system.

 

I can pull most variables just fine, but some won't work.

 

This is my code that works:

 

size8 : 0
rc8   : 1
wc8   : 1
str8  : "" #empty string to be input for buffer write
 
fbuf 8 1 256 0 0
 
size8 = rbuf(8,0) #reading record zero initializes buffer
str8 = drs_str(2, mi4$) + " | " + drs_str(2, mi4$) + " | " + drs_str(2, Tool_var2) + " | " + drs_str(2, t$) + " | " + drs_str(2, speed) + " | " + drs_str(2, feed) + " | "
str8 = wbuf(8, wc8)
 
When I try to add drs_str(2, snamenc$) I get the error: (21 May 2015 09:47:11 AM - <2> - PST LINE (1007) - The arguments for this operator/function are not the same type (var/string)[9])
 
Could someone steer me towards getting the tool description to output to my buffer text file?

 

Link to comment
Share on other sites

snamenc$ is a string variable already, drs_str is a function to convert a numeric value into a string, if you call it with a string value you will get an error since it is expecting a numeric value to be passed in.

 

If your looking for tool description though, its not really going to matter since snamenc is the name of the NC file .. if you want the tool name (which is what I think you mean by tool description, then its most likely strtool$ that you are looking for..

 

In order to grab this variable and write it to a buffer, you should probably to do it in the pwrtt$ postblock (or whatever block is writing the tooltable in your post) since that is the place where you can grab all the tools when the file is being pre-read.

 

 

Anyhow in answer to your original question, if you want to output the name of the NC file, you should be able to add snamenc$ instead of drs_str(2, snamenc$) 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...