pos機工作時間,Mastercam后處理程序頭輸出加工時間

 新聞資訊  |   2023-07-03 12:58  |  投稿人:pos機之家

網(wǎng)上有很多關(guān)于pos機工作時間,Mastercam后處理程序頭輸出加工時間的知識,也有很多人為大家解答關(guān)于pos機工作時間的問題,今天pos機之家(www.shineka.com)為大家整理了關(guān)于這方面的知識,讓我們一起來看下吧!

本文目錄一覽:

1、pos機工作時間

pos機工作時間

Mastercam后處理程序頭輸出加工時間--純代碼版方法。

此方法由官方提供,其原理利用了mill.set文件及buffer的方式來實現(xiàn)。

實現(xiàn)的原理及過程如下:

首先利用后處理調(diào)用mp.dll及mill.set,獲取加工時間,并把加工時間保存為doc文件。

其次正常后處理程序,并向后處理中寫入一個標(biāo)志字符串。

最后再后處理運行結(jié)束前利用buffer重讀nc文件,并搜索標(biāo)志字符串。

Mastercam后處理基于鉆孔開發(fā)測頭(探針)源代碼

找到標(biāo)志字符串后替換標(biāo)志字符串,并回寫刀程序中,即可完成程序頭或任意地方出加工時間。

1:定義各項數(shù)據(jù)

# Define strings used in building up the command line parameters for the DLL callsspace : " " # SPACE characterssq : "'" # Single Quote charactersdq : '"' # Double Quote charactersdoc : ".doc" # .doc extensionspath_in : "" # Will be the "path\ame" of the NCI input filespath_out : "" # Will be the "path\ame" of the DOC output filesparams : "" # Will be the command parameter line passed to the DLL

Mastercam后處理 3+2刀尖跟隨計算源代碼

2:定義mp.dll文件路徑,此路徑可用絕對路徑,也可用相對路徑

sdll : "D:\\Program Files\\Mastercam 2022\\Mastercam\\apps\\MP.dll" # Name of the .DLL to be called - update path as needed

3:定義mill.set文件路徑,此路徑可用絕對路徑,也可用相對路徑

s_setfile : "C:\\Users\\Public\\Documents\\Shared Mastercam 2022\\mill\\Posts\\Mill.set" # Define the path and name of the .set file to be used.

4:定義保存時間數(shù)據(jù)的函數(shù)

# Define strings used to read cycle time from .set output and write it to .pst outputset_time : "" #String to hold cycle time read from setup sheet output - entire line from .set outputscycle_time : "" #String to hold cycle time read from setup sheet output - time only, prefix stipped from set_time stringscycle_time_out : "(cycle_time_here)" #Keyword - This will be output where cycle time output is desired, then replace with the cycle time during ppost$.loc_found : 0 #Flag to indicate that cycle time output location has been found.

5:定義buff1數(shù)據(jù)

# --------------------------------------------------------------------------#Buffer 1, Doc file created by setup sheetwc1 : 1 #Buffer 1 write counterrc1 : 1 #Buffer 1 read countersize1 : 0 #Buffer 1 sizestring1 : "" #Buffer 1fbuf 1 0 256 1 1 #Buffer 1

6:定義buff2數(shù)據(jù)

#Buffer 2, NC file after postingwc2 : 1 #Buffer 2 write counterrc2 : 1 #Buffer 2 read countersize2 : 0 #Buffer 2 sizestring2 : "" #Buffer 2fbuf 2 1 256 1 1 #Buffer 2

7:在ppost$下完成整個加工時的獲取,輸出,回寫到程序中

ppost$ # This posblock is call AFTER all the files from the PST run are closed! spath_in = spathnci$ + snamenci$ + sextnci$ spath_out = spathnc$ + snamenc$ + sdoc sparams = ssq + sdq + spath_in + sdq + sspace + sdq + s_setfile + sdq + sspace + sdq + spath_out + sdq + ssq result = dll(sdll, sparams) sbufname1$ = spath_out size1 = rbuf(one, zero) rc1 = size1 set_time = rbuf(one, rc1) end_str_ix$ = zero if end_str_ix$ = zero, result = strstr(":", set_time) if end_str_ix$ = zero, result = strstr("=", set_time) scycle_time = brksps(end_str_ix$, set_time) sbufname2$ = spathnc$ + snamenc$ + sextnc$ while loc_found = zero, [ string2 = rbuf(two, rc2) if string2 = scycle_time_out, [ wc2 = rc2 - one scycle_time = sopen_prn + "CYCLE TIME =" + scycle_time + sclose_prn scycle_time = wbuf(two, wc2) loc_found = one ] ]

8:在psof$或其他任何想要輸出加工時間的地方下面增加下面的代碼。

psof$ *scycle_time_out,e$

以上就是關(guān)于pos機工作時間,Mastercam后處理程序頭輸出加工時間的知識,后面我們會繼續(xù)為大家整理關(guān)于pos機工作時間的知識,希望能夠幫助到大家!

轉(zhuǎn)發(fā)請帶上網(wǎng)址:http://www.shineka.com/news/78439.html

你可能會喜歡:

版權(quán)聲明:本文內(nèi)容由互聯(lián)網(wǎng)用戶自發(fā)貢獻,該文觀點僅代表作者本人。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如發(fā)現(xiàn)本站有涉嫌抄襲侵權(quán)/違法違規(guī)的內(nèi)容, 請發(fā)送郵件至 babsan@163.com 舉報,一經(jīng)查實,本站將立刻刪除。