发布于 2011-05-25 06:51:08
19楼
感谢几位大侠,经过调试,以下代码已经调试通过,生成DLL,现在开始请教如何在WINCC中C动作实现DLL返回的结构成员和WINCC变量联系.
#include "stdafx.h"
#include "20110520.h"
extern "C" __declspec (dllexport) int aufruf1(int a,stationinfo * pInfo)
{
int nRet = 0;
switch(a)
{
case 1:
{
pInfo->type=1111;
pInfo->port=6021;
pInfo->ip="192.168.1.10";
pInfo->addr="r";
return 1;
}
break;
case 2:
{
pInfo->type=2222;
pInfo->port=6022;
pInfo->ip="192.168.1.11";
pInfo->addr="y";
return 1;
}
break;
default:
{
}
break;
}
return nRet;
}