
Visit our shop for nerds in control lifestyle products.
- PC reliability?
- Windows, real time
- PID loops
- PCs vs. PLCs
- Replacing people
- MS 'monopoly'?
- Software quality
- Where do we go from here?
- Why pay?
do what's best.
-- Lovers and Other Strangers
www.control.com/rss
I'm working with the source code, and it seems like I'm totally lost. The due date is just around the corner and I'll completely appreciate it if someone can help me.
Thank you,
baby_shinoda @ yahoo. com
I tried becoming a new member but the proxy failed. Will try at home if I get time.
Some code and an inf file from a past project.
Don't have time to explain much at this time.
Later,
Clint
Sub initQuadComm(Comm As MSComm, iPort%, sCommSetting$)
Dim dummyBuf$
'If gbRanEditor Then
If Comm.PortOpen = True Then Comm.PortOpen = False
gbQuad = False
'End If
On Error Resume Next
If Not Comm.PortOpen Then
Comm.CommPort = iPort%
Comm.Settings = sCommSetting$
Comm.InputLen = 0
Comm.OutBufferSize = 8
Comm.PortOpen = True
gbQuad = True
Else
'clear buffer
If Comm.InBufferCount > 0 Then
dummyBuf$ = Comm.Input
End If
End If
End Sub
Sub Main()
Dim abbrVer$, msg$
Dim abbrDate$
Call setGlobals
gIniFile$ = getIniFile$(InfFile$)
If Not isfile%(gIniFile$) Then
msg$ = "Quad Information File Not Found, " & vbCrLf
msg$ = msg$ & "Advise Your System Administrator. That the [quad.inf] file is missing."
msg$ = msg$ & "This file should be located in the [Data] folder next to this application's folder." & vbCrLf & vbCrLf
msg$ = msg$ & "The application should proceed with default settings only. 1200 bps, port 2 ect."
MsgBox msg$, 16
'End
Else
Call getIniSettings
Call SetHelpFile(gProgDrive$, gProgPath$)
End If
abbrVer$ = Mid(CurVer$, 1, InStr(InStr(CurVer$, ".") + 1, CurVer$, ".") - 1)
abbrDate$ = Mid(VerDate$, InStr(VerDate$, " ") + 1)
QuadSwitcher.Show 1
End Sub
Sub setGlobals()
App.Title = "Quad Switcher"
ReDim gWarnings$(7)
'\\\\\\\\\\\\\\\\\\Default settings for FIO-8007 Color Quad///////////////////////////////
' Settings read in from inf. file will overwrite these values.
With Q1
.Quad = "GE"
.Zoom1 = "GA"
.Zoom2 = "GB"
.Zoom3 = "GC"
.Zoom4 = "GD"
End With
With Q2
.Quad = "GE"
.Zoom1 = "GA"
.Zoom2 = "GB"
.Zoom3 = "GC"
.Zoom4 = "GD"
End With
'///////////////////////////////////////////////////////////////////// ////////////////////
End Sub
Option Explicit
Public gProgDrive$
Public gProgPath$
Public gAddressFile$
Public gbDualQuads As Boolean
Sub getIniSettings()
Dim arrayTemp$(), dataTemp$() 'getIniSettings
Dim i As Integer 'getIniSettings
Dim j As Integer
Dim u As Integer
Dim strTemp As String
Dim striniSection As String
On Error GoTo ErrSkip ' If we don't have quad.inf to read we don't want to mess up the defaults.
'gProgDrive$ = getinisetting("COMMON", "ProgDrive", gIniFile$)
gbDualQuads = getinisetting("COMMON", "DualQuads", gIniFile$)
Q1.Name = getinisetting("COMMON", "Quad1Name", gIniFile$)
Q2.Name = getinisetting("COMMON", "Quad2Name", gIniFile$)
Q1.CommSettings = getinisetting("MECH INTERFACE", "CommSettingsQuad1", gIniFile$)
Q2.CommSettings = getinisetting("MECH INTERFACE", "CommSettingsQuad2", gIniFile$)
DoEvents
Q1.PortNumber = CInt(getinisetting("MECH INTERFACE", "CommQuad1Port", gIniFile$))
Q2.PortNumber = CInt(getinisetting("MECH INTERFACE", "CommQuad2Port", gIniFile$))
If Q1.PortNumber = Q2.PortNumber Then
If MsgBox("Both Quads using the same port number. Please edit file.", vbYesNo, "Error in port assignments!") = vbYes Then
infEditor
End If
End If
With Q1
.Quad = getinisetting("QUAD1 SWITCHING", "gotoQUAD", gIniFile$)
.Zoom1 = getinisetting("QUAD1 SWITCHING", "gotoZOOM1", gIniFile$)
.Zoom2 = getinisetting("QUAD1 SWITCHING", "gotoZOOM2", gIniFile$)
.Zoom3 = getinisetting("QUAD1 SWITCHING", "gotoZOOM3", gIniFile$)
.Zoom4 = getinisetting("QUAD1 SWITCHING", "gotoZOOM4", gIniFile$)
End With
With Q2
.Quad = getinisetting("QUAD2 SWITCHING", "gotoQUAD", gIniFile$)
.Zoom1 = getinisetting("QUAD2 SWITCHING", "gotoZOOM1", gIniFile$)
.Zoom2 = getinisetting("QUAD2 SWITCHING", "gotoZOOM2", gIniFile$)
.Zoom3 = getinisetting("QUAD2 SWITCHING", "gotoZOOM3", gIniFile$)
.Zoom4 = getinisetting("QUAD2 SWITCHING", "gotoZOOM4", gIniFile$)
End With
Exit Sub
ErrSkip:
MsgBox "An error took place while loading settings from " & gIniFile$, vbExclamation, "Information reading error."
End Sub
Option Explicit
Sub getIniArray(iniSection$, searchString$, arrayIn$())
Dim i As Integer
Dim strInitemp() As String
Dim strmsgtxt As String
ReDim strInitemp(0)
ReDim arrayIn$(0)
i = 1
Do
ReDim Preserve strInitemp(i)
strInitemp(i - 1) = getinisetting(iniSection$, searchString$ & Format(i, "0"), gIniFile$)
i = i + 1
Loop While strInitemp(i - 2) <> "Item Not Found"
If i = 2 Then 'no settings
strmsgtxt = "There are no " & searchString$ & "s defined." & vbCrLf
strmsgtxt = strmsgtxt & "They must be defined in the inf file." & vbCrLf
strmsgtxt = strmsgtxt & "This Program will now terminate."
MsgBox strmsgtxt, 16
End If
For i = 0 To UBound(strInitemp) - 2
ReDim Preserve arrayIn$(i)
arrayIn$(i) = strInitemp(i)
Next i
End Sub
Option Explicit
Public gProgDrive$
Public gProgPath$
Public gAddressFile$
Public gbDualQuads As Boolean
Sub getIniSettings()
Dim arrayTemp$(), dataTemp$() 'getIniSettings
Dim i As Integer 'getIniSettings
Dim j As Integer
Dim u As Integer
Dim strTemp As String
Dim striniSection As String
On Error GoTo ErrSkip ' If we don't have quad.inf to read we don't want to mess up the defaults.
'gProgDrive$ = getinisetting("COMMON", "ProgDrive", gIniFile$)
gbDualQuads = getinisetting("COMMON", "DualQuads", gIniFile$)
Q1.Name = getinisetting("COMMON", "Quad1Name", gIniFile$)
Q2.Name = getinisetting("COMMON", "Quad2Name", gIniFile$)
Q1.CommSettings = getinisetting("MECH INTERFACE", "CommSettingsQuad1", gIniFile$)
Q2.CommSettings = getinisetting("MECH INTERFACE", "CommSettingsQuad2", gIniFile$)
DoEvents
Q1.PortNumber = CInt(getinisetting("MECH INTERFACE", "CommQuad1Port", gIniFile$))
Q2.PortNumber = CInt(getinisetting("MECH INTERFACE", "CommQuad2Port", gIniFile$))
If Q1.PortNumber = Q2.PortNumber Then
If MsgBox("Both Quads using the same port number. Please edit file.", vbYesNo, "Error in port assignments!") = vbYes Then
infEditor
End If
End If
With Q1
.Quad = getinisetting("QUAD1 SWITCHING", "gotoQUAD", gIniFile$)
.Zoom1 = getinisetting("QUAD1 SWITCHING", "gotoZOOM1", gIniFile$)
.Zoom2 = getinisetting("QUAD1 SWITCHING", "gotoZOOM2", gIniFile$)
.Zoom3 = getinisetting("QUAD1 SWITCHING", "gotoZOOM3", gIniFile$)
.Zoom4 = getinisetting("QUAD1 SWITCHING", "gotoZOOM4", gIniFile$)
End With
With Q2
.Quad = getinisetting("QUAD2 SWITCHING", "gotoQUAD", gIniFile$)
.Zoom1 = getinisetting("QUAD2 SWITCHING", "gotoZOOM1", gIniFile$)
.Zoom2 = getinisetting("QUAD2 SWITCHING", "gotoZOOM2", gIniFile$)
.Zoom3 = getinisetting("QUAD2 SWITCHING", "gotoZOOM3", gIniFile$)
.Zoom4 = getinisetting("QUAD2 SWITCHING", "gotoZOOM4", gIniFile$)
End With
Exit Sub
ErrSkip:
MsgBox "An error took place while loading settings from " & gIniFile$, vbExclamation, "Information reading error."
End Sub
;quad.inf file located in the data folder next to bin folder where program resides.
[COMMON]
; If running two quads on one PC then set DualQuads="True" else "False"
DualQuads="True"
; If not DualQuads then the CommQuad1Port is used below.
; Quad1Name is used for one Quad, ie. DualQuads="False"
Quad1Name="Quad 6"
Quad2Name="Quad 7"
[MECH INTERFACE]
CommSettingsQuad1="1200,N,8,1"
CommSettingsQuad2="1200,N,8,1"
; Do not assign same port number to each.
CommQuad1Port=2
CommQuad2Port=1
[QUAD1 SWITCHING]
gotoZOOM1="GA"
gotoZOOM2="GB"
gotoZOOM3="GC"
gotoZOOM4="GD"
gotoQUAD="GE"
[QUAD2 SWITCHING]
gotoZOOM1="GA"
gotoZOOM2="GB"
gotoZOOM3="GC"
gotoZOOM4="GD"
gotoQUAD="GE"
- ODVA, DeviceNet: New CIP specs; ControlNet added; 2009 meeting
- Embedded, wireless devices, dynamic IP routing
- Listen in: Wireless developments for Air Force may influence industrial applications
- Easier implementation: Kits for cable testing, wireless products
- Inside look: How MTL Instruments fits with Cooper Industries
- Ethernet hardware: Switches and more
- Frost & Sullivan awards honors many automation, controls companies
- ABB update: User conference, exhibition, flow, SCADA, wireless
Users of this site are benefiting from open source technologies, including PHP, PostgreSQL and Apache. Be happy.
Patronize our advertisers!



