Sign in to follow this  
Followers 0
Guest Blast

A question regarding CX-program

7 posts in this topic

Hi all, I using a sensor with the CX-programmer and i would like to ask will the numbers of thing the sensor sensed be recorded in the DM? and how to write things to the DM? Thanx.

Share this post


Link to post
Share on other sites
You know, Blast, I've checked all the posts you put here at MrPLC.com and you never seem to give us quite enough information about what you want really want to do. I assume this is about the color sensor you were using on a school project back in November where you wanted to count the number of colors of like objects as they passed several color sensors. LD P_ON MOV CNT0 D100

Share this post


Link to post
Share on other sites
ok.. i used the cx-programmer and use 0.04----MOV(21) #1 DM0 but i find that the DM memory do not add up when 0.04 is activated a number of times.. it will stop on 1 and nv increase again.. so i try to see wats wrong with it.. or i should not use MOV command..?

Share this post


Link to post
Share on other sites
Mov does exactly that will copy a Source to a Destination....In your case you are copying #1 into DM0 when ever 0.04 comes on...So it's doing what is is meant to.... Now i am assuming u are using a CPM1 PLC then you should use the code of ---[0.04]-----[ @ INC DM0 ] Note the @ in front of the INC instruction.... This means on Rising edge do instruction

Share this post


Link to post
Share on other sites
thanx!! i manage to get it work.. btw, is there a way to reset the DM? i change it to 00000 but when i go back to check that time, it is still with number..

Share this post


Link to post
Share on other sites
To reset it with code do the following.... I will assume that say input 000.05 is the reset bit. then think about what you were doing previously...what did the MOV do...... therefore .... --[000.05]-----[@ MOV #0000 DM0000]

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
Sign in to follow this  
Followers 0