iFIX经典问题问答.docx
- 文档编号:8183187
- 上传时间:2023-01-29
- 格式:DOCX
- 页数:15
- 大小:24.41KB
iFIX经典问题问答.docx
《iFIX经典问题问答.docx》由会员分享,可在线阅读,更多相关《iFIX经典问题问答.docx(15页珍藏版)》请在冰豆网上搜索。
iFIX经典问题问答
iFIX经典问题问答
1:
iFIX中如何使用vba开启和停止wsqlodc和alarmsODBC?
Description
The ability to stop or start the SQL task, wsqlodc, and to pause or continue the alarms to
ODBC task used to only be available by launching Mission Control and manually controlling them.
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:
-
Resolution
Declare 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 string
Declare 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 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 SCHEDULE
To Start:
Private Sub CommandButton1_Click()
Dim Var1 As Object
Dim Var2 As Object
Set Var1 = GetObject(, "FixBackGroundServer.Application")
Set Var2 = Var1.System.FindObject("SchedTest1.FIXEvent1")
Var2.StartEvent
End Sub
To Stop:
Private Sub CommandButton1_Click()
Dim Var1 As Object
Dim Var2 As Object
Set Var1 = GetObject(, "FixBackGroundServer.Application")
Set Var2 = Var1.System.FindObject("SchedTest1.FIXEvent1")
Var2.StopEvent
End Sub
STOP / START a TIME BASED SCHEDULE
To Stop the TimerObject:
Private Sub CommandButton1_Click()
Dim Var1 As Object
Dim Var2 As Object
Set Var1 = GetObject (,"FixBackGroundServer.Application")
Set Var2 = Var1.System.FindObject("Sched1.Timer1")
Var2.TimerEnabled = False
End Sub
To Start the TimerObject:
Private Sub CommandButton2_Click()
Dim Var1 As Object
Dim Var2 As Object
Set Var1 = GetObject (,"FixBackGroundServer.Application")
Set Var2 = Var1.System.FindObject("sched.Timer1")
Var2.TimerEnabled = True
Var2.StartTimer
End Sub
3:
iFIX如何使用vba进行网络打印机打印?
Description:
The following is an example of printing an Excel Document to a Network Printer or a printer other than the
default printer on the machine.
Dim objXL As Object
Dim myDoc As Object
Set 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:
=True
myDoc.Close
Set objXL = Nothing
Set myDoc = Nothing
References
If this script is used in a background schedule with FixBackgroundServer configured to run as a Service, the Fix
service must run under a user account that has printers defined. See KnowledgeBase Article i013417 for more
information on this configuration.
The Printout command can be used for other document types (Word, PowerPoint, etc), however different syntax
is 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?
Resolution
Priority --> Alarm Type --> Description
1 --> COMM --> Communication Error ("BAD" value)
1 --> OCD --> Open circuit detected
1 --> OVER --> Over Range
1 --> UNDER --> Under Range
1 --> ERROR --> Any Statistical Data block alarm
2 --> CFN --> Change from normal alarm (digital blocks only)
2 --> COS --> Change of State alarm (digital blocks only)
2 --> HIHI --> Block in HIHI alarm state
2 --> LOLO --> Block in LOLO alarm state
3 --> RATE --> Value exceeds rate-of-change setting
3 --> HI --> Block in HI alarm state
3 --> LO --> Block in LO alarm state
4 --> DEV --> Deviation Alarm
5 --> OK --> Block in normal state
5:
如何禁止和使能7X驱动标签点(对驱动自动禁止特别有用)?
Dim opcDriver As New OPCDrv.OPCServer
Dim objDriver As Object
Dim strDRVAcronym As String
Dim strProgId As String
''Variables for GetChannel
Dim lngNumChannels As Long
Dim lngChanHandles
Dim strChanNames
''Variables for GetDevices
Dim lngNumDevices As Long
Dim lngDeviceHandles
Dim strDeviceNames
''Variables for GetDataBlocks
Dim lngNumDataBlocks As Long
Dim lngDataBlockHandles
Dim strDataBlockNames
Dim i As Integer
Dim j As Integer
Dim lngErrors
Dim myvar As Long
Dim readEnable
'strDRVAcronym = 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." & 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" Then
lngErrors = opcDriver.SetPropertyData(lngChanHandles
(1), varProperties, varProperyData)
End If
lngNumDevices = opcDriver.GetDevices(lngChanHandles
(1), lngDeviceHandles, strDeviceNames)
lngNumDataBlocks = opcDriver.GetDataBlocks(lngDeviceHandles(0), lngDataBlockHandles, strDataBlockNames)
lngHandle = lngDataBlockHandles(0)
'读工作组
opcDriver.GetPropertyData lngDeviceHandles(0), varProperties, readEnable
If readEnable = "0" Then
lngErrors = opcDriver.SetPropertyData(lngDeviceHandles(0), varProperties, varProperyData)
End If
'处理工作块
opcDriver.GetPropertyData lngDataBlockHandles(0), varProperties, readEnable
If readEnable = "0" Then
For i = 0 To 1
lngErrors = opcDriver.SetPropertyData(lngDataBlockHandles(i), varProperties, varProperyData)
Next i
End If
Set opcDriver = Nothing
6:
iFIX_如何使用脚本实现驱动(7x)的启动和停止?
Description
The following solution explains how to Start and Stop a 7.x driver through VBA code. This example uses
the ABR driver. To implement this with another 7.x driver, change the ABR to the three letter acronym of
the other driver and switch the reference to that driver.
Resolution
This code will only work with 7.x drivers. If you want to implement this is code in a new picture you
need 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.ABRServer
ABRDriver.Stop
Set ABRDriver = Nothing
End Sub
Private Sub cmdStop_Click()
Dim ABRDriver As New ABRDrv.ABRServer
ABRDriver.Start
Set ABRDriver = Nothing
End Sub
7:
iFIX_如何使用脚本实现驱动(6x)的启动和停止?
Description
This articles describes how to control (start or stop) the 6.x drivers through VBA, Command Script,
or DOS rather than in Mission Control.
Resolution
The 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 driver
STOP - stop the driver from polling
STOP_EXIT - stop polling and exit
SLEEP - set new sleep time (period)
STATUS - displays current values
DELAY - 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 MBR
Example from a iFIX VBA:
Shell c:
\fix32\dctrl60 "START MBR"
Example from a FIX32 script:
Runtask c:
\fix32\dctrl60 "START MBR"
8:
iFIX_脚本进行调度的启动和关闭方法?
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 SCHEDULE
To Start:
Private Sub CommandButton1_Click()
Dim Var1 As Object
Dim Var2 As Object
Set Var1 = GetObject(, "FixBackGroundServer.Application")
Set Var2 = Var1.System.FindObject("SchedTest1.FIXEvent1")
Var2.StartEvent
End Sub
To Stop:
Private Sub CommandButton1_Click()
Dim Var1 As Object
Dim Var2 As Object
Set Var1 = GetObject(, "FixBackGroundServer.Application")
Set Var2 = Var1.System.FindObject("SchedTest1.FIXEvent1")
Var2.StopEvent
End Sub
STOP / START a TIME BASED SCHEDULE
To Stop the TimerObject:
Private Sub CommandButton1_Click()
Dim Var1 As Object
Dim Var2 As Object
Set Var1 = GetObject (,"FixBackGroundServer.Application")
Set Var2 = Var1.System.FindObject("Sched1.Timer1")
Var2.TimerEnab
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- iFIX 经典 问题 问答
![提示](https://static.bdocx.com/images/bang_tan.gif)