Your problem could be in the line the compiler showed you or in any line above it. Post the entire program.
-JB
I'm trying to revise a CPL which will synchronize 2 Intellipaks VFD speed by adjusting their static pressure setpoints. I'm working offline and when I try to compile the CPL text file, I get a syntax error in the DEFFLT line. I looked in the CPL manual and it says while compiling, the editor looks for objects/properties in the site database. I am not connected to that database. Will that give me this syntax error?
Here's the line giving the syntax error:
DEFFLT m, VFD, VFD_Max, VFD_Min, STPT
TIA for any help on this.
jogas
Your problem could be in the line the compiler showed you or in any line above it. Post the entire program.
-JB
Absolutely!! When you are using the compiler in Summit you have to be logged into a site. If the site you are logged into (not necessarily connected to) is not the one that you are compiling the CPL for, then the object names in your CPL program probably don't exist in the database your are logged into.
Here is a quote right out of the V17 System Programming manual: "The names of objects and properties used in the program must exactly match the names in the database." If you are trying compile this program while logged into a different site database then the object names won't match because they don't even exist.
This statement looks fine to me. In my experience I have found that the line the compiler calls out as the offending statement is only accurate maybe half the time or so. As mallron mentioned, "Your problem could be in the line the compiler showed you or in any line above it." This is true and there is a very good reason that this happens. Here's a quick example off of the top of my head:
//
DEFINT On, Off, Open, Closed,
DEFFLT m, VFD, VFD_Max, VFD_Min, STPT
//
The above example will generate a compile error and tell you the 2nd line is causing the problem even though the 1st line is causing the problem because of a syntax error. The first line should end with empty space after 'Closed' instead of a comma. Since the word 'Closed' has a comma after it the compiler is expecting to assign the next letters or words (DEFFLT) as an Integer variable. But..... DEFFLT is a 'RESERVED' word. The compiler thinks to itself, "DEFFLT is a reserved word. That word can't be used as an Integer variable. I need to notify the programmer that he has a problem with the 2nd line."
I hope that clears things up for you a bit.
Knobber
Looks like a problem in another line, need to see the rest to help.
kw
I finally got back to the site and used the CPL text that ricshell1 sent, revised it, compiled, and loaded it into the database. It worked fine. The only change I made is to set the DIFF value to 85 instead of the 80 shown here. That ended up keeping the Intellipaks VFD's within about 10% of each other.
Here it is:
Program RTU_Sync
/// Written: JAA
DEFINT Off, On=1, Fan1, Fan2
DEFFLT STPT1, STPT2, STPT, VFD1, VFD2,
MAXVFD, MINVFD, DIFF
/// This routine is written to match VFD speed on Intellipaks RTU 1 and 2
/// Routine Execution: This program is executed once every 10 seconds
/// Routine Text File: This CPL object uses the text file named RTU Sync.CPL
STPT = {RTU Sync St Pr Setpt}.{Present Value}
VFD1 = {RTU-1}.{Supply Fan: IGV/VFD Position}
VFD2 = {RTU-2}.{Supply Fan: IGV/VFD Position}
Fan1 = {RTU-1}.{Supply Fan Status}
Fan2 = {RTU-2}.{Supply Fan Status}
MAXVFD = MAX ( VFD1, VFD2 )
MINVFD = MIN ( VFD1, VFD2 )
DIFF = ( MINVFD / MAXVFD ) * 100
IF ( ( DIFF <= 80 ) AND ( VFD2 > VFD1) )
THEN
STPT1 = STPT + 0.25000000
STPT2 = STPT - 0.25000000
END IF
IF ( ( DIFF <= 80 ) AND ( VFD1 > VFD2 ) )
THEN
STPT2 = STPT + 0.25000000
STPT1 = STPT - 0.25000000
END IF
IF ( ( DIFF > 80) OR (Fan1 = Off) OR (Fan2 = Off ) )
THEN
STPT1 = STPT
STPT2 = STPT
END IF
IF ( Fan1 = Off )
THEN
STPT1 = 0.100000
END IF
IF ( Fan2 = Off )
THEN
STPT2 = 0.100000
END IF
IF ({RTU1 Duct Static Setpoint}.{Present Value} <> STPT1 )
THEN
CONTROL ({RTU1 Duct Static Setpoint},{Present Value},STPT1,5,Set)
END IF
IF ( {RTU2 Duct Static Setpoint}.{Present Value} <> STPT2 )
THEN
CONTROL({RTU2 Duct Static Setpoint},{Present Value},STPT2,5,Set)
END IF
END
Thanks again for the replies and help.
jogas
Your welcome.
P.S. juno dot com
I browse through this site every now and then, but very rarely can help....But,
//
DEFINT On, Off, Open, Closed,
DEFFLT m, VFD, VFD_Max, VFD_Min, STPT
//
The problem is usually 1 line above or below where the compiler says it is. The problem is the comma at the end of the DEFINT. The compiler is expecting another entry after the comma.
The code you are referring to in your message was from my post and was showing an example of a syntax error. I thought I had made that pretty clear in my message and explained what was wrong with the code. Did you read the whole message that you copied the code from?
Knobber
My apologies. I was sitting at the back of the classroom and caught a glimpse of something I knew and got excited.