wincc常见问题一
来源: 作者: 时间:2007-04-17 阅读:
1、创建一个 SQL文件,此文件在ISQL中建立,文件内包含所要执行的SQL语句。Windows对话框实现。具体如下:
2、在WinCC中用C Script 调用上述SQL文件,如下所示:
#include"apdefap.h"
void OnLButtonDown(char* lpszPictureName,
char* lpszObjectName,
char* lpszPropertyName,
UINT nFlags,int x,int y)
{
char*a="c:\\siemens\\common\\SQLANY\\ISQL-q-b-c
UID=DBA;PWD=SQL;DBF=E:\\testsql\\testsqlRT.DB;
DBN=CC_testsql_99-12-03 -12:48:26R;READ
E:testsql\\test.sql";
Printf("%s\r\n",a);
ProgramExcute(a);
}
下面是一个简单的SQL文件内容:
select *from pde#hd#t#test;
output to e:\\test2.txt FORMAT ascii
注意:文件名及路径中不要带空格。
6、问: 如何整点启动归档?
答: 在"Globle Script"下的Project function编写程序函数:cyclicarchive
BOOL cyclicarchive()
{
#pragma code("kernel.dll");
void GetLocalTime(SYSTEMTIME*lpsz);
#pragma code();
SYSTEMTIME time;
Int t1;
GetLocalTime(&time);
T1=time.wMinute;
If(t1==00)
{
SetTagBit("startarchive",1);
Return(BOOL) (GetTagBit("startarchive"));
}
}
在Tagloging中的"Properties of process tag"中的"archive tag"Tab下的Archive type选择Cycle-selective,在"Event"标签下的"StartEvent"内选择cyclicarchive函数。
7、问: How can I set and reset a WinCC variable by mouse click with C script?
答: The following function shows how you can alternately set and reset a WinCC variable by mouse click.
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
BOOL z;
z=GetTagBit("MyBitVariable");
if (z==0)
SetTagBit("MyBitVariable",1);
else
SetTagBit("MyBitVariable",0);
2、在WinCC中用C Script 调用上述SQL文件,如下所示:
#include"apdefap.h"
void OnLButtonDown(char* lpszPictureName,
char* lpszObjectName,
char* lpszPropertyName,
UINT nFlags,int x,int y)
{
char*a="c:\\siemens\\common\\SQLANY\\ISQL-q-b-c
UID=DBA;PWD=SQL;DBF=E:\\testsql\\testsqlRT.DB;
DBN=CC_testsql_
E:testsql\\test.sql";
Printf("%s\r\n",a);
ProgramExcute(a);
}
下面是一个简单的SQL文件内容:
select *from pde#hd#t#test;
output to e:\\test2.txt FORMAT ascii
注意:文件名及路径中不要带空格。
6、问: 如何整点启动归档?
答: 在"Globle Script"下的Project function编写程序函数:cyclicarchive
BOOL cyclicarchive()
{
#pragma code("kernel.dll");
void GetLocalTime(SYSTEMTIME*lpsz);
#pragma code();
SYSTEMTIME time;
Int t1;
GetLocalTime(&time);
T1=time.wMinute;
If(t1==00)
{
SetTagBit("startarchive",1);
Return(BOOL) (GetTagBit("startarchive"));
}
}
在Tagloging中的"Properties of process tag"中的"archive tag"Tab下的Archive type选择Cycle-selective,在"Event"标签下的"StartEvent"内选择cyclicarchive函数。
7、问: How can I set and reset a WinCC variable by mouse click with C script?
答: The following function shows how you can alternately set and reset a WinCC variable by mouse click.
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
BOOL z;
z=GetTagBit("MyBitVariable");
if (z==0)
SetTagBit("MyBitVariable",1);
else
SetTagBit("MyBitVariable",0);
将wincc常见问题一
上一篇:没有了
下一篇:wincc常见问题二
最新评论:共有 3 位网友发表了评论 查看所有评论
机电专业相关文章
赞助商链接
最新推荐文章
- 真诚与距离
- HMI的安全性
- 人机界面(HMI)基础知识介绍 href="/dianqi/rj/16677.html" target=_blank>人机界面(HMI)基础知识介绍
- 人机交互风格及其发展 href="/dianqi/rj/16676.html" target=_blank>人机交互风格及其发展
- 以人为本的人机界面设计思想 href="/dianqi/rj/16675.html" target=_blank>以人为本的人机界面设计思想
- MIS人机界面的设计原则 href="/dianqi/rj/16674.html" target=_blank>MIS人机界面的设计原则
- 人机交互风格及其发展趋势 href="/dianqi/rj/16673.html" target=_blank>人机交互风格及其发展趋势
- 人机界面与PLC在冷带连续加工机组中的应用 href="/dianqi/rj/16672.html" target=_blank>人机界面与PLC在冷带连续加工机组中的应用
- 人机界面与变频器在塑料薄膜生产线中的高级应 href="/dianqi/rj/16671.html" target=_blank>人机界面与变频器在塑料薄膜生产线中的高级应
- 人机界面(HMI)基本概念和问题 href="/dianqi/rj/16668.html" target=_blank>人机界面(HMI)基本概念和问题
最新热门文章
Hot 11
- wincc常见问题二
- 浅谈人机界面设计 href="/dianqi/rj/5771.html" target=_blank>浅谈人机界面设计
- wincc常见问题一
- 人机界面(HMI)基础知识介绍 href="/dianqi/rj/16677.html" target=_blank>人机界面(HMI)基础知识介绍
- 西门子数控系统做用户画面的方法
- 人机界面的十大发明 href="/dianqi/rj/16666.html" target=_blank>人机界面的十大发明
- 数字化产品与人机界面设计 href="/dianqi/rj/5772.html" target=_blank>数字化产品与人机界面设计
- HMI的安全性
- 人机交互风格及其发展 href="/dianqi/rj/16676.html" target=_blank>人机交互风格及其发展
- 人机界面(HMI)基本概念和问题 href="/dianqi/rj/16668.html" target=_blank>人机界面(HMI)基本概念和问题
