seffercat

help with cx programmer instructions

5 posts in this topic

new to mr.plc....also first post on forum.. i have used omron software for years but i just came across brackets in an  instruction. i understand how the MOV works..moves data to a destination but what does the bracketed [dxxxx] mean. move to both locations? or something else? i need to understand this for future project. thanks also if there are rule to posting or if i did something wrong please advise.

brackets.png

1 person likes this

Share this post


Link to post
Share on other sites

It is an index or offset.  So, D5100[D4099] means 15 is moved into the address that is D5100 + the value in D4099.  So if the value in D4099 is 43 (as an integer), then 15 is moved into D5143 (D5100+43). 

1 person likes this

Share this post


Link to post
Share on other sites
On 3/18/2020 at 2:19 PM, Michael Walsh said:

It is an index or offset.  So, D5100[D4099] means 15 is moved into the address that is D5100 + the value in D4099.  So if the value in D4099 is 43 (as an integer), then 15 is moved into D5143 (D5100+43). 

I guess my question to the creator of this program would be why not then just write to D5143?  Why would you do it like shown by the OP?

Share this post


Link to post
Share on other sites
20 minutes ago, mr_electrician said:

I guess my question to the creator of this program would be why not then just write to D5143?

Using D4099 makes the offset variable so the PLC program can change the location that is writes to dynamically. This is very similar to using the IRs and offsets in the other post.

1 person likes this

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