1. 后处理时如何在程序头输出加工时间?
Post Builder在后处理计算加工时间时需要累积一步一步的刀具运动,只有全部的刀具运动遍列完,才能计算总的加工时间,所以客户只能在程序结束处通过mom_machine_time输出加工时间。
下面的代码在后处理结束后重写NC程序,可以在程序开头输出加工总时间。
global ptp_file_name
set tmp_file_name "${ptp_file_name}_"
if {[file exists $tmp_file_name]} {
MOM_remove_file $tmp_file_name
}
MOM_close_output_file $ptp_file_name
file rename $ptp_file_name $tmp_file_name
set ifile [open $tmp_file_name r]
set ofile [open $ptp_file_name w]
global mom_machine_time
puts $ofile "(CYCLE TIME = [format "%.2f" $mom_machine_time] MIN.)"
set buf ""
while { [gets $ifile buf] > 0 } {
puts $ofile $buf
}
close $ifile
close $ofile
MOM_remove_file $tmp_file_name
MOM_open_output_file $ptp_file_name
global ptp_file_name
set tmp_file_name "${ptp_file_name}_"
if {[file exists $tmp_file_name]} {
MOM_remove_file $tmp_file_name
}
MOM_close_output_file $ptp_file_name
file rename $ptp_file_name $tmp_file_name
set ifile [open $tmp_file_name r]
set ofile [open $ptp_file_name w]
global mom_machine_time
puts $ofile "(CYCLE TIME = [format "%.2f" $mom_machine_time] MIN.)"
set buf ""
while { [gets $ifile buf] > 0 } {
puts $ofile $buf
}
close $ifile
close $ofile
MOM_remove_file $tmp_file_name
MOM_open_output_file $ptp_file_name
具体方法如下:
1.启动Post Builder并打开需要修改的后处理文件,在Custom Command页面里点击Create以创建一个自定义函数。

2.在这个自定义函数体中输入上述的代码。

3.切换到Program页面,选中program end sequence, 在程序输出的最后如输出%前插入前面定义好的自定义函数。

4.修改后的后处理将在程序头输出加工时间,如下图所示。
TC_Project Tips
2. 如何迁移TCProject服务器
问题:
如果想将TCProject服务与数据迁移到更好配置的服务器上,所需的主要步骤包括哪些?
解决方案:
假设原有服务器名称为Host1,新的服务器名称为Host2,迁移的主要步骤包括:
1. 在Host1上,停止JDOT服务并运行JDOT Server Administrator,在 Database菜单中点击"Export to CSV files",将TCProject相关的数据导出到 Project安装路径\bin\csv。

2. 在Host2上,安装新的TCProject 2005SR1,并安装已有的补丁。
3. 在Host2上,运行JDOT Server Administrator,在Database菜单中点击"Initialize SQL Database"初始化TCProject数据。

4. 将Host1上导出的CSV文件复制到Host2上的Project安装路径\bin\csv。
5. 在Host2上,运行JDOT Server Administrator,在Database菜单中点击"Import CSV files"将CSV 文件中的数据导入到数据库中。

6. 从Host1复制cryptkey.bin到Host2的Project安装路径\bin目录下。
7. 在Host2上重启JDOT服务。