#include""intgscAction(void){#pragmacode("")VOIDWINAPIPlaySoundA(char*pszSound,char*hmode,DWORDdwFlag);#pragmacode()if(GetTagByte("TI101")>100) {PlaySoundA("C:\\\\ProgramFiles\\\\WindowsNT\\\\Pinball\\\\",NULL,1);}return0;}报警可以用以下两种实现方法:1、建一个全局脚本,时基为2S#include""intgscAction(void){#pragmacode("")VOIDWINAPIPlaySoundA(char*pszSound,char*hmode,DWORDdwFlag);#pragmacode()if(GetTagByte("TAG")==1) 或 if(GetTagByte("TAG")>500) {PlaySoundA("d:\\",NULL,1);}return0;}用以上程序就可以实现单个变量报警,开关量为1或模似量大于500都可以报警,用户可以根据自己的情况改变以上数值,、通过报警记录,先在报警记录中组态好报警记录建一个全局脚本,时基为2S#include""intgscAction(void){MSG_RTDATA_STRUCTmRT;inti;char*pszToken;//Nowismycode#pragmacode("")BOOLWINAPIsndPlaySoundA(char*szWave,DWORDdwFlag);#pragmacode()DWORDSND_ASYNC=0x0001;DWORDSND_LOOP=0x0008;DWORDalarmsum,alarmunack;LPCMN_ERRORerrorunack,errorsum;#pragmacode("")#pragmacode()LPDWORDlpdwServiceID;MSG_SERVICE_NOTIFY_PROClpfnNotifyProc;LPMSG_FILTER_STRUCTlpMsgFilter;DWORDdwNotifyMask;LPVOIDlpvUser;LPCMN_ERRORl
实现声音报警的方法 来自淘豆网m.daumloan.com转载请标明出处.