• 大小: 203KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-14
  • 语言: 其他
  • 标签: MPI  PRODAVE  

资源简介

本源代码演示了通过串口利用MPI协议与西门子PLC S7-300系统通讯的实现方式。用VC写的。

资源截图

代码片段和文件信息

// PLC_Protocol_test.cpp : Defines the class behaviors for the application.
//

#include “stdafx.h“
#include “PLC_Protocol_test.h“
#include “PLC_Protocol_testDlg.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CPLC_Protocol_testApp

BEGIN_MESSAGE_MAP(CPLC_Protocol_testApp CWinApp)
//{{AFX_MSG_MAP(CPLC_Protocol_testApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
//    DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP CWinApp::onhelp)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPLC_Protocol_testApp construction

CPLC_Protocol_testApp::CPLC_Protocol_testApp()
{
// TODO: add construction code here
// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CPLC_Protocol_testApp object

CPLC_Protocol_testApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CPLC_Protocol_testApp initialization

BOOL CPLC_Protocol_testApp::InitInstance()
{
AfxEnableControlContainer();

// Standard initialization
// If you are not using these features and wish to reduce the size
//  of your final executable you should remove from the following
//  the specific initialization routines you do not need.

#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif

CPLC_Protocol_testDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
//  dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
//  dismissed with Cancel
}

// Since the dialog has been closed return FALSE so that we exit the
//  application rather than start the application‘s message pump.
return FALSE;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3406  2008-06-16 16:54  SIEMENS\PLC_Protocol_test\ERROR.DAT

     文件      59904  1998-05-18 12:02  SIEMENS\PLC_Protocol_test\Komfort.dll

     文件      40444  2009-05-21 13:47  SIEMENS\PLC_Protocol_test\PLC_Protocol_test.aps

     文件       3105  2009-05-22 16:29  SIEMENS\PLC_Protocol_test\PLC_Protocol_test.clw

     文件       2217  2009-04-20 20:53  SIEMENS\PLC_Protocol_test\PLC_Protocol_test.cpp

     文件       4492  2009-05-21 16:41  SIEMENS\PLC_Protocol_test\PLC_Protocol_test.dsp

     文件       1445  2009-04-20 20:53  SIEMENS\PLC_Protocol_test\PLC_Protocol_test.h

     文件       2007  2009-05-22 16:29  SIEMENS\PLC_Protocol_test\PLC_Protocol_test.plg

     文件       9613  2009-05-21 13:47  SIEMENS\PLC_Protocol_test\PLC_Protocol_test.rc

     文件      22485  2009-05-24 14:50  SIEMENS\PLC_Protocol_test\PLC_Protocol_testDlg.cpp

     文件       2345  2009-04-22 09:36  SIEMENS\PLC_Protocol_test\PLC_Protocol_testDlg.h

     文件       3777  2009-04-20 20:53  SIEMENS\PLC_Protocol_test\ReadMe.txt

     文件       1078  2009-04-20 20:53  SIEMENS\PLC_Protocol_test\res\PLC_Protocol_test.ico

     文件        409  2009-04-20 20:53  SIEMENS\PLC_Protocol_test\res\PLC_Protocol_test.rc2

    ..A.SH.      3584  2009-04-22 16:32  SIEMENS\PLC_Protocol_test\res\Thumbs.db

     文件       1891  2009-05-21 13:47  SIEMENS\PLC_Protocol_test\resource.h

     文件      36864  2009-05-22 16:28  SIEMENS\PLC_Protocol_test\SIEMENS_MPI.dll

     文件       3341  2009-04-21 15:14  SIEMENS\PLC_Protocol_test\SIEMENS_MPI.H

     文件       7664  2009-05-22 16:28  SIEMENS\PLC_Protocol_test\SIEMENS_MPI.lib

     文件        219  2009-04-20 20:53  SIEMENS\PLC_Protocol_test\StdAfx.cpp

     文件       1078  2009-04-21 13:28  SIEMENS\PLC_Protocol_test\StdAfx.h

     文件      95744  1999-09-24 08:31  SIEMENS\PLC_Protocol_test\W95_s7.dll

     文件        788  2009-04-20 20:53  SIEMENS\SIEMENS.dsw

     文件     164864  2009-05-24 14:50  SIEMENS\SIEMENS.ncb

     文件      58880  2009-05-24 14:50  SIEMENS\SIEMENS.opt

     文件       3406  2008-06-16 16:54  SIEMENS\SIEMENS_MPI\ERROR.DAT

     文件      59904  1998-05-18 12:02  SIEMENS\SIEMENS_MPI\Komfort.dll

     文件       1357  2001-01-12 10:16  SIEMENS\SIEMENS_MPI\Komfort.h

     文件       4320  2000-11-23 14:13  SIEMENS\SIEMENS_MPI\Komfort.lib

     文件      23423  2009-05-22 15:33  SIEMENS\SIEMENS_MPI\SIEMENS_MPI.cpp

............此处省略20个文件信息

评论

共有 条评论