IFIX问题处理
- 格式:doc
- 大小:632.50 KB
- 文档页数:18
iFIX经典问题问答1:iFIX中如何使用vba开启和停止wsqlodc和alarmsODBC?DescriptionThe ability to stop or start the SQL task, wsqlodc, and to pause or continue the alarms toODBC task used to only be available by launching Mission Control and manually controlling the m.The ability to perform this control programmatically using VBA was added as part of a SIM for iFix 2.5. The function calls to allow this are not widely documented and are shown below: -ResolutionDeclare Function TurnOnSqlTask Lib "missionvba" (ByVal cmd$) As Long'Turns on a SQL task. The cmd$ parameter is the command line passed to the SQL task'Return of 0 is a success. Current logged in user must have security rights to turn'on/off SAC. If a non-zero error code is returned, you can use the err2str'utility in the fix base directory to translate the error to a stringDeclare Function TurnOffSqlTask Lib "missionvba" () As Long'Turns off a SQL task. Return of 0 is a success. Current logged in user must'have security rights to turn on/off SAC. If a non-zero error code is returned,'you can use the err2str utility in the fix base directory to translate the error to a stringDeclare Function PauseAlarmODBC Lib "missionvba" () As Long'Pauses the AlarmODBC task. Return of 0 is a success. Current logged in user does NOT'have to have security rights.'This function will execute regardless of the "Allow Operator to Pause Alarm Logging"'Setting found in the iFIX ODBC Alarm Service Configurator of the System Configuration'Utility.Private Declare Function ContinueAlarmODBC Lib "missionvba" () As Long'Resumes the AlarmODBC task. Return of 0 is a success. Current logged in user does NOT'have to have security rights.'This function will execute regardless of the "Allow Operator to Pause Alarm Logging"'Setting found in the iFIX ODBC Alarm Service Configurator of the System Configuration'Utility.'All of these functions will block until the request is completed.2:iFIX如何使用vba开启和停止基于时间和事件的调度?Description:This solution shows how to start and stop a time-based or event-based schedule running in the background.Resolution:STOP / START a EVENT BASED SCHEDULETo Start:Private Sub CommandButton1_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject(, "FixBackGroundServer.Application")Set Var2 = Var1.System.FindObject("SchedTest1.FIXEvent1")Var2.StartEventEnd SubTo Stop:Private Sub CommandButton1_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject(, "FixBackGroundServer.Application")Set Var2 = Var1.System.FindObject("SchedTest1.FIXEvent1")Var2.StopEventEnd SubSTOP / START a TIME BASED SCHEDULETo Stop the TimerObject:Private Sub CommandButton1_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject (,"FixBackGroundServer.Application")Set Var2 = Var1.System.FindObject("Sched1.Timer1")Var2.TimerEnabled = FalseEnd SubTo Start the TimerObject:Private Sub CommandButton2_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject (,"FixBackGroundServer.Application")Set Var2 = Var1.System.FindObject("sched.Timer1")Var2.TimerEnabled = TrueVar2.StartTimerEnd Sub3:iFIX如何使用vba进行网络打印机打印?Description:The following is an example of printing an Excel Document to a Network Printer or a printer other than thedefault printer on the machine.Dim objXL As ObjectDim myDoc As ObjectSet objXL = CreateObject("Excel.Application")Set myDoc = objXL.Workbooks.Open("C:\testfile.xls", , True)myDoc.Printout copies:=1, preview:=False, ActivePrinter:="'\\SERVER\PRINTER", printtofile:= False, collate:=TruemyDoc.CloseSet objXL = NothingSet myDoc = NothingReferencesIf this script is used in a background schedule with FixBackgroundServer configured to run as a S ervice, the Fixservice must run under a user account that has printers defined. See KnowledgeBase Article i0134 17 for moreinformation on this configuration.The Printout command can be used for other document types (Word, PowerPoint, etc), however different syntaxis required, refer to for other examples.4:iFIX报警状态代码以及意义?Description:FIX displays alarm status codes for each alarm in the Alarm Summary Link. What is the meaning of each of these codes?ResolutionPriority --> Alarm Type --> Description1 --> COMM --> Communication Error ("BAD" value)1 --> OCD --> Open circuit detected1 --> OVER --> Over Range1 --> UNDER --> Under Range1 --> ERROR --> Any Statistical Data block alarm2 --> CFN --> Change from normal alarm (digital blocks only)2 --> COS --> Change of State alarm (digital blocks only)2 --> HIHI --> Block in HIHI alarm state2 --> LOLO --> Block in LOLO alarm state3 --> RA TE --> Value exceeds rate-of-change setting3 --> HI --> Block in HI alarm state3 --> LO --> Block in LO alarm state4 --> DEV --> Deviation Alarm5 --> OK --> Block in normal state5:如何禁止和使能7X驱动标签点(对驱动自动禁止特别有用)?Dim opcDriver As New OPCDrv.OPCServerDim objDriver As ObjectDim strDRVAcronym As StringDim strProgId As String''Variables for GetChannelDim lngNumChannels As LongDim lngChanHandlesDim strChanNames''Variables for GetDevicesDim lngNumDevices As LongDim lngDeviceHandlesDim strDeviceNames''Variables for GetDataBlocksDim lngNumDataBlocks As LongDim lngDataBlockHandlesDim strDataBlockNamesDim i As IntegerDim j As IntegerDim lngErrorsDim myvar As LongDim readEnable'strDRV Acronym = InputBox("Please enter the driver''s three letter acronym?" & vbCrLf & "(For Example:Enter ABR for the ABR Driver)", "What Driver are you using?")'strProgId = "Intellution." & strDRV Acronym & "drv"'strProgId = "Matrikon.OPC.Simulation.1"'Set objDriver = CreateObject(strProgId)lngNumChannels = opcDriver.GetChannels(lngChanHandles, strChanNames)''Build Variables for SetPropertyData function.lngHandle = lngDataBlockHandles(0)varProperties = "Enabled"varProperyData = "1"opcDriver.GetPropertyData lngChanHandles(1), varProperties, readEnable'对服器1置真If readEnable = "0" ThenlngErrors = opcDriver.SetPropertyData(lngChanHandles(1), varProperties, varProperyData) End IflngNumDevices = opcDriver.GetDevices(lngChanHandles(1), lngDeviceHandles, strDeviceName s)lngNumDataBlocks = opcDriver.GetDataBlocks(lngDeviceHandles(0), lngDataBlockHandles, str DataBlockNames)lngHandle = lngDataBlockHandles(0)'读工作组opcDriver.GetPropertyData lngDeviceHandles(0), varProperties, readEnableIf readEnable = "0" ThenlngErrors = opcDriver.SetPropertyData(lngDeviceHandles(0), varProperties, varProperyData) End If'处理工作块opcDriver.GetPropertyData lngDataBlockHandles(0), varProperties, readEnableIf readEnable = "0" ThenFor i = 0 To 1lngErrors = opcDriver.SetPropertyData(lngDataBlockHandles(i), varProperties, varProperyD ata)Next iEnd IfSet opcDriver = Nothing6:iFIX_如何使用脚本实现驱动(7x)的启动和停止?DescriptionThe following solution explains how to Start and Stop a 7.x driver through VBA code. This examp le usesthe ABR driver. To implement this with another 7.x driver, change the ABR to the three letter acro nym ofthe other driver and switch the reference to that driver.ResolutionThis code will only work with 7.x drivers. If you want to implement this is code in a new picture y ouneed to set a reference to Intellution ABRDrv OPC Server 7.20 Library. To set a reference, use the following steps:1) On the Tools menu in the VB Editor choose References.2) Select the Intellution ABRDrv OPC Server 7.20 Library from the list.Add two command buttons to your picture and name them cmdStart_Click and cmdStop_Click.Then paste the following code into the picture:Private Sub cmdStart_Click()Dim ABRDriver As New ABRDrv.ABRServerABRDriver.StopSet ABRDriver = NothingEnd SubPrivate Sub cmdStop_Click()Dim ABRDriver As New ABRDrv.ABRServerABRDriver.StartSet ABRDriver = NothingEnd Sub7:iFIX_如何使用脚本实现驱动(6x)的启动和停止?DescriptionThis articles describes how to control (start or stop) the 6.x drivers through VBA, Command Script,or DOS rather than in Mission Control.ResolutionThe attached application DCTRL61.EXE enables you to do this. Below are the usage instructions. Usage: DCTRL command driver acronym delay [sleep]where command is:START - start the driverSTOP - stop the driver from pollingSTOP_EXIT - stop polling and exitSLEEP - set new sleep time (period)STA TUS - displays current valuesDELAY - Wait a Number of milliseconds before executing this command ( 1000 = 1 second).The the dctrl61.exe must be located in the FIX32 or Dynamics directory. The command and driver acronym must be in ALL CAPS.Example from the DOS prompt: dctrl60 START MBRExample from a iFIX VBA: Shell c:\fix32\dctrl60 "START MBR"Example from a FIX32 script: Runtask c:\fix32\dctrl60 "START MBR"8:iFIX_脚本进行调度的启动和关闭方法?DescriptionThis solution shows how to start and stop a time-based or event-based schedule running in the bac kground.ResolutionSTOP / START a EVENT BASED SCHEDULETo Start:Private Sub CommandButton1_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject(, "FixBackGroundServer.Application")Set Var2 = Var1.System.FindObject("SchedTest1.FIXEvent1")Var2.StartEventEnd SubTo Stop:Private Sub CommandButton1_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject(, "FixBackGroundServer.Application") Set Var2 = Var1.System.FindObject("SchedTest1.FIXEvent1")Var2.StopEventEnd SubSTOP / START a TIME BASED SCHEDULETo Stop the TimerObject:Private Sub CommandButton1_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject (,"FixBackGroundServer.Application") Set Var2 = Var1.System.FindObject("Sched1.Timer1")Var2.TimerEnabled = FalseEnd SubTo Start the TimerObject:Private Sub CommandButton2_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject (,"FixBackGroundServer.Application") Set Var2 = Var1.System.FindObject("sched.Timer1")Var2.TimerEnabled = TrueVar2.StartTimerEnd Sub9:iFIX_excel报表实现的方法?Private Sub CommandButton1_Click()'注释: 1。
iFIX通信故障分析及解决方案袁思远(安徽华电宿州发电有限公司,安徽 宿州 234000)Failure Analysis and Solution of iFIX CommunicationYUAN Siyuan(Anhui Huadian Suzhou Power Generation Co., Ltd., Suzhou 234000)〔摘 要〕 介绍了Proficy HMI /SCADA -iFIX 的基本原理及通信数据流,对某公司iFIX 出现的通信故障问题进行了总结,并分析故障原因,给出了解决方案,在此基础上,提供了快速解决iFIX 通信故障相关问题的方法、建议及思路。
〔关键词〕 组态软件;通信故障;过程控制;I /O 驱动器Abstract :This paper introduces the basic principle and communication data flow of Proficy HMI / SCADA-iFIX, summarizes the communication failure problems of iFIX in a company, analyzes the causes of the failure, and gives the solutions. On this basis, it provides the methods, suggestions and ideas for quickly solving the problems related to the communication failure of iFIX.Key words :configuration software; communication failure; process control; I/O driver 中图分类号:TM73 文献标识码:A 文章编号:1008-6226 (2020) 04-0061-03制软件,运用先进的自动化技术、计算机技术和网络技术于一身,可以实现过程数据的采集、实时过程参数监视、报警、控制和报表查询打印、实时趋势显示、历史数据查看等功能。
IFIX 历史趋势图起始时间问题解决方案IFIX演示工程上的趋势图功能强大及使用,一般在做工程时会借鉴里面的画面及控件。
简单的把画面拷贝到新的工程总会出现很多问题,功能不能实现,VBA脚本报错等问题。
先做一个工程借用演示工程的趋势图出现一个起始时间不能设置的问题,添加历史曲线后只能看最新的曲线,看前几天曲线时要一点一点的往前翻,而不能直接选择时间查看当天。
实例所带的是VBA的一个窗口,使用下拉框控件,该空间显示为short的日期,在该处选择日期,在演示工程中使用很好,拷贝到新工程就不可以了,而且报错。
先讨论一下该日期的来源:我们做历史数据时可以设置保存数据格式 4小时,8小时,24小时等。
相应历史数据文件会保存到..\HATDATA\FIX文件夹中。
然后通过FindHistoricalFiles函数进行查找,该函数会自动查找..\HATDATA\FIX文件夹下的文件名称,读取文件名提取日期保存到变量中赋值给日期选择下拉列框。
演示系统函数会默认读取安装模块所带默认工程中的数据。
当新建工程是工程文件可能会改变。
会发现下拉列框中没有实际保存的数据。
而且FindHistoricalFiles函数在演示系统中实在project_user的modhistoricalFiles模块中进行定义的,想正确使用必须从演示系统中导出,在新系统中导入并且修改,较为繁琐。
如该函数正确使用,会发现历史文件越来越多,函数读取的文件名称越多,下拉列框的数据也会越来越多,不方便操作解决方案:1.在CFixPicture_Initialize()过程中将图片对象(Chart Object)起始时间srtChartStartDT=FindHistoricalFiles(“THISNODE”)(0),修改为srtChartStartDT=NOW,2.日期选择控件使用DTPicker代替下拉列框做为趋势图时间选择。
把DTPicker返回值赋予变量参数strselectedDate.其他地方不用修改,因为VBA 中该变量多处使用如不明白框架,修改一次而动全身。
IFIX报警区域数据库不匹配解决方法
报警截图:
问题解释:
每个动态的过程数据库(PDB) 文件都有一个相关的
报警区数据库(AAD) 文件,如下图:。
当一个PDB文件开始被装载,不管iFIX是在启动或是运行时,PDB
文件将试图定位其相关的AAD文件,为这个PDB文件定位到AlarmAreas.AAD文件并将其装入AADPATH。
如果AlarmAreas.AAD文件不匹配,将出现下面的信息:
如果继续,块的报警区指派可能不合法,这个数据库将无法保存。
如果单击“确定”并继续,在所有块中的所有报警区都将被改为“ALL”。
此外,将不能保存数据库,因为所有的自定义的字段
将丢失。
解决方法:
方法1:定位正确的AAD文件并将其复制到Local文件夹下,覆盖AlarmAreas.AAD文件。
方法2:导出PDB文件为CSV格式文件,在导出的CSV文件中更改报警区,并将新的CSV文件导入一个空数据库中。
Prificy软件问题与解答1、安装时选网络还是独立,如果选择了独立还能改为网络吗:可以,但要修改配置的启动和安全性,并保存配置,重新启动,如果安全不能进去,可以先手动登录,独立不与网络上的其他软件交换数据,选择网络时并且做冗余时需要配置节点和逻辑节点(如果是单台服务器可以不用配逻辑节点,客户端只配远程节点就可以了),画面连时选择逻辑节点2、装ifix5时historia3.1要装吗:可以不装3、winstaller3.0要装吗,不装行吗:可以不装,需要时再单独装4、webspace与portal区别:基于WEB的scada,不需要转换画面;基于WEB的hmtl,需要转换画面,较慢,可以编辑页面5、historia能和sql server2008配套吗:配套,装ih时装sql express6、冗余如何实现,需要购买单独的授权吗:要单独买(选项),5.0后狗里限制,同步报警、实时数据库,节点选网络7、一个开发、一个运行,一个搞好后,另一个如何配置:直接复制工程,修改相关配置,启动项,安全性等8、工程如何移植到另一台电脑中,要修改那些东西:直接将项目目录(不要在C盘)拷贝到另外的电脑,再修改配置的项目路径,然后修改启动节点及scu配置文件、安全性等9、画面可以导出(不能实现),能导入吗:画面可以直接复制,不用导入导出,导出功能是转换为Portal网页文件10、ifix标准版具有网络互联功能吗:不具有,要用PLuse网络版,专业版具有标签签名、配方等高级功能ifix标准版能和另外一台电脑的ih相连吗:不可以,它不具有网络功能,且ifix标准版不能和远程的数据库SQL连接11、启动时总出现报警益处提示,如何解决解决办法:打开scu---报警配置—高级点击队列配置,将数值改最大3276712、新建ifix工程方法截图:启动ifix首项打开SCU配置画面, 点击新建配置-scada, scada支持启动配置-路径,根目录选择路径—点击更改根目录—粘贴默认安装根目录---点击更改项目---点击是点击确定---点击是点击否点击创建全部点击继续,再配置网络功能配置本地启动的节点等,保存配置,确认为启动配置启动ifix,登录Admin,再打开SCU刚才的配置文件,配置安全性—配置,更改安全路径并启动更改安全性—自动登录,更改节点名,及自动登录用户,保存安全性配置配置SCU的任务,加工作台自动启动保存配置启动生成的工程注意:在启动别的节点名的工程时,需要再修改scu的安全性(配置及自动启动)及本地启动配置;scu只是个工程新建和配置工具,可以修改和打开别的工程配置文件,但安全性和本地启动需要重新修改。
I F I X问题处理IFIX冗余服务器配置IFIX冗余服务器配置 (3)IFIX冗余服务器数据源的切换 (7)历史报警的查询(这里只做出来在客户机上生成的) (10)历史数据时间保存一年。
(16)冗余服务器历史数据同步。
(16)当服务器切换时,客户机的历史趋势仍然能切换。
(16)计算机启动时IFIX自动运行。
(17)IFIX冗余服务器配置首先配置—网络如图所示添加远程节点名,然后点击配置见如图所示。
然后配置-SCADA组态,如图所示,SCADA邻居为SER02然后配置—本地启动,见如图所示,本地节点名为SER01,本地逻辑节点名为IFIX最后更改C:\WINDOWS\system32\drivers\etc目录下的hosts文件用记事本打开更改如下图所示其中圈里面的东西为增加的地方,包含两个冗余服务器,五个客户机。
至此主服务器的配置就完成了。
备服务器配置更改与主服务器类似。
只是需要注意SCADA邻居为SER01,本地节点名需为SER02。
其他不需要更改。
客户机的配置禁用SCADA支持本地启动需更改为如图所示,本地节点名和本地逻辑节点名均为CL4(以客户机4为例)其他配置和服务器一样,包括网络配置和更高hosts文件。
到这里IFIX冗余服务器的系统配置完成。
IFIX冗余服务器数据源的切换当客户机与主服务器连接丢失时,系统会自动切换到备用的服务器,达到自动切换的效果,果然主服务器这时候恢复正常,不会自动切换回主服务器(可以自动切换不推荐),此时如果需要切换回去,能够在操作站画面上手动的方式切换。
效果图如上图所示,代表此时连接的是SER01的数据源,SER01与SER02都正常。
点击中间的按钮可以实现SER01和SER02的手动切换。
当主服务器故障时,系统会自动切换到SER02,如图所示此时代表SER01与该客户机通信故障,接收的是SER02的数据源。
当主服务器恢复后不会自动切换回(可以自动切换,但是不推荐,因为IFIX如果是服务器与PLC通信故障是不会达到切换的效果的,此时需要手动切换)手动切换方法:新建一个如图所示的画面(参见系统自带画面LocalAsPrimary.GRF、但是在客户机上需更改)更改的部分为原画面中所有的标签后缀_0更改为_1,且脚本的也要进行相应的修改。
1、软件分辨率问题,怎么样才能解决笔记本分辨率和台式机分辨率问题。
2、打开一个工程项目后,需要再打开另外一个项目,怎么办?3、服务器端和客户机端区别是什么?客户机(工作站)怎么连接服务器的。
4、怎么样增加flash控件,增加位图,且可以改变颜色的,5、图片旋转专家要选择数据源?6、线条粗细怎么调整?7、火灾报警系统,怎么报警?调度里面,模拟量数据大小的报警,弹出画面标签组,8、怎么样对多个组件进行操作,比如说车道指示器,有多个,怎么样才能不需要一个个点击那个打开画面专家就可以操作的呢?9、工具栏上的“变量“怎么用法?10、用户管理和报表语言。
11、数据显示方面,12、SIM IO地址10和10:1区别13、施耐德PLC内存0 开头的数字量输出中间两%m1 开头的数字输入%i3 开头的模拟两输入%iw4 开头的模拟两输出和中间两%mwEbool 和外面通信的,bool内部使用。
历史数据库先在历史趋势定义中把变量添加好在任务控制中将htc 启动系统配置应用中任务配置把htc_scan添加好。
调度系统配置应用中任务配置把fixbackgroud添加好。
调度,报警,基于事件项中添加变量调度属性改为后台运行状态为激活即可。
服务器和客户端客户端在system32\drivers\etc\hosts 中把服务器的ip 和节点改好,系统配置应用里面把网络配置登陆安全应用配置启动,在全局变量中添加3个变量用户首选项:常规,环境保护,需要配置。
硬件狗,先插上狗,再安装软件。
先装ifix ,再装授权。
阙值表:能改变颜色。
写值不能写到group上的要写到group以下层的rect方格和其他的取值在画面上显示而取前景色2种方式Group 中直接在group中动画在高级动画产生的动画名称为AnimateForegroudColor Rect74 等图形中则直接在图形中动画名称为Lookup时间定义:MyDate = Now()MyMonth = Month(MyDate)MyDay = Day(MyDate)MyHour = Hour(MyDate)MyMinute = Minute(MyDate)MySecond = Second(MyDate)StartTime = "2000" & "-" & MyMonth & "-" &MyDay - 1 & " " & "00:00:00"EndTime = "2000" & "-" & MyMonth & "-" &MyDay - 1 & " " & "23:00:00"Private Sub CommandButton1_Click()WriteValue "1", "FAN_ZH" 为sim内部变量user.fan_z.CurrentValue = 1 为全局变量Historian 访问方式:1、excel 宏2、图表3、vba 4、ole db。
i f i x经典问题回答iFIX经典问题问答1:iFIX中如何使用vba开启和停止wsqlodc和alarmsODBC?DescriptionThe ability to stop or start the SQL task, wsqlodc, and to pause or continue the alarms toODBC task used to only be available by launching Mission Control and manually co ntrolling them.The ability to perform this control programmatically using VBA was added as part of a SIM foriFix 2.5. The function calls to allow this are not widely documented and are shown be low: -ResolutionDeclare Function TurnOnSqlTask Lib "missionvba" (ByVal cmd$) As Long'Turns on a SQL task. The cmd$ parameter is the command line passed to the SQL ta sk'Return of 0 is a success. Current logged in user must have security rights to turn'on/off SAC. If a non-zero error code is returned, you can use the err2str'utility in the fix base directory to translate the error to a stringDeclare Function TurnOffSqlTask Lib "missionvba" () As Long'Turns off a SQL task. Return of 0 is a success. Current logged in user must'have security rights to turn on/off SAC. If a non-zero error code is returned,'you can use the err2str utility in the fix base directory to translate the error to a string Declare Function PauseAlarmODBC Lib "missionvba" () As Long'Pauses the AlarmODBC task. Return of 0 is a success. Current logged in user does NOT'have to have security rights.'This function will execute regardless of the "Allow Operator to Pause Alarm Logging "'Setting found in the iFIX ODBC Alarm Service Configurator of the System Configur ation'Utility.Private Declare Function ContinueAlarmODBC Lib "missionvba" () As Long'Resumes the AlarmODBC task. Return of 0 is a success. Current logged in user doe s NOT'have to have security rights.'This function will execute regardless of the "Allow Operator to Pause Alarm Logging "'Setting found in the iFIX ODBC Alarm Service Configurator of the System Configur ation'Utility.'All of these functions will block until the request is completed.2:iFIX如何使用vba开启和停止基于时间和事件的调度?Description:This solution shows how to start and stop a time-based or event-based schedulerunning in the background.Resolution:STOP / START a EVENT BASED SCHEDULETo Start:Private Sub CommandButton1_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject(, "FixBackGroundServer.Application")Set Var2 = Var1.System.FindObject("SchedTest1.FIXEvent1")Var2.StartEventEnd SubTo Stop:Private Sub CommandButton1_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject(, "FixBackGroundServer.Application")Set Var2 = Var1.System.FindObject("SchedTest1.FIXEvent1")Var2.StopEventEnd SubSTOP / START a TIME BASED SCHEDULETo Stop the TimerObject:Private Sub CommandButton1_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject (,"FixBackGroundServer.Application")Set Var2 = Var1.System.FindObject("Sched1.Timer1")Var2.TimerEnabled = FalseEnd SubTo Start the TimerObject:Private Sub CommandButton2_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject (,"FixBackGroundServer.Application")Set Var2 = Var1.System.FindObject("sched.Timer1")Var2.TimerEnabled = TrueVar2.StartTimerEnd Sub3:iFIX如何使用vba进行网络打印机打印?Description:The following is an example of printing an Excel Document to a Network Printer or a printer other than thedefault printer on the machine.Dim objXL As ObjectDim myDoc As ObjectSet objXL = CreateObject("Excel.Application")Set myDoc = objXL.Workbooks.Open("C:\testfile.xls", , True)myDoc.Printout copies:=1, preview:=False, ActivePrinter:="'\\SERVER\PRINTER", printtofile:=False, collate:=TruemyDoc.CloseSet objXL = NothingSet myDoc = NothingReferencesIf this script is used in a background schedule with FixBackgroundServer configured t o run as a Service, the Fixservice must run under a user account that has printers defined. See KnowledgeBase Article i013417 for moreinformation on this configuration.The Printout command can be used for other document types (Word, PowerPoint, etc) , however different syntaxis required, refer to for other examples.4:iFIX报警状态代码以及意义?Description:FIX displays alarm status codes for each alarm in the Alarm Summary Link. What is t he meaning of each of these codes?ResolutionPriority --> Alarm Type --> Description1 --> COMM --> Communication Error ("BAD" value)1 --> OCD --> Open circuit detected1 --> OVER --> Over Range1 --> UNDER --> Under Range1 --> ERROR --> Any Statistical Data block alarm2 --> CFN --> Change from normal alarm (digital blocks only)2 --> COS --> Change of State alarm (digital blocks only)2 --> HIHI --> Block in HIHI alarm state2 --> LOLO --> Block in LOLO alarm state3 --> RATE --> Value exceeds rate-of-change setting3 --> HI --> Block in HI alarm state3 --> LO --> Block in LO alarm state4 --> DEV --> Deviation Alarm5 --> OK --> Block in normal state5:如何禁止和使能7X驱动标签点(对驱动自动禁止特别有用)?Dim opcDriver As New OPCDrv.OPCServerDim objDriver As ObjectDim strDRVAcronym As StringDim strProgId As String''Variables for GetChannelDim lngNumChannels As LongDim lngChanHandlesDim strChanNames''Variables for GetDevicesDim lngNumDevices As LongDim lngDeviceHandlesDim strDeviceNames''Variables for GetDataBlocksDim lngNumDataBlocks As LongDim lngDataBlockHandlesDim strDataBlockNamesDim i As IntegerDim j As IntegerDim lngErrorsDim myvar As LongDim readEnable'strDRVAcronym = InputBox("Please enter the driver''s three letter acronym?" & vbC rLf & "(For Example:Enter ABR for the ABR Driver)", "What Driver are you using?")'strProgId = "Intellution." & strDRVAcronym & "drv"'strProgId = "Matrikon.OPC.Simulation.1"'Set objDriver = CreateObject(strProgId)lngNumChannels = opcDriver.GetChannels(lngChanHandles, strChanNames)''Build Variables for SetPropertyData function.lngHandle = lngDataBlockHandles(0)varProperties = "Enabled"varProperyData = "1"opcDriver.GetPropertyData lngChanHandles(1), varProperties, readEnable'对服器1置真If readEnable = "0" ThenlngErrors = opcDriver.SetPropertyData(lngChanHandles(1), varProperties, varProp eryData)End IflngNumDevices = opcDriver.GetDevices(lngChanHandles(1), lngDeviceHandles, str DeviceNames)lngNumDataBlocks = opcDriver.GetDataBlocks(lngDeviceHandles(0), lngDataBlock Handles, strDataBlockNames)lngHandle = lngDataBlockHandles(0)'读工作组opcDriver.GetPropertyData lngDeviceHandles(0), varProperties, readEnableIf readEnable = "0" ThenlngErrors = opcDriver.SetPropertyData(lngDeviceHandles(0), varProperties, varPr operyData)End If'处理工作块opcDriver.GetPropertyData lngDataBlockHandles(0), varProperties, readEnableIf readEnable = "0" ThenFor i = 0 To 1lngErrors = opcDriver.SetPropertyData(lngDataBlockHandles(i), varProperties, varProperyData)Next iEnd IfSet opcDriver = Nothing6:iFIX_如何使用脚本实现驱动(7x)的启动和停止?DescriptionThe following solution explains how to Start and Stop a 7.x driver through VBA code. This example usesthe ABR driver. To implement this with another 7.x driver, change the ABR to the thr ee letter acronym ofthe other driver and switch the reference to that driver.ResolutionThis code will only work with 7.x drivers. If you want to implement this is code in a n ew picture youneed to set a reference to Intellution ABRDrv OPC Server 7.20 Library. To set a refer ence, use the following steps:1) On the Tools menu in the VB Editor choose References.2) Select the Intellution ABRDrv OPC Server 7.20 Library from the list.Add two command buttons to your picture and name them cmdStart_Click and cmdSt op_Click.Then paste the following code into the picture:Private Sub cmdStart_Click()Dim ABRDriver As New ABRDrv.ABRServerABRDriver.StopSet ABRDriver = NothingEnd SubPrivate Sub cmdStop_Click()Dim ABRDriver As New ABRDrv.ABRServerABRDriver.StartSet ABRDriver = NothingEnd Sub7:iFIX_如何使用脚本实现驱动(6x)的启动和停止?DescriptionThis articles describes how to control (start or stop) the 6.x drivers through VBA, Co mmand Script,or DOS rather than in Mission Control.ResolutionThe attached application DCTRL61.EXE enables you to do this. Below are the usage instructions.Usage: DCTRL command driver acronym delay [sleep]where command is:START - start the driverSTOP - stop the driver from pollingSTOP_EXIT - stop polling and exitSLEEP - set new sleep time (period)STATUS - displays current valuesDELAY -Wait a Number of milliseconds before executing this command ( 1000 = 1 second). The the dctrl61.exe must be located in the FIX32 or Dynamics directory. The comma nd and driveracronym must be in ALL CAPS.Example from the DOS prompt: dctrl60 START MBRExample from a iFIX VBA: Shell c:\fix32\dctrl60 "START MBR"Example from a FIX32 script: Runtask c:\fix32\dctrl60 "START MBR"8:iFIX_脚本进行调度的启动和关闭方法?DescriptionThis solution shows how to start and stop a time-based or event-based schedule running in the background.ResolutionSTOP / START a EVENT BASED SCHEDULETo Start:Private Sub CommandButton1_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject(, "FixBackGroundServer.Application")Set Var2 = Var1.System.FindObject("SchedTest1.FIXEvent1")Var2.StartEventEnd SubTo Stop:Private Sub CommandButton1_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject(, "FixBackGroundServer.Application")Set Var2 = Var1.System.FindObject("SchedTest1.FIXEvent1")Var2.StopEventEnd SubSTOP / START a TIME BASED SCHEDULETo Stop the TimerObject:Private Sub CommandButton1_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject (,"FixBackGroundServer.Application")Set Var2 = Var1.System.FindObject("Sched1.Timer1")Var2.TimerEnabled = FalseEnd SubTo Start the TimerObject:Private Sub CommandButton2_Click()Dim Var1 As ObjectDim Var2 As ObjectSet Var1 = GetObject (,"FixBackGroundServer.Application")Set Var2 = Var1.System.FindObject("sched.Timer1")Var2.TimerEnabled = TrueVar2.StartTimerEnd Sub9:iFIX_excel报表实现的方法?Private Sub CommandButton1_Click()'注释: 1。
iFIX启动时的几种常见问题及解决方法第一个现象:启动iFIX,出现下述提示:故障原因:出现上面的提示是因为打开的工程目录与备份时的目录不同。
解决方法:最简单的就是将备份恢复到原来的路径中。
可以通过下面的方法打开SCU看到路径。
如果想恢复到其它的路径中,按下面的方法做:1)打开下面这个界面,运行SCU:2)打开你备份的SCU文件:3)我的这个例子中,原来的程序是放在F盘中,现在将备份恢复到了D盘。
因此,在SCU 中的路径中看到的是F盘。
4)修改项目路径为D:\IFIX\XHUA,注意,不要修改根目录和语言的路径:上图中只修改了项目的路径。
5)点下面的更改项目按钮,提示如下图:选否。
保存SCU。
第二种现象:运行工程后,提示如下:如果点确定后,再运行,会提示,点确定后,再一次点,则提示。
故障原因:出现这个提示,很多人认为是没有启用安全。
其实不是这样的,工程的安全如果备份前是启用的,备份后也是启用的。
真正的原因是当前打开的工程的安全配置路径和备份的工程安全配置路径不相同。
安全配置和SCU是两个完全不同的应用程序,安全配置是保存在A TCOMPAT.UTL和XTCOMPAT.UTL中的,因此通过修改SCU的工程路径是不能修改到这两个文件的。
要手动修改安全配置路径。
通过下图可以看出,直接打开工程的SCU,安全配置是灰色的,不能修改。
如果运行iFIX,又提示安全未启用,进不了安全配置。
解决方法:最简单的当然还是将备份恢复到原来的路径中。
如果恢复到了其它路径中,按下面的方法解决。
1. 随便新建个工程,不要用演示系统和iFIX自带的工程(原因下面再说),进入SCU 配置中打开你的工程的SCU文件,进入安全配置,会看到下图:F:\AAA\LOCAL是我随便建的一个空工程。
2. 修改安全路径和备份路径为你要打开工程的LOCAL路径,启用和禁止不用管,你原来的工程是什么,会自动调整。
我的工程放在D:\IFIX\XHUA下。
IFIX冗余服务器配置
IFIX冗余服务器配置 (2)
IFIX冗余服务器数据源的切换 (6)
历史报警的查询(这里只做出来在客户机上生成的) (8)
历史数据时间保存一年。
(15)
冗余服务器历史数据同步。
(15)
当服务器切换时,客户机的历史趋势仍然能切换。
(15)
计算机启动时IFIX自动运行。
(16)
IFIX冗余服务器配置
首先配置—网络如图所示添加远程节点名,然后点击配置见如图所示。
然后配置-SCADA组态,如图所示,SCADA邻居为SER02
然后配置—本地启动,见如图所示,本地节点名为SER01,本地逻辑节点名为IFIX
最后更改C:\WINDOWS\system32\drivers\etc目录下的hosts文件
用记事本打开更改如下图所示
其中圈里面的东西为增加的地方,包含两个冗余服务器,五个客户机。
至此主服务器的配置就完成了。
备服务器配置更改与主服务器类似。
只是需要注意SCADA 邻居为SER01,本地节点名需为SER02。
其他不需要更改。
客户机的配置
禁用SCADA支持
本地启动需更改为如图所示,本地节点名和本地逻辑节点名均为CL4(以客户机4为例)
其他配置和服务器一样,包括网络配置和更高hosts文件。
到这里IFIX冗余服务器的系统配置完成。
IFIX冗余服务器数据源的切换
当客户机与主服务器连接丢失时,系统会自动切换到备用的服务器,达到自动切换的效果,果然主服务器这时候恢复正常,不会自动切换回主服务器(可以自动切换不推荐),此时如果需要切换回去,能够在操作站画面上手动的方式切换。
效果图如上图所示,代表此时连接的是SER01的数据源,SER01与SER02都正常。
点击中间的按钮可以实现SER01和SER02的手动切换。
当主服务器故障时,系统会自动切换到SER02,如图所示
此时代表SER01与该客户机通信故障,接收的是SER02的数据源。
当主服务器恢复后不会自动切换回(可以自动切换,但是不推荐,因为IFIX如果是服务器与PLC通信故障是不会达到切换的效果的,此时需要手动切换)
手动切换方法:
新建一个如图所示的画面(参见系统自带画面LocalAsPrimary.GRF、但是在客户机上需更改)
更改的部分为原画面中所有的标签后缀_0更改为_1,且脚本的也要进行相应的修改。
这里就解决了冗余服务器手动选择数据源和显示当前连接的服务器的名称的问题
历史报警的查询(这里只做出来在客户机上生成的)
如图所示效果图
步骤:
A、O DBC服务的连接
在D:\CMIFIX\HTRDATA目录下新建一个Access取名为hisdata.mdb 开始-设置-控制面板-管理工具-数据源ODBC
选用户DNS-添加-选
数据源名:hisdata
选数据库名:hisdata.mdb, 文件类型:Access,连接池-禁止
B、系统SCU的配置
SCU-IFIX-配置-报警-报警ODBC服务,启动-修改-配置:数据库类型:Access 数据库标识符:hisdata
现在创建表:FIXALARMS(默认表名)
其它默认-确定
C、控件的引用
新建画面画面名为ifix_alarm_history
1.日期时间控件
典型装VB6.0后, 双击选Microsoft date and time picker控件(需注册控件
方法为:将该文件拷贝到C:\WINDOWS\system32目录下,
然后运行该代码为
regsvr32.exe MSCOMCT2.OCX)
2个日期控件-属性-格式:1-dtpShortDate,有效前不打勾。
其它默认,
2个时间控件-属性-格式:2-dtpTime, 有效前不打勾。
其它默认
2.vxData控件(数据管道)
IFIX4.0工具箱底部vxData图标
右键-属性vxData对象-
提供者:Microsoft OLE DB Provider for ODBC Drivers
数据库:DNS名:Myalarm,用户名密码选项均空---测试连接-测试连接成功-确定
记录源:命令类型:SQL命令
应用-确定
3.vxGrid控件(显示)
工具箱底部vxGrid图标
选控件vxGrid1-右键-动画-高级-高级动画配置-行为-ADORecords-动画打勾数据源:ifix_alarm_history.vxData1.ADORecords
数据转换:对象
D、VBA脚本:
'初始化设置
Private Sub CFixPicture_Initialize()
'设定默认开始时间
Me.DTPFromDate = DateAdd("d", -1, Now)
Me.DTPFromTime = ("00:00:00")
'设默认结束时间
Me.DTPEndDate = Now
Me.DTPEndTime = Now
End Sub
Private Sub CFixPicture_KeyDown(ByVal KeyCode As Long, ByVal Shift As Long, ContinueProcessing As Boolean)
End Sub
‘查询按钮脚本
Private Sub CmbSearch_Click()
'连接自动刷新
Me.vxData1.AutoRefresh = True
'Format函数用于设定时间格式
vxData1.QP1 = Format(Me.DTPFromDate.Value, "yyyy-MM-DD") & " " & Format(Me.DTPFromTime.Value, "HH:MM:SS")
vxData1.QP2 = Format(Me.DTPEndDate.Value, "yyyy-MM-DD") & " " & Format(Me.DTPEndTime.Value, "HH:MM:SS")
'设定查询内容
'从数据库中查询符合时间段的数据
Me.vxData1.SQLCommand = "SELECT *FROM FIXALARMS WHERE" & "(FIXALARMS.ALM_NATIVETIMEIN>={ts'QP1'})AND(FIXALARMS.ALM_NATIVETIMEL AST <= {ts 'QP2'})"
'刷新数据
Me.vxData1.Refresh
Me.vxGrid1.Refresh
End Sub
其中黄色部分注意和画面中控件的名称对应,完成后可在任务控制中看有没有数据写入到数据库里面
连接状态:连接、记录状态:激活如图所示表示成功记录到数据库中,这里就可以在画面中选择时间,然后点击查询。
历史数据时间保存一年。
历史库定义里面有一个自动删除旧的数据文件打上勾,然后时间选择多少天,最多200天。
然后每天的数据大小需要运行一天后看(GE支持说的没办法通过计算)。
冗余服务器历史数据同步。
当服务器切换时,客户机的历史趋势仍然能切换。
(暂时没办法弄,由于时间关系我这里做的是历史趋势,包括历史报警都存在客户机上。
)
计算机启动时IFIX自动运行。
在IFIX没打开的环境下,启动系统配置—配置---本地启动
将注销后继续运行与系统引导时启动IFIX勾上。
然后进入IFIX后点击工作台—用户首选项---常规
将按运行模式启动工作台、运行模式下全屏显示勾上
然后选择启动画面,选择启动的第一副画面。
THANKS !!!
致力为企业和个人提供合同协议,策划案计划书,学习课件等等
打造全网一站式需求
欢迎您的下载,资料仅供参考。