Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Creating an "IF AND IF" instruction in Edlog


Clayton Apr 18, 2012 06:44 PM

Hello,
I'm trying (and almost succeeding) to trigger a relay using SW 12V on a CR10X when the humidity is above 90% and temperature is below 34F. So far I can get it to switch on as intended, and it will switch off when the first variable (doesn't matter which one) goes outside the indicated range, but it won't switch off when only the second variable goes outside the range. I'm sure it's just a simple syntax issue, so here's what I've got:

;**** Routine for turning on MetOne precipitation gauge heater
159: If (X<=>F) (P89)
1: 64 X Loc [ TestRH ]
2: 3 >=
3: 90 F
4: 30 Then Do

160: If (X<=>F) (P89)
1: 63 X Loc [ TestTempF ]
2: 4 <
3: 34 F
4: 30 Then Do

161: Do (P86)
1: 46 Set Port 6 High

162: End (P95)

163: Else (P94)

164: Do (P86)
1: 56 Set Port 6 Low

165: End (P95)

Port 6 is wired to SW 12V CTRL.
Thanks for any assistance.
Alex


ChipsNSalsa Apr 19, 2012 07:54 PM

Just add another "Else" to the second "If". Example:


1: If (X<=>F) (P89)
1: 1 X Loc [ TestRh ]
2: 3 >=
3: 90 F
4: 30 Then Do

2: If (X<=>F) (P89)
1: 2 X Loc [ TestTempF ]
2: 4 <
3: 34 F
4: 30 Then Do

3: Do (P86)
1: 46 Set Port 6 High

4: Else (P94)

5: Do (P86)
1: 56 Set Port 6 Low

6: End (P95)

7: Else (P94)

8: Do (P86)
1: 56 Set Port 6 Low

9: End (P95)

Log in or register to post/reply in the forum.