求助 如何使PMAC自动运行pmc格式的程序 点击:1056 | 回复:8



oheheo

    
  • 精华:0帖
  • 求助:0帖
  • 帖子:1帖 | 0回
  • 年度积分:0
  • 历史总积分:3
  • 注册:2007年9月14日
发表于:2007-09-14 19:25:00
楼主
如何通过VB编的界面向PMAC写入程序且能让PMAC自动运行程序?
知道用VB调用PMAC.dll动态连接库,也可以通讯,但不知如何写入程序和让PMAC自动运行程序。
请高人帮忙,多谢!



小虫~~

  • 精华:0帖
  • 求助:2帖
  • 帖子:19帖 | 307回
  • 年度积分:0
  • 历史总积分:659
  • 注册:2007年2月02日
发表于:2007-09-15 11:53:00
1楼
你可以调用函数将.Pmc文件下载到卡里面去,好像是这个函数:
PmacAddDownloadFileA() 
然后再发指令运行Pmc里的运动程序,例如第1个程序则为 B1R

不过一般可以使用PWin32程序提前把.Pmc写进去,运行时候只需调用就行了

~莫名~

  • 精华:0帖
  • 求助:0帖
  • 帖子:1帖 | 17回
  • 年度积分:0
  • 历史总积分:32
  • 注册:2002年11月20日
发表于:2007-09-29 14:04:00
2楼
楼主应该是自己开发界面程序,用pwin32恐怕不行的!

朱鹏飞

  • 精华:0帖
  • 求助:0帖
  • 帖子:0帖 | 11回
  • 年度积分:0
  • 历史总积分:14
  • 注册:2006年11月04日
发表于:2007-10-09 22:09:00
3楼
long PmacDownloadA(DWORD dwDevice, DOWNLOADMSGPROC msgp, DOWNLOADGETPROC getp, DOWNLOADPROGRESS pprg, PCHAR filename, BOOL macro, BOOL map, BOOL log, BOOL dnld);
This function takes an ASCII file, processes it, and downloads it from the PC to the PMAC. Processing includes MACRO parsing and compiling PLCs, for example. This function can generate several residual files, as described in the table below.
File name
Usage
Filename.EXT
Original file with the original EXTension (should not be *.PMA, *.56K, *.LOG, *.MAP).
Filename.PMA
After parsing the file for #define, #includes and other MACRO’s this file is generated. It may be downloaded if no compiling is necessary.
Filename.56K
This file will be created if the Filename.PMA was compiled. Compilation occurs when the macro parameter is set to TRUE.
Filename.LOG
The status of the download at each stage is recorded when the log parameter is set to TRUE.
Filename.MAP
A lookup table is created when MACRO definitions exist. They are recorded and saved to a file when the map parameter is set to TRUE.
Arguments
dwDevice Device number.
msgp Pointer to message procedure pointer.
(DOWNLOADMSGPROC) If NULL no function is called.
getp Pointer to line retrieval function. (DOWNLOADGETPROC)
If NULL no function is called.
pprg Pointer to download progress function.
(DOWNLOADPROGRESS ) If NULL no function is called.
filename Path of file to download.
macro Flag to parse for macros.
map Flag to create a map file created from macros.
log Flag to create a log file. This is the same messages as sent to
the “msgp” procedure.
dnld Flag indicating to send final parsed file to the PMAC.

heidai

  • 精华:0帖
  • 求助:0帖
  • 帖子:11帖 | 1835回
  • 年度积分:0
  • 历史总积分:2824
  • 注册:2007年5月23日
发表于:2007-10-09 22:43:00
4楼
怎么全是英文呀,大哥翻译一下吧

朱鹏飞

  • 精华:0帖
  • 求助:0帖
  • 帖子:0帖 | 11回
  • 年度积分:0
  • 历史总积分:14
  • 注册:2006年11月04日
发表于:2007-10-10 16:16:00
5楼
function Tform1.PmacDownload(const filename: string): Boolean;
var
  pfilename         : PChar;
  DownChars         : LongWord;
begin
  GetMem(pfilename, 255);
  try
    StrCopy(pfilename, PChar(Filename));
    {*下载文件*}
    DownChars := PmacDownloadA(0, nil, nil, nil, pfilename, True, True, True, True);
  finally
    FreeMem(pfilename);
  end;
  if DownChars = 0 then
    Result := False
  else
    Result := True;
end;

朱鹏飞

  • 精华:0帖
  • 求助:0帖
  • 帖子:0帖 | 11回
  • 年度积分:0
  • 历史总积分:14
  • 注册:2006年11月04日
发表于:2007-10-10 16:17:00
6楼
上面是一个delphi的例子,PmacDownloadA(0, nil, nil, nil, pfilename, True, True, True, True);就是函数的调用自己看吧

徐小宣

  • 精华:0帖
  • 求助:0帖
  • 帖子:2帖 | 132回
  • 年度积分:0
  • 历史总积分:185
  • 注册:2006年6月21日
发表于:2007-10-10 20:44:00
7楼
怎么全是英文呀,大哥翻译一下吧
--------------------
哈哈.......太有才了。

朱鹏飞

  • 精华:0帖
  • 求助:0帖
  • 帖子:0帖 | 11回
  • 年度积分:0
  • 历史总积分:14
  • 注册:2006年11月04日
发表于:2007-10-11 17:20:00
8楼
我有不少pmac控制方面的代码,呵呵不过出于商业因素,不能网上公开!需要的可是联系FlyZipCn@hotmail.com,我是做光刻方面的。

热门招聘
相关主题

官方公众号

智造工程师