Internet PLC Forum
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Login
Register
Internet PLC Forum
»
General
»
Technical support
»
Can't compile function
« previous
next »
Print
Pages: [
1
]
Author
Topic: Can't compile function (Read 10087 times)
lloyd.maclean
Newbie
Posts: 7
Can't compile function
«
on:
February 20, 2004, 06:48:13 AM »
I am having a strange problem with this custom function. If I re-arrange the order of the IF-THEN-ELSE statements, it fails at different locations with "Syntax error"
Is there a limit to the size of the file/ladder diagram/custom function that I am running into?
Thanks,
Lloyd
Logged
lloyd.maclean
Newbie
Posts: 7
Re:Can't compile function
«
Reply #1 on:
February 20, 2004, 06:48:55 AM »
Sorry, here is the code:
IF CtrPV[11]=1 THEN
DM[25]=CtrPV[20]
SETBIT RELAY[42]
ENDIF
IF CtrPV[11]=0 THEN
CLRBIT RELAY[41]
X$=""
W$=""
ENDIF
IF CtrPV[11]=2 THEN
FOR C=0 TO 50
CLRBIT DM[C+100]
CLRBIT DM[C+200]
CLRBIT DM[C+300]
CLRBIT DM[C+400]
CLRBIT DM[C+500]
CLRBIT DM[C+600]
CLRBIT DM[C+700]
NEXT
ENDIF
Logged
support
Global Moderator
Hero Member
Posts: 3174
Re:Can't compile function
«
Reply #2 on:
February 20, 2004, 02:51:18 PM »
CLRBIT function needs a bit position (0 to 15) besides the variable that you want to clear. So you have to supply the bit position.
E.g CLRBIT DM[C+100], 1
If your purpose is to zero out the DM[C=100], then you should just say:
DM[C+100] = 0
Logged
Email: support@triplc.com
Tel: 1-877-TRI-PLCS
Print
Pages: [
1
]
« previous
next »
Internet PLC Forum
»
General
»
Technical support
»
Can't compile function