回复:WINCC 中调用外部用户DLL库,多参数返回的问题.

www95

西门子1847工业学习平台

  • 帖子

    163
  • 精华

    1
  • 被关注

    17

论坛等级:游侠

注册时间:2006-04-25

普通 普通 如何晋级?

发布于 2011-05-24 03:50:31

13楼

斑竹,DLL引用结构体返回在WINCC里面怎么取出成员值和WINCC中的变量值对应?
以下为DLL中结构体的定义例程,错误在哪里?不知道如何返回结构体和WINCC中如何引用结构体的成员.
extern "C" __declspec (dllexport) struct aufruf1 (int a);

#include
#include
FILE *h_test;
FILE *h_trace;
extern "C" __declspec (dllexport) struct aufruf1(int a)
{

struct stationinfo
{
int type ;
int port;
char * ip;
char * addr;

};

switch(a)
{
case 1:
{
stationinfo stationinfo_1;

stationinfo_1.type=1111;
stationinfo_1.port=6021;
stationinfo_1.ip="192.168.1.10";
stationinfo_1.addr="r";
return stationinfo_1;
}break;
case 2:
{
stationinfo stationinfo_2;

stationinfo_2.type=2222;
stationinfo_2.port=6022;
stationinfo_2.ip="192.168.1.11";
stationinfo_2.addr="y";
return stationinfo_2;
}break;

default:
{

}break;

}

}
评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC WinCC / Panel

共有32967条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

快扫描右侧二维码晒一晒吧!

再发帖或跟帖交流2条,就能晋升VIP啦!开启更多专属权限!

  • 分享

  • 只看
    楼主

top
X 图片
您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。