Author Topic: HVAC Control  (Read 13512 times)

leo9

  • Newbie
  • Posts: 7
  • I love YaBB 1G - SP1!
    • View Profile
HVAC Control
« on: July 25, 2003, 11:04:35 PM »
I have an SYNTAX ERROR in a dCusf HVAC control.
I have the tried your HVAC sample and have exactly the same problem. If you refer to the sample program the syntax error occurs at  CLRIO OUT1
IF S -T > 15
    SETIO OUT1
ELSE
    CLRIO OUT1  T < 1.5
Kindly advice
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

BLF_Electronics

  • Newbie
  • Posts: 9
  • Controls are Cool!
    • View Profile
    • BLF Technology Group
Re: HVAC Control
« Reply #1 on: July 27, 2003, 07:18:29 PM »
You have a couple of problems here. An ENDIF statement needs to be at the end of the logic. You need to add the OUT1 to the output labels and the T < 1.5 is not a complete statement. It needs changed or removed depending on what you need to do with it. I ran it like this with no syntax error. Hope this helps you.

IF (S-T) > 15
    SETIO OUT1
ELSE
    CLRIO OUT1
REM  T < 1.5
ENDIF
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

leo9

  • Newbie
  • Posts: 7
  • I love YaBB 1G - SP1!
    • View Profile
Re: HVAC Control
« Reply #2 on: July 28, 2003, 12:26:57 AM »
This is the program. I still have syntax errors. Kindly advise on this. Thank you. ???
S= ADC(5)*(500+500)/4096 -500
T= ADC(1)*(500+500)/4096 -500

S= -450
IF(S-T) > 1
   SETIO OUT3
ELSE
   CLRIO OUT3
REM T < 1
ENDIF

IF(S-T) > -1
   SETIO OUT4
ELSE
   CLRIO OUT4
REM T < -1  
ENDIF
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: HVAC Control
« Reply #3 on: July 28, 2003, 11:13:54 AM »
I tried compiling your program, first without defining the label for OUT3 and OUT4 and I got syntax error. After defining the label name for OUT3 and OUT4 in the output table then the program compiled without any problem.

Note that to use SETIO or CLRIO, the label name for the I/O bit that you want to set/clear must be defined in the table. OUT1 does not automatically means output #1. It is just a label name and can be any I/O bit (yes, it can also be a timer or counter bit! although there is little reason for doing so since it can confuse you).

« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS