西门子培训教程手册大合集的主要问题集锦_第1页
西门子培训教程手册大合集的主要问题集锦_第2页
西门子培训教程手册大合集的主要问题集锦_第3页
西门子培训教程手册大合集的主要问题集锦_第4页
西门子培训教程手册大合集的主要问题集锦_第5页
已阅读5页,还剩69页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1 丣 C-Action:#pragma code(kernel32.dll);BOOL Beep(DWORD dwFreq,DWORD dwDuration); #pragma code();Beep(500,500);2 C 俆享14 儈 WinCCBOOL OnBtnSinglAcknchar*lpszPictureName,char*lpszObjectName 5 儈 WinCCBOOL AXC_OnBtnSinglAcknchar*lpszPictureName,char*lpszObjectName24 WinCCBOOL OnBtnVisibleAcknchar*lpszPic

2、tureName,char*lpszObjectName5 儈 WinCCBOOL AXC_OnBtnVisibleAcknchar*lpszPictureName,char*lpszObjectName3 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);

3、SetTagWord(Varname,time.wDayOfWeek); SetTagWord(Varname,time.wDay); SetTagWord(Varname,time.wHour); SetTagWord(Varname,time.wMinute); SetTagWord(Varname,time.wSecond); SetTagWord(Varname,time.wMilliseconds);4 Windows Windows #includeapdefap.hvoid onClick(char*lpszPictureName,char*lpszObjectName, cha

4、r*lpszPropertyName)ProgramExecute(c:winntsystem32 control timedate.cpl );5 WinCC SQL 1 SQL ISQL SQL Windows 2 WinCC C Script SQL #includeapdefap.hvoid OnLButtonDown(char* lpszPictureName, char* lpszObjectName,char* lpszPropertyName, UINT nFlags,int x,int y)char*a=c:siemenscommonSQLANYISQL-q-b-c UID=

5、DBA;PWD=SQL;DBF=E:testsqltestsqlRT.DB; DBN=CC_testsql_99-12-03-12:48:26R;READE:testsqltest.sql; Printf(%srn,a); ProgramExcute(a); SQL select *from pde#hd#t#test;output to e:test2.txt FORMAT ascii6 Globle Script Project function cyclicarchive BOOL cyclicarchive()#pragma code(kernel.dll);void GetLocal

6、Time(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 tagarchive tagTab Archive type Cycle-selectiveEventStartEvent cyclicarchive 7 How can I set a

7、nd 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.hvoid OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)BOOL z;z=GetTagBit(MyBitVariable); if (z=0) Se

8、tTagBit(MyBitVariable,1); else SetTagBit(MyBitVariable,0);8 How can I program a waiting function (Sleep) in WinCC? The following sample program shows how the Sleep is used. #pragma code(Kernel32.dll)void Sleep(int milliseconds); #pragma code()Sleep(1000); /time specification in milliseconds Warning:

9、If you use Sleep(), processing the C script is interrupted for the time indicated. Requestsfor the interrupted function cannot be processed during this time.9 How can I output a SIMATIC timer minutes and seconds in WinCC? If you want to output a SIMATIC Timer in minutes and seconds in WinCC, then in

10、Winlease use a static text in the Graphics Designer to which you interface thefollowing action:char* _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)char *p; DWORD hilf; int min, sec;p=SysMalloc(10); hilf=GetTagDWord(Time); min=hilf/60000; sec=hilf%60000/1000;sprintf(p,%d m

11、in %d sec,min,sec);return p;The Time variable linked to the I/O field must have the following properties: Data type 32-bit value without sign Format adaptation DwordToSimaticBCDTimer Address: data area Times and addressing Word仈10僔 啐 WinCC 啐 亪() 仈 WinCC 俆OLE() (Smart Object) (Picture Window),-啐 C #i

12、ncludeapdefap.hvoid onClick(char *lpsz Picturechar *lpsz ObjectName,char *lpsz PropertyName)SetPictureName(, , ); / (PictureWindow)/11享仌 C (啐) Windows 12WinCC WinCC C 儈儈 E+H 420 PLC 4 20 儈儈 PLC 420 儈0.55.5 PLC 0100% C -#include apdefap.hlong _main(char* lpszPictureName, char* lpszObjectName, char* l

13、pszPropertyName)static int x=25,y,z;/x 25y z z=GetTagBit(202 ); / PLC if(z!=0)switch(y)case 0: x=x-4; if(x=25) y=0;break;return x;13丣丣 丣仈 WinCC 丣丣仈 WinCC WinCC Windows API C long _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)#pragma code(Winmm.dll)void WINAPI PlaySoundA(c

14、har *pszSound,char *hmode,DWORD dwflay); #pragma code()if(GetTagBit(112 ) PlaySoundA(d:winntmediaMircosoft sound.wav,NULL,8); return 1020;仈 享亴14 WinCC PC ?: 13 享 15 a to z, A to Z, 0 to 9 享 SIMATIC WinCC V6.0 DNS 15 plc S7 D801: WinCC 16 plc S7 8304:WinCC WinCC 8304 WinCC S7 仈: AS WinCCExplorer SIMA

15、TIC S7 PROTOCOL SUITE仈 S7 “ PLC”17?: WinCC C : & & | | ! Object Properties Dynamic WinCC Dynamic Value Ranges dialog 18WinCC 啐/ OCX“SpinButton” WinCC “Control”Microsoft Forms 2.0 SpinButton O “SpinButton”“Value” ActiveX () ActiveX 仈ActiveX C C ActiveX 5 5 C 19亴 HMI 儈 C 亩僔“Silentlogin.pas”亩“PAS” 亩 Gl

16、obal Script C Editor Actions Global Actions (Global Action)“Silentlogin.pas”“PWRTSilentLogin (“Login”,“Password”);”“Login” “Password” C CurrentUser “ 2 s” CurrentUser() 2 。“Startup”亩“Global Script Runtime”SIMATIC PCS 7(SIMATIC PCS 7 V6.0 SP1 儈)僔Welcome.pdl Graphics Designer Welcome.pdlC() Event Pict

17、ure Object Miscellaneous Open Picture)“PASSLoginDialog(Screen);” / C Welcome.pdl20 WinCC S7 ?:享C 1. DATE_AND_TIME Flag WinCC 1 SFC0 SET_CLKD B1 Flag ( DB1.DBX 8.0) WinCC SetTagBitWait(DB1_FLAG,TRUE) 1 C WinCC ,SFC0 享 Step7 DB SFC0 DATE_AND_TIMEDateAndTime SET_CLK Flag DateAndTime 0 享仈2. “ ” Unsigned

18、 8-bit value ByteToBCDByte DB WinCC Unsigned 16-bit value WordToBCDByte DB 3., WinCC C DB1 S7 PLC DBI_FLAG21 WINCC-1“”-“”-“”-“”-“ODBC” ODBC 2 DSN 亥亩亩“CC_ 亩_亩”亩3 #pragma code(UseGen.dll) #include USEGENAP.H #pragma code()LPCMN_ERROR err; / LPCMN_ERROR ,if (PWGENConnect(CC_ass_04-09-21_16:35:22,err) /

19、, CC_ass_04-09-21_16:35:22 if (PWGENChangePassword(GetTagChar(user),GetTagChar(oldpassword),GetTagChar(passw ord),err) /,user,oldpassword,password , , 8 /,PWGENDisconnect(err); / 456 APPLIB USEGENAP.H 22WinCC6.0 5.1 WinCC V6.0 MS SQL Server 2000 V5.1 segment 23WinCC6.0 WinCC V6.0 亩24 32 2 5040 5000

20、3250005040806400000 byte 800MB 20 1G1GB99GB25 3 2 。 302400 50 35030240045360000 byte 46MB 20 60MB 60MB9540MB26 27WinCC V5.1 1WinCC V5.1 V5.1 WinCC V5.1 Windows 2000 SP2 2) WinCC WinCC 28 WinCC OPC DA MS AccessMS SQL Server Oracle WinCC Industrial Data Bridge WinCC OPC DA MSAccessMS SQL Server Oracle

21、 128 5122K 10K29WinCC 儈WinCC 儈 250 。 WinCC RawData S7-400PLC 儈30 WinCC 儈WinCC RawData S7-400PLC 儈 PLC PLC 亪 DB PLC SFB37AR_Send DB WinCC, WinCC DLL 亪 WinCC 儈儈 仁 DB 1 。 PLC PLC DB 16KB DB DB 亪 CPU 31WinCC 儈123 WinCC V5.1 儈S7-400 CPUWinCC S7 400 S7 MPI,ProfiBus,TCP/IP,32 WinCC STEP 7 WinCC STEP 7 WinC

22、C 亩享 STEP 7 亩 Simatic 亩 CDDocumentsInstallNotes.chm WinCC STEP 7 WinCC STEP 7 享享 WinCC STEP 7STEP 7 WinCC 享33 WinCC 亩 STEP 7 亩 WinCC STEP 7 WinCC 亩 STEP 7 亩享 WinCC WinCC 傡 WinCC WinCC 僔 WinCC 亩 STEP 7 亩1. STEP 7 亩 O WinCC 亩2. STEP 7 亩 OS WinCC 亩 STEP 7 亩wincprojd:siemensSTEP7S7projSTEP7_Integrationw

23、incprojName of the OS3.亩Save as WinCC 亩 STEP 7 亩 亩亩Start SIMATIC WinCC Tools STEP 7 亩 WinCC 亩Packer WinCC 亩34wincc s7plc-sim PLCSIM 享亪STEP 7 V 5.x PLCSIM V4.x WinCC V5.x SIMATIC WinCC V5SP1 ,“”享“S7Dos”“” SIMATIC WinCC V5SP2 儈“S7Dos”“ ”亩 PG/PC “ PG/PC ” “”“MPI(WinCC)”“”“” STEP 7 SIMATIC PLCSIM亩亩亩 OS

24、PLCSIM 亩 WinCC 亩亩WinCC“SIMATIC S7 PROTOCOL SUITE” MPI “”“”“” MPI STEP 7 CPU WinCC 亩“ SIMATIC WinCC ”“” WinCC “ - MPI ” 亩“”“ - MPI ”“ PLC ”亩wincc PLC PLCSIM PLCSIM WINCC 亩 MPI MPI PLC PLCSIM I M I 35WINCC-:#pragma code(useadmin.dll)#include PWRT_API.H#pragma code()if (PWRTSilentLogin(username, PassWo

25、rd)/USERNAME,PASSWORD.:PWRTSilentLogin(GetTagChar(user), GetTagChar(PassWord),;,36WINCC- #pragma code(useadmin.dll) #include PWRT_api.h #Pragma code() PWRTlogin(1);#pragma code(useadmin.dll) #include PWRT_api.h #Pragma code() PWRTlogout();37 GIF wincc 俆 aniGIF.ocx ole GIF GIF 38亩 WinCCV6.0 亩 WinCC V

26、6.0 僔WinCC V6.0 WinCC V5.0 Service Pack2 WinCC V5.1 亩 WinCC V6.0 亩享俆WinCC V6.0 亩亩亩 WinCC 仈“ WinCC”“亩”“亩” :享享 WinCC V6.0 亩 dBASE III 亩: WinCC V5.0 SP2 V5.1 亩 WinCC V6.0亩亩 亩, 亩“”:享僔僔 WinCC V5.0 Service Pack 2 WinCC : WinCC V5.0 SP2 WinCC 亩享, WinCC V5.1亩 WinCC V6.0亩亩39wincc6.0 ab plc 傡WinCC V6.0 Allen

27、Bradley DH DH+ DH485 Allen Bradley Serial DF1 Applicom Multi Protocol InterfaceGE Fanuc SNP SNPXMitsubishi FX Modbus Protocol Suite Modbus SerialSIMATIC S5 PMC Ethernet SIMATIC S5 PMC Profibus SIPART OPC 40WINCC “Authorization SIK/SIMATIC WINCC RT 128 PowerTags is faulty.” authorsw manageauthorizati

28、on “recover autrorization”41: C 仈(acsun )WinCC Tag , C Tag . 146 WinCC 128 Tag C 仈儈. WinCC Tag Tag LTN44001 LTN44023 16 DD99.DW146 DD99.DW148 WinCC Tag PackageTag 32 DD99.DBD146 tag LTN44001 LTN44023 Global Script C UnionLong Dword Int Word2union Union.Dword=GetTagDword(PackageTag) SetTagWord(LTN440

29、01,Union.Word0) SetTagWord(LTN44023,Union.Word0) LTN44001 LTN44023 Tag WinCC Tag .42: WinCC C SQL 1 SQL ISQL SQL 2 WinCC C Script SQL i nclude apdefap.hvoid OnLButtonDown(char* lpszPictureName,char* lpszObjectName,char* lpszPropertyName,UINT nFlags, int x, int y)char*a=C:SIEMENSCommonSQLANYISQL-q-b-

30、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:43:Global Script Project functions cyclicarchiveBOOL cyclicarchive()#pragma code (kernel32.dll);void

31、 GetLocalTime (SYSTEMTIME* lpst);#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 tagArchive Tagtab Archiving type Cycle-selectiveEventStart Event cyclicarchive 44: WinCC WinCC Control Center C-action WinCC 5.0 #pragma code (user32.dll);BOOL SetForegroundWindow(HWND);#pragma code();HWND handle;handle=FindWindow(MCPFrameWndClass,NULL);If (!SetForegroundWindow(handle)Printf (rn SetForeground fails);WinCC 5.0 儈#pragma code(user32.dll);BOOL SetForegroundWindow(

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论