Citect v610 error "Incorrect number of arguments for function"

OWENLEONG

Member
Join Date
Aug 2012
Location
johor
Posts
4
Hi guys,

I am doing upgrading job from v550 to v610, however during compilation i see error "Incorrect number of arguments for function", wat could be the causes of it?

Leong
 
Why not upgrade to something useful like V7.3. That is so old it is ridiculous.
You will have to find the number of arguments yourself - you do not even list the function - bit hard to sort anything out.
I will be surprised if anyone can help you as the software is so old we will all have forgotten.
 
oic, can i direct upgrade from v5.5 to v7.2?

do u see anything wrong on below coding v6.1 ?

Sub vb_prover_gen_rpt()
Dim XL As Object
Dim FS As Object
Dim ***celFilePath As String
Dim sFileSave As String
Dim sPath As String
Dim sDateTime As String
Dim sDate As String
Dim sTime As String
Dim iRet As Integer
Dim i As Integer
Dim j As Integer
Dim iNo As Integer
Dim sStream_kf As Integer
Dim rStream_kf As Single
Dim rTemp As Single
Dim x(80,10) As Single
Dim xName As string
Dim xState As Integer

iRet = CicodeCallOpen("TagRead","ms_user_path")
sPath = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","ms_xdate")
sDate = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","ms_xtime")
sTime = CicodeCallReturn()

iRet = CicodeCallOpen("TagRead","P_STREAM_NO")
iNo = CicodeCallReturn()
x(4, 5) = iNo
iRet = CicodeCallOpen("TagRead","MI_PROVER_POINT")
x(5, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_P_DIAMETER")
x(9, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_P_WALL_THICK")
x(10, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_P_ELASTICITY")
x(12, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_P_TUBE_COEEF")
x(13, 5) = CicodeCallReturn()


iRet = CicodeCallOpen("TagRead","P_P_M_KF")
x(17, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_P_M_MF")
x(18, 5) = CicodeCallReturn()

iRet = CicodeCallOpen("TagRead","P_P_BASEVOL")
x(56, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_CTSP")
x(57, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_CPSP")
x(58, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_CTLP")
x(59, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_CPLP")
x(60, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_CVOL")
x(61, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_CTLM")
x(65, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_CPLM")
x(66, 5) = CicodeCallReturn()

iRet = CicodeCallOpen("TagRead","P_AVG_KF")
x(70, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_RPT")
x(71, 5) = CicodeCallReturn()
x(72, 5) = ((x(18, 5)-x(70, 5))/x(18, 5))*100
iRet = CicodeCallOpen("TagRead","P_AVG_K_FACTOR")
x(73, 5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_FLOWRATE")
x(74, 5) = CicodeCallReturn()

For i = 26 To 35
iRet = CicodeCallOpen("TagRead","P_TRL_FR"+trim(str(i-25)))
x(i,2) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_MTMP"+trim(str(i-25)))
x(i,3) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_PTMP"+trim(str(i-25)))
x(i,4) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_MPRS"+trim(str(i-25)))
x(i,5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_PPRS"+trim(str(i-25)))
x(i,6) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_PLS"+trim(str(i-25)))
x(i,7) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_FREQ"+trim(str(i-25)))
x(i,8) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_SDENS"+trim(str(i-25)))
x(i,9) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_MF"+trim(str(i-25)))
x(i,10) = CicodeCallReturn()
Next i


For i = 43 To 52
iRet = CicodeCallOpen("TagRead","P_TRL_CTLM"+trim(str(i-42)))
x(i,2) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_CPLM"+trim(str(i-42)))
x(i,3) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_CTLP"+trim(str(i-42)))
x(i,4) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_CPLP"+trim(str(i-42)))
x(i,5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_CTSP"+trim(str(i-42)))
x(i,6) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_CPSP"+trim(str(i-42)))
x(i,7) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_CVOL"+trim(str(i-42)))
x(i,8) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_TRL_FTIME"+trim(str(i-42)))
x(i,9) = CicodeCallReturn()
Next i

iRet = CicodeCallOpen("TagRead","P_AVG_FLOWRATE")
x(36,2) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_MTMP")
x(36,3) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_PTMP")
x(36,4) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_MPRS")
x(36,5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_PPRS")
x(36,6) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_PLS")
x(36,7) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_FREQ")
x(36,8) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_SDNS")
x(36,9) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_KF")
x(36,10) = CicodeCallReturn()

iRet = CicodeCallOpen("TagRead","P_AVG_CTLM")
x(53,2) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_CPLM")
x(53,3) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_CTLP")
x(53,4) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_CPLP")
x(53,5) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_CTSP")
x(53,6) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_CPSP")
x(53,7) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_CVOL")
x(53,8) = CicodeCallReturn()
iRet = CicodeCallOpen("TagRead","P_AVG_FTIME")
x(53,9) = CicodeCallReturn()

On Error Resume Next
x(64, 5) = x(36,7)/x(17,5)
x(67, 5) = x(64,5)*x(65,5)*x(66,5)

***celFilePath = sPath + "REPORT\MASTER\CONDY_PROVER.xls"
sDateTime = Format(sDate, "dd_mmmm_yyyy") + "_" + Format(sTime, "hhnnss")
sFileSave = sPath + "REPORT\PROVER\PROVING_REPORTS\PVR_" + sDateTime + ".xls"

On Error Resume Next
Kill sFileSave

Set FS = CreateObject("Scripting.FileSystemObject")
If FS.FileExists(sFileSave) = 0 Then
FileCopy ***celFilePath, sFileSave
End If

Set XL = createObject("Excel.Application")
XL.Workbooks.Open (sFileSave)

'***(ROW,COL)***
For i = 26 To 53
For j = 2 To 10
If x(i,j) <> "" Then
XL.Cells(i,j) = x(i,j)
End If
Next j
Next i

For i = 4 To 18
If x(i,5) <> "" Then
XL.Cells(i,5) = x(i,5)
End If
Next i

For i = 56 To 74
If x(i,5) <> "" Then
XL.Cells(i,5) = x(i,5)
End If
Next i

XL.Cells(6,5) = sDate + " @ " + sTime
iRet = CicodeCallOpen("TagRead","MS_PROVER_OPERATOR")
XL.Cells(77,3) = CicodeCallReturn() 'Operator name

'SERVER CHECKING...........................................................
' iRet = CicodeCallOpen("ServerInfo","server",0)
' xName = CicodeCallReturn()
' iRet = CicodeCallOpen("IODeviceInfo","DISK_PLC",3)
' xState = CicodeCallReturn()

' If xName = "Citect1" And xState = 1 Then
' On Error Resume Next
' XL.ActiveSheet.Printout
' End If

' If xName = "Citect2" And xState = 2 Then
On Error Resume Next
XL.ActiveSheet.Printout
' End If
'..........................................................................
XL.ActiveWorkbook.Save
XL.application.quit
Set XL = Nothing
Set FS = Nothing
End Sub
'_______________________________________________________________________________________
 
You would have to upgrade your Citect support to upgrade to ANY version - I believe the minimum cost is 3 years support if support has not been kept up to date.

Do not forget Citect has a dongle that is generally version dependent. Upgrade without the correct code in the dongle and Citect will not work anymore!

The code is too complex for me - have not done much Cicode. If you had current maintenance support you could send it to the Citect support site.
 
anybody have any idea wats wrong below coding on v610

FUNCTION
ci_proving_aborted()
STRING sNo,sReason1,sReason2;

sNo = StrTrim(RealToStr(P_STREAM_NO,1,0));
sReason1 = "Proving For Stream " + sNo + " Aborted^n"

SELECT CASE P_RUN_ABORT
CASE 1
sReason2 = "[Manual Abort]";
CASE 2
sReason2 = "[4-Way Valve Timeout]";
ci_prover_gen_rpt();
CASE 3
sReason2 = "[Switch 1 Timeout]";
ci_prover_gen_rpt();
CASE 4
sReason2 = "[Switch 2 Timeout]";
ci_prover_gen_rpt();
CASE 7
sReason2 = "[Average Calculation Error]";
ci_prover_gen_rpt();
CASE 9
sReason2 = "[Full Run Calculation Error]";
ci_prover_gen_rpt();
CASE 10
sReason2 = "[Maximum Run Exeeds]";
ci_prover_gen_rpt();
CASE 11
sReason2 = "[Sphere Switch Sequence Error]";
ci_prover_gen_rpt();
CASE 14
sReason2 = "[Invalid Half Run Date]";
ci_prover_gen_rpt();
CASE 16
sReason2 = "[K-Factor Out Of Range]";
ci_prover_gen_rpt();
CASE 17
sReason2 = "[4-Way Valve Moved]";
ci_prover_gen_rpt();
CASE ELSE
;
END SELECT

Message("Warning",sReason1 + sReason2,48);
END
 

Similar Topics

Hello, i've been at this for months now, i tried creating accounts on the aveva website but it seems to never approve my accounts or at least when...
Replies
0
Views
10
Hello, I have a running project on Citect v5.42 and simatic net v6.4 I have created a new spare PC and loaded all software like Citect, station...
Replies
0
Views
68
Hello everyone, In a factory where we installed Citect 7.20 the computer began to show the first signs of end of life. They never considered...
Replies
0
Views
73
I have a running backup of Citect and plc and I want to make a spare PC station so I have installed the win XP and somatic net v6.0 and import the...
Replies
3
Views
122
I am trying to display a variable within a cicode function onto a graphics page. This function queries a SQL database. I can get the value onto a...
Replies
3
Views
289
Back
Top Bottom