denise01 Posted February 11, 2010 Report Posted February 11, 2010 Hi, Wonder if any one has ever used the Bit Words 343 and 345 they are supposed to compare Date and Time values from the PLC clock I need to make contacts at certain times of the day, would it be possible to turn contacts on and off using these Bit Words. Regards Peter
PdL Posted February 11, 2010 Report Posted February 11, 2010 Always mention the CPU type you are working with. Not sure what you mean with Bit Words 343 and 345. I guess you are referring the Auxilary Relay area words that contain the PLC RTC values? You can use the MOVD function and move the digits hours and minutes into a single word so you can use them in comparison instructions.
denise01 Posted February 11, 2010 Author Report Posted February 11, 2010 Sorry I am using a CJ1M the programming manual talks about words 343 for greater than date/time and 345 for less than date/time I want to use these as a means to begin logging data for a programme I run in conjunction with Supervisor so I want totals to be started counting at 0600 then stopped at 1400, another contact turned on at 1400 then turned off at 2200, and another contact turned on at 2200 and turned off at 0600. I tried forcing the contacts on using Supervisor but every time power was lost to the PLC I had to reforce the contacts. Regards Peter
PdL Posted February 11, 2010 Report Posted February 11, 2010 CJ1M you will have the following RTC data: A351 Minutes & Seconds A352 Hours & Date A353 Year & Month A354 Day of the week You can use MOVD to move the data you need to compare into a single word e.g. HHMM
denise01 Posted February 11, 2010 Author Report Posted February 11, 2010 Okay so when I set the data up can I mask the date etc and just compare the time as it needs to switch on every day of the year but just at those times
PdL Posted February 11, 2010 Report Posted February 11, 2010 Correct! You might want to consider if you want the time to follow daylight saving, have a look at this FB download: http://forums.mrplc.com/index.php?autocom=...mp;showfile=588
lostcontrol Posted February 11, 2010 Report Posted February 11, 2010 (edited) Attached is 1 example, possibly the way I would do it. I have allowed for a separate start/stop variable from CX-Supervisor for each shift, whereas, you may want shifts to roll 1 to the other, then you could use the Shift 1 Finish as Shift 2 Start etc. or, you may want a gap between shifts, so this will allow for that. Hope this helps. Clock_Example.cxp Edited February 11, 2010 by lostcontrol
ParaffinPower Posted February 11, 2010 Report Posted February 11, 2010 Suggest using the date comparison instructions: =DT, <>DT, <DT, <=DT, >DT, >=DT Kind regards, Pp
BobB Posted February 12, 2010 Report Posted February 12, 2010 ANDW is a great mask - I use it all the time. Use #FF00 and $00FF.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now