PDA

View Full Version : Modicon 984 PLC Time settings


ControlLogix
June 28th, 2004, 06:34 AM
Hi guys,

I have recently moved jobs and I now find myself working with antique PLCs (Modicon 984s). It's a huge jump from Allen Bradleys super ControlLogix PLCs. Anyway, I have connected the Modicon up to a PC via the Modbus network and I am now communicating to the PLC using Wonderware Intouch version 7.0. I can do most things but I am struggling with one aspect and that is the time setting. Every time that I write to the registers that contain the time, the Intouch fails to overwrite the PLC time with the time that I have entered via intouch. Has anybody out there come across this before? Are the time registers read-only?

Thanks,

Colm

Jim Dungar
June 28th, 2004, 09:59 AM
984 PLCs were programmed in 984 Ladder Logic (984LL). Modicon programming software packages could be Modsoft, Proworx, or even Concept.

984LL registers are universal, there is no predefined allocation in the CPU. The 4x (I don't like trying to say 40001, so I use 4x1) registers are all processor read/program write and can be used for analog outputs as well as for holding registers. The 3x registers are processor read only and are used as analog or BCD inputs.

The 984LL timer instruction preset can be a 4x or 3x register or a constant value. The accumlated count of the timer is always a 4x.

What type of register is your Intouch trying to write to? Most Modbus drivers are only capable of writing to 4x registers.

Are you using Modbus or Modbus Plus as your comm network? Modbus Plus uses only 4x registers.

ControlLogix
June 28th, 2004, 10:31 AM
Hi there,

I am using Modbus Plus network and I am writing to 4x registers. You don't know just what a big smile I have on my face right now. You speak Modicon terms and I understand them....I am making progress!

Every time I change either the hour or the minute value that is read into Intouch, the time reverts back to the old PLC time (not the time that I want it to be!) :-(

Contr_Conn
June 28th, 2004, 10:57 AM
What are you trying to do?
If you need to change timer preset, then put 4xxxxx register instead of constant #zzzz for preset and change this register.

If you trying to write a value to accumulator register 4yyyy directly from HMI, that it may not work. Timer logic may have priority as far as I remember.
Try to write number in 4yyyy from your programming software. Does this work?

Contr_Conn
June 28th, 2004, 10:59 AM
I just realized - you are actually trying to use PLC wall clock and not a timer instruction. Right?

I don't think you can do it at all.

wwtptech
June 28th, 2004, 03:07 PM
Here's how I do it on a 984-685E processor
In configuration I set my TIME OF DAY CLOCK as reg. 41590
So Then:

41591-day of week
41592-month
41593-day
41594-year
41595-hour
41596-minutes
41597-seconds

I block move these to registers that I read on InTouch as "existing time"
I then have other registers that I write to to change the Time register values.
See attachment

wwtptech
June 28th, 2004, 03:15 PM
Try again

Jim Dungar
June 28th, 2004, 04:56 PM
If you are trying to set the internal 24 hour clock, you must;

stop the clock - timer register 4x, Bit 1 on, Bits 2 and 3 off
set the time - 4x+1 = day, 4x+2 = hour, etc.
start the clock - timer register 4x, Bit 1 off, Bit 3 on

When operating correctly the timer register bit pattern is 0110000000000000

ControlLogix
June 29th, 2004, 07:24 AM
Hi Jim,

I tried what you suggested and it doesn't appear to work for me. Here is what I did in one Intouch script that was activated via a button.

Note:- My registers begin at 40128.

Set reg 40128 = 32767 i.e. bit 1 = 1 (I also tried the value 32768)
Set reg 40129 etc to the correct day etc.

At the end of the script I set register 40128 to 8192 i.e. bit 3 = 1 or the done bit is set high.

Then I set the clock running again by setting reg 40128 to 24576 i.e bits 2 and 3 are on.

I would have thought this would work but it reverts back to the old time again. Would you have any more suggestions for me?

Many thanks,

Colm

(8{)} ( .)
June 29th, 2004, 07:47 AM
Hi Colm,

I'm gonna stick my nose in this one.

32767(10) = 0111 1111 1111 1111 (2)
24576(10) = 0110 0000 0000 0000 (2)

Which is the bit pattern that Jim mentioned. Display the register
data you want to monitor in the data display panel of Modsoft (or whatever) and change the display format to Binary (F3->F4 in ModSoft). Set the binary digits until you get the bit pattern that Jim recommended.

Good Luck,

(8{)} ( .)

ControlLogix
June 29th, 2004, 07:54 AM
Hello again,

To stop the clock, Jim said bit 1 should be set high i.e. = 1

Therefore it should look like this:-

1000 0000 0000 0000 which is a decimal value of 32768

I see the error of my ways with the value of 32767. Thanks.

Having said that, I have tried both 32768 and 32767 and both don't appear to work. Any suggestions on where I go next?

Thanks,

Colm

(8{)} ( .)
June 29th, 2004, 08:16 AM
Hi Colm,

I think that the obvious thing is to try to get the thing working manually. Once that works you should automate it with InTouch.

I'd also recommend you constantly transmitting the PC's clock to the PLC. This way you'll have the data already there any time you want to set the clock. You'd just use a BLKM to move the data into the registers.

The descriptions of the flags from the manual read as follows:

1 2 3 4 x x x x x x x x x x x x

1) Clock values are being set
2) Clock values are being read
3) all clock values have been set
4) error flag

The manual is not a lot of help. It just says "set the bits appropriately as shown above..." so you'll have to monkey with it. I'd venture that only bit one should be set when you're setting the clock.

Something else that may be tripping you up is the year. The manual I've got (OK, its from the last century) has the year value as a 2 digit number (ie. 1991 = 91).

Sorry I can't be of more help.

Good Luck,

(8{)} ( .)

ControlLogix
June 29th, 2004, 08:43 AM
Hi,

I have tried the whole process manually as well as using an Intouch script. Both ways come up with the same result..i.e. no change in the time of the clock!

wwtptech
June 29th, 2004, 10:44 AM
Colm, try this

Set REG. 40128 to bit pattern 1110 0000 0000 0000 (value 57344)
Set your Clock values.
Reset 40128 to bit pattern 0110 0000 0000 0000 (value 24576)

Good Luck.

Daryl

Jim Dungar
June 29th, 2004, 01:18 PM
Watch out for how Intouch handles Modicon bit assignements.

In a controller Modicon numbers bits from the left not the right. Modicon 1000000000000000 is decimal 1 not 32678.

Sliver
June 29th, 2004, 01:35 PM
my manual says...

..and the following (USA) data format:

4XXXX The control register
Bit 1 (MSB) 1 = set clock values
Bit 2 1 = read clock values

and so on as mentioned in previous posts.


Is it possible that the non-USA data format is in play here?




Brian.

wwtptech
June 29th, 2004, 01:51 PM
I attempted to post a screen shot of the logic I use to change times, but it wouldn't post for some reason.

Daryl

wwtptech
June 29th, 2004, 01:56 PM
I'll try again

wwtptech
June 29th, 2004, 02:52 PM
AHA it finally worked!

To explain:
I read the registers 40671 to 40677 on InTouch as "existing time"
40678 is set as a constant value 57344
40679 is set as a constant value 24576
40661 to 40667 are my input values from InTouch
I enter my updated times in these registers.
When bit 00696 is triggered, the valued in the upper block moves are transferred.
On the next scan, when 00696 negetive transitions, the time of day clock is set back to running.

Hope this helps

ControlLogix
June 30th, 2004, 09:08 AM
Thanks for your post. I tried it out and it didn't work for me at first and I was pulling my hair out. I cursed the Modicon PLC for not being an Allen-Bradley and then I cursed myself for not being able to programme a simple piece of code.

After calming down, I took a more logical route and talked things out with a colleague of mine who questioned everything I did. And one of his questions sent 1000 little light bulbs off in my head!

Solution:- When I created my Intouch tags, my engineering units and raw units were capped at 32767. Changing this to 65535 resulted in my time being successfully changed.

Excuse/Reason/Get out of Jail Card:-

I haven't used Intouch in over 2 years!! :-)

Thanks for all the positive feedback guys, it was very much appreciated.

Regards,

Colm

Mr. Dongle
July 10th, 2004, 11:39 AM
using ProWorx
In your controller configuration select time of day clock and set your first 4x register.
load program, go to hardware clock select the day and auto set.
you need 8 4x registers
4XXX1 contains control bits from left not AB right.
bit 1 = set clock value
2 = read " " " "
3 = done
4 = error
4xxx2 = day of week 1-7
4xxx3 = month
4xxx4 = date
4xxx5 = year
4xxx6 = hours
4xxx7 = minutes
4xxx8 = seconds

Want me to tell you how to make WW work?

Man, I got a really big Dongle!