Hi,
I wrote this code today and i would like to know why I receive a lot of email.
OP3 is ''ON'' when the board is running
If IP1 is triggered during 2 sec --->
- set OP8 during IP1 is triggered + 5 sec
- set OP1 (blink)
If IP1 is not triggered -->
- set OP2 (blink)
I want an email when OP8 is triggered Only 1. This code send a lot of eamil and I don't know why.
This is my first PLC code ever so please don't laught of me! ^_^
code:
START
LOOP:
SET OP3 1
TSTEQ IP1[2000] 1
CALLSUB IN1_ON
TSTEQ IP1[5000] 0
CALLSUB IN1_OFF
SET RAM2 0
TSTEQ OP8 RAM1
TSTEQ RAM1 1 RAM1
GOTO ENVOIE_1
SET RAM2 0
GOTO LOOP
END
IN1_ON:
SET OP8 1
SET OP1 1
DELAY 250
SET OP1 0
DELAY 250
GOTO LOOP
IN1_OFF:
SET OP8 0
SET OP2 1
DELAY 1000
SET OP2 0
DELAY 3000
GOTO LOOP
ENVOIE_1:
BNZ RAM2 LOOP
SET RAM2 1
EMAIL EM1
GOTO LOOP
I wrote this code today and i would like to know why I receive a lot of email.
OP3 is ''ON'' when the board is running
If IP1 is triggered during 2 sec --->
- set OP8 during IP1 is triggered + 5 sec
- set OP1 (blink)
If IP1 is not triggered -->
- set OP2 (blink)
I want an email when OP8 is triggered Only 1. This code send a lot of eamil and I don't know why.
This is my first PLC code ever so please don't laught of me! ^_^
code:
START
LOOP:
SET OP3 1
TSTEQ IP1[2000] 1
CALLSUB IN1_ON
TSTEQ IP1[5000] 0
CALLSUB IN1_OFF
SET RAM2 0
TSTEQ OP8 RAM1
TSTEQ RAM1 1 RAM1
GOTO ENVOIE_1
SET RAM2 0
GOTO LOOP
END
IN1_ON:
SET OP8 1
SET OP1 1
DELAY 250
SET OP1 0
DELAY 250
GOTO LOOP
IN1_OFF:
SET OP8 0
SET OP2 1
DELAY 1000
SET OP2 0
DELAY 3000
GOTO LOOP
ENVOIE_1:
BNZ RAM2 LOOP
SET RAM2 1
EMAIL EM1
GOTO LOOP