Temp sense and Generator alert PLC

jzsjr

Member
Hello
 
I"m am happily using CAI WCs in our data closets around campus to monitor temperatures.  They have been great and the cheapest temperature alerting by far (I do really like itwatchdogs products but still much to expensive for what I need).  We have a simple plc code that alerts at one temperature and then escalates one more time when above 80 degrees.  One of our new closets is going to have a generator associated with it and I wanted to see about incorporating two items into the existing temperature program, well I guess it would be four things - generator exercising, generator finished exercising, generator on with load and generator off (from load).  We have done this in the past with other products using CSs so I figured it would be doable usings WC inputs.  The following is my plc program with the added monitoring for the generator.  My issue is with email alerts after the generator has finished exercising and finished from running with load.  I believe my ram values make it so I will keep getting emailed since the IP1 returns to 0.  I was hoping someone could help me adjust the plc code to correct this issue.
thanks,
Jim
 
 
The items in parenthesis are just for my benefit while figuring out the process.  Not intended for production.
 
START    
SET RAM2 0  (send 76temp)
SET RAM3 0  (send 80 temp)
SET RAM4 0  (send generator exercise on)
SET RAM5 0  (send generator exercise off)
SET RAM6 0  (send generator load on)
SET RAM7 0  (send generator load off)
SET RAM8 0  (send humidity)
LOOP:
TSTGE T1 760  
CALLSUB SEND76T1   
TSTGE T1 800  
CALLSUB SEND80T1   
TSTLE T1 750  
CALLSUB SEND74T1   
TSTGE H1 70  
CALLSUB SENDHUM4   
TSTLT H1 65  
SET RAM8 0
TSTEQ IP1 1
CALLSUB GENEX 
TSTEQ IP1 0
CALLSUB GENEXOFF
TSTEQ IP2 1
CALLSUB GENLOAD
TSTEQ IP2 0
CALLSUB GENLOADOFF 
GOTO LOOP   
END    
 
SEND76T1:
TSTEQ RAM2 0  
EMAIL EM1   
SET RAM2 1  
RET    
 
SENDHUM4:
TSTEQ RAM8 0  
EMAIL EM2   
SET RAM8 1  
RET    
 
SEND80T1:
TSTEQ RAM3 0  
EMAIL EM1   
SET RAM3 1  
RET    
 
SEND74T1:
TSTEQ RAM2 1  
EMAIL EM3   
SET RAM2 0  
SET RAM3 0  
RET
 

GENEX:
TSTEQ RAM4 1
EMAIL EM4
SET RAM4 1
RET  
 
GENEXOFF:
TSTEQ RAM5 0
EMAIL EM5
SET RAM5 1  
RET
 
GENLOAD:
TSTEQ RAM6 0
EMAIL EM6
SET RAM6 1
RET
 
GENLOADOFF:
TSTEQ RAM7 0
EMAIL EM7
SET RAM7 1
RET

 
 
Hi Jim,
 
To prevent sending multiple emails, you will need to set up a flag for certain situation, then define another situation to clear the flag.
Yous routine is not very clear, if you want to set RAMx to be 0 indicate that is the state before sending email alert, then you should in all your subroutines doing the same to TSTEQ RAMx 0 then send email, after that set RAMx to 1, 
 
Then in the opposite function to RESET that back to 0.
 
Hello,
 
This is the PLC code we are currently testing (successfully).  I've broken out so it is just for the generator.  Once again we are interested when the generator is exercising and then when it is running with load.
 
thanks,
Jim
 
 
START
SET RAM4 0
SET RAM5 0
 
LOOP:
 
TSTEQ IP1 1  
CALLSUB GENEX
TSTEQ RAM4 1
CALLSUB GENEXOFF
TSTEQ IP2 1
CALLSUB GENLOAD
TSTEQ RAM5 1
CALLSUB GENLOFF   
GOTO LOOP   
END 
 
GENEX:
TSTEQ RAM4 0  
EMAIL EM4   
SET RAM4 1  
RET  
 
GENEXOFF:  
TSTEQ IP1 0
CALLSUB GENEXFIN
RET   
 
GENEXFIN:
EMAIL EM5
SET RAM4 0
RET
 
GENLOAD:
TSTEQ RAM5 0
EMAIL EM6
SET RAM5 1
RET
 
GENLOFF:
TSTEQ IP2 0
CALLSUB GENLFIN
RET
 
GENLFIN:
EMAIL EM7
SET RAM5 0
RET
 
HI Jim,
 
Trying to get educated on your setup.  Do you mean you want to get email alert or WEBSET alert when generator idle or with load?  It seems you have IP1 and IP2 from your generator controller to notify the generator status. And one temp sensor to monitor generator temperature?  If we could understand the flowchart of this control, it will be easier to see what change to be made.
 
Hello,
 
The purpose of this particular wc unit is to monitor ambient temperature inside a data closet, the generator that will be backing up the data closet and send situational email notifications.  IP1 is for when the generator exercises, IP2 is for when the generator goes on load and T1 is closet temperature.  Everything is working fine with the partial PLC code I published the other day and the full program seen below.  If anyone needs to monitor a similar situation please try it out:) 
 
For the temperature alert there are three situations - 76 degrees one alert is emailed, at 80 degrees an escalation email is sent.  If the cooling issues is corrected an email is sent when temperature comes back down to 74 degrees telling me everything is normal.  For the generator exercise (which happens weekly)  IP1 sends one email when it proves on (1) and one email when it is finishes (0).  IP2 is set up the same way but will monitor the generator turning on and the transfer switch switches from house power to generator load.  IP1 and IP2 are connect to Current Switches seen here http://www.johnstonesupply.com/storefront/product-view.ep?pID=L42-854.  Knowing my limited abilities I would consider this rudimentry PLC skills so if anyone has a better cleaner PLC code please let me know. 
 
Sorry, I forgot, there is also an email alert set up for the humidity sensor H1.
 
thanks again,
Jim
 
 
START    
    SET RAM2 0  
    SET RAM3 0  
    SET RAM4 0  
    SET RAM5 0  
    SET RAM6 0  
LOOP:
    TSTGE T1 760  
    CALLSUB SEND76T1   
    TSTGE T1 800  
    CALLSUB SEND80T1   
    TSTLE T1 750  
    CALLSUB SEND74T1   
    TSTGE H1 70  
    CALLSUB SENDHUM   
    TSTLT H1 65  
    SET RAM4 0  
    TSTEQ IP1 1  
    CALLSUB GENEX   
    TSTEQ RAM5 1  
    CALLSUB GENEXOFF   
    TSTEQ IP2 1  
    CALLSUB GENLOAD   
    TSTEQ RAM6 1  
    CALLSUB GENLOFF   
    GOTO LOOP   
    END    

SEND76T1:
    TSTEQ RAM2 0  
    EMAIL EM1   
    SET RAM2 1  
    RET    

SEND80T1:
    TSTEQ RAM3 0  
    EMAIL EM1   
    SET RAM3 1  
    RET    

SEND74T1:
    TSTEQ RAM2 1  
    EMAIL EM2   
    SET RAM2 0  
    SET RAM3 0  
    RET    

SENDHUM:
    TSTEQ RAM4 0  
    EMAIL EM3   
    SET RAM8 1  
    RET    

GENEX:
    TSTEQ RAM5 0  
    EMAIL EM4   
    SET RAM5 1  
    RET    

GENEXOFF:
    TSTEQ IP1 0  
    CALLSUB GENEXFIN   
    RET    

GENEXFIN:
    EMAIL EM5   
    SET RAM5 0  
    RET    

GENLOAD:
    TSTEQ RAM6 0  
    EMAIL EM6   
    SET RAM6 1  
    RET    

GENLOFF:
    TSTEQ IP2 0  
    CALLSUB GENLFIN   
    RET    

GENLFIN:
    EMAIL EM7   
    SET RAM6 0  
    RET    
 
 
Back
Top