graemeian

Getting to memory.

7 posts in this topic

I know enough Ladder logic to get in trouble. Although, I do have a few PLCs controlling machines that I wired and programmed and they are running well (as long as I can remember what those buttons I added do.)

I cannot figure out how to get memory into the PLC.  For example, I have a Counter where I have entered the following:

CNT 0005 W1 ( I am driving it with a 1s clock and the reset is an external button.))

I then went to working memory and entered a number as position 1 (I entered 234)

When I load the program and press the button to reset, CNT is starting at 0.

When I move the W memory from PLC to PC there is 0 at that position.

All of the boxes are checked when I compile/transfer.

Is my CNT format correct? How does one get the memory to the PLC?

 

 

Share this post


Link to post
Share on other sites

I see that one can to use MOV to put a constant into W memory. If I write directly on the W memory and save it, the transfer to PLC stays gray and I cannot get it active (black).

 

Share this post


Link to post
Share on other sites

I'm not sure I understand the issue.

Transfer to PLC is not necessary to change a memory value. You will need to be in Monitor mode though. You should be able to double click then input a value when Online. It may be a bit confusing with the CNT instruction and using W1 as an operand though. When you double click, it will prompt you to change the operand (not the value).

In this case, use the Watch Window to change the value in W1. Alternatively you could use the MOV instruction but precede it with an P_Off. This way you can double click on the W1 and change its value to whatever you wish.

Hope that makes sense.

Share this post


Link to post
Share on other sites

I think I understand now. You are using the PLC Memory Window.

It appears that you cannot 'Transfer to PLC' the W memory while in Monitor Mode. If you change to Program Mode then it will let you. If you use D memory then it will let you 'Transfer to PLC' in Monitor Mode.

Typically, W memory is used for Work Bits. You may use them as WORDs but more commonly D memory is used because D memory is retentive and W memory is not.

Share this post


Link to post
Share on other sites

It makes a lot of sense now. Using the Monitor function, I now have an idea of what the other banks of memory do. The current PLC I am using was removed from a decommissioned high end piece of automation equipment. It was funny to note that the programmer used the same handful of commands as me. (timers, KEEPs, counters and MOVs. ). After I wiped the many pages of ladder logic, there are values left in the D memory.  So if I understand it correctly, all of the D memory is used by the programmer and with a new program, I am free to use all of the locations of the D memory?

 

Share this post


Link to post
Share on other sites

It makes even more sense now. I have always been in run mode.(There were other modes...) I also wiped the D memory after saving it and everything works as planned. Thank you very much.

You guys make this a great and informative site.

Share this post


Link to post
Share on other sites
2 hours ago, graemeian said:

I am free to use all of the locations of the D memory?

 It is NOT all available for free use. There is plenty though. The unit will start using D memory around D20000 for special I/O, CPU Bus units, etc... I would have to reference the manual to know exactly.

You're welcome!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now