SIMATIC WINCC.doc
《SIMATIC WINCC.doc》由会员分享,可在线阅读,更多相关《SIMATIC WINCC.doc(10页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、SIMATICSIMATIC HMISIMATIC WinCC相关连接2003-9-23 9:26:0195如何触发计算机扬声器的声音? 首先必须在画面中插入报警控件,可以用以下两种方式来确认信息: 可以用如下的函数来确认单条信息: 4版本和低于此版本的WinCC:BOOL OnBtnSinglAckn(char*lpszPictureName,char*lpszObjectName)5版本和高于此版本的WinCC:BOOL AXC_OnBtnSinglAckn(char*lpszPictureName,char*lpszObjectName) 可以用如下的函数确认报警窗口所有可见的报警: 4
2、版本和低于此版本的WinCC:BOOL OnBtnVisibleAckn(char*lpszPictureName,char*lpszObjectName)5版本和高于此版本的WinCC:BOOL AXC_OnBtnVisibleAckn(char*lpszPictureName,char*lpszObje 如何实现从WinCC运行画面跳转至WinCC控制中心? 最好的方式是在WinCC运行画面上做一个按钮,该按钮应该置为密码保护,在该按钮上设置C-action。 低于WinCC V5.0:#pragma code(user32.dll)Bool SetForegroundWindow(HWN
3、D);#pragma code()HWND handle;Handle=FindWindow(MCPFrameWndClass,NULL);If(!SetForegroundWindow(handle)printf(rn SetForeground fails);5.0版本和高于此版本的WinCC:#pragma code(user32.dll)Bool SetForegroundWindow(HWND);#pragma code()HWND handle;Handle=FindWindow(WinCCExplorerFrameWndClass,NULL);If(!SetForegroundW
4、indow(handle) printf(rn SetForeground fails);如何在WinCC中读取计算机系统时间? 可以编写如下的C-action: #pragma code(kernel32.dll);Void GetLocalTimes(SYSTEMTIME* lpst);#pragma code();SYSTEMTIME time;GetLocalTime(&time);SetTagWord(Varname,time.wYear );SetTagWord(Varname,time.wMonth );SetTagWord(Varname,time.wDayOfWeek );S
5、etTagWord(Varname,time.wDay );SetTagWord(Varname,time.wHour );SetTagWord(Varname,time.wMinute );SetTagWord(Varname,time.wSecond );SetTagWord(Varname,time.wMilliseconds );如何经由Windows对话框设置日期和时间? 可以将修改日期、时间的Windows对话框调出来,调用程序如下: #include apdefap.hvoid onClick(char*lpszPictureName,char*lpszObjectName,ch
6、ar* lpszPropertyName) ProgramExecute(C:WIN95control.exe timedate.cpl); 注意:您在使用此程序时,需根据您的Control Panel安装的具体路径来填写。如何在WinCC里用C语言调用SQL语言?1、创建一个SQL文件。此文件在ISQL中创建,文件内容是所希望执行的SQL语句。 2、在WinCC的C Script中编写程序调用此SQL文件,如以下程序所示: #include apdefap.hvoid OnLButtonDown(char* lpszPictureName, char* lpszObjectName,char
7、* lpszPropertyName, UINT nFlags, int x, int y)char*a=C:SIEMENSCommonSQLANYISQL-q-b-cUID=DBA;PWD=SQL;DBF=E:testsqltestsqlRT.DB;DBN=CC_testsql_99-12-03_12:48:26R;READE:testsqltest.sql;printf(%srn,a);ProgramExecute(a);下面是一个简单的SQL文件内容:select * from pde#hd#t#test;output to E:test2.txt FORMAT ascii注意:文件名及
8、路径中不要带空格。如何整点启动归档? 在Global Script下的Project functions编写函数:cyclicarchive BOOL cyclicarchive()#pragma code (kernel32.dll);void GetLocalTime (SYSTEMTIME* lpst);#pragma code();SYSTEMTIME time;Int t1;GetLocalTime(&time);t1=time.wMinute;if(t1=00)SetTagBit(startarchive,1);return(BOOL)(GetTagBit(startarchive
9、); 在Tagloging中的Properties of process tag中的Archive Tagtab下的Archiving type选择Cycle-selective,在Event标签下的Start Event内选择cyclicarchive函数。 如何在按键组合被禁用的情况下,从WinCC运行环境进入WinCC Control Center? 最好是做一个按钮,该按钮需要用用户权限保护,在该钮中编写如下C-action: 低于WinCC 5.0版本:#pragma code (user32.dll);BOOL SetForegroundWindow(HWND);#pragma c
10、ode();HWND handle;handle=FindWindow(MCPFrameWndClass,NULL);If (!SetForegroundWindow(handle)Printf (rn SetForeground fails);WinCC 5.0版本以及更高的版本:#pragma code(user32.dll);BOOL SetForegroundWindow(HWND);#pragma code();HWND handle;handle=FindWindow(WinCCExplorerFrameWndClass,NULL);If (!SetForegroundWindow
11、(handle)Printf (rn SetForeground fails); 怎样对一个WinCC的项目进行转换? 当对一个V4.X版本的WinCC项目升级到5.X时,V4.X下的项目必须进行版本转换。若使用交叉索引编辑器时,必须保证项目已进行了正确无误的转换。 项目转换分下列几步依次完成:在WinCC资源管理器中,选中图形编辑器,击鼠标右健。 1.全局库的转换在弹出下拉菜单中选中转换全局库条目,系统会自动对全局库进行转换, 转换结束后退出。 2.项目库的转换在弹出下拉菜单中选中转换项目库条目,确认后系统自动对库进行转换。 3.图形画面转换在弹出下拉菜单中选中转换画面条目,在弹出画面按确认
12、后,系统自动进行所有画面的转换。 注意:包含有未定义对象的画面,如在PC机上未装相应对象服务器的,决不要转换, 否则画面会被损坏。 4.基本数据转换分屏向导:在WinCC资源管理器中,打开分屏向导(在基本数据项下)的弹出式菜单,并选择打开条目。报警记录向导:在WinCC资源管理器中,打开报警记录向导的弹出式菜单(在基本数据项下),并选择打开条目。我用WinCC Web Navigator时,为什么总是提示错误信息The maximum permissible number of user is connected to the WinCC-Server?您使用WinCCV5/SP1和Web N
13、avigatorV1.0时,您看到以上错误信息,错误原因是: 实际用户数目超过授权数量限制。措施:升级WebNavigator,使其能支持更多的客户端。 缺少授权,WinCC会提示您所缺少的授权。措施:添加所缺的授权。 未将WebNavigatorRT.exe加在WinCC启动列表中。措施:将此文件加入WinCC的启动列表中。Sound output by C script in WinCCSound output by C script in WinCCTop of FormThis entry is available in the following languages: Bottom
14、of FormEntry ID:748844Date:06/11/2002QUESTION:How can I output a sound via C script in WinCC? ANSWER:Attached is a small example. This C action is behind a button, so that you just click to the button to produce a sound. C action: #include apdefap.hvoid OnClick(char* lpszPictureName, char* lpszObjec
15、tName, char* lpszPropertyName, UINT nFlags, int x, int y)#pragma code (Winmm.dll )VOID WINAPI PlaySoundA ( char* pszSound, char* hmode, DWORD dwflag );#pragma code()PlaySoundA(C:Winnt.400Mediatada.wav,NULL,1);Requirement for this function is a sound card.Explanation of the PlaySoundA function: 1. Pa
16、rameter char* pszSound:Here you specify the complete path to where your sound file (*.wav file) is located. 2. Parameter char* hmode:Here you always specify 0. 3. Parameter DWORD dwflag.SND_SYNC = 0x0000: sound file is played once and the script waits until it has been played to the endSND_ASYNC = 0
17、x0001: sound file is played once, the script is processed in parallelSND_NODEFAULT = 0x0002: if the sound file is not found, then no default value is played, but nothing at all.SND_LOOP = 0x0008: repeats the sound file until the next PlaySoundA call comes (only possible with 0x0001) = always specify
18、 0x0009.These parameters can also be combined but bit-by-bit Ors (e.g.: SND_ASYNC | SND_LOOP) Note:If you want to use the beep of the computers internal loudspeaker instead of a sound file, then implement the following script:Since the internal loudspeaker is addressed, there is no need for a sound
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- SIMATIC WINCC
限制150内