JordanF

Byte Level Data Move

4 posts in this topic

Hey guys,  I am currently working on an application with a Q series PLC where I would like to move decimal values into the upper and lower byte of a memory address (word) independently. For example lets say that:

Servo Force = D100 Lower byte (D100.0 - D100.7)

Servo Speed = D100 Upper Byte (D100.8 - D100.F)

 

I want to move 50 into the lower byte for 50% force, and 5000 into the upper byte for 50.00mm/s.

What is the best/easiest way to accomplish this? Also, these values will change from model to model, so what I would like to do is setup something like a move instruction so that I can quickly update these values on the fly, but also independent of one another. Any help would be greatly appreciated! Thanks!

Share this post


Link to post
Share on other sites

Posted (edited)

there are more ways but I would do it like this 

DIS_UNI.jpg

Edited by Gambit

Share this post


Link to post
Share on other sites

Thanks for the reply Gambit! I failed to mention that I'm using GX Works 2, in simple project format. (It's the Customers spec)

I've worked with GX Works 2 quite a bit, but the only way I've ever done anything similar to this is using the WTOB/BTOW instructions. I have some code that I can make work. It's just in this particular case I have quite a few words of data that are going to be like this (divided upper and lower values) so I was hoping Mitsubishi had an instruction that I'm just not aware of to do this.

Share this post


Link to post
Share on other sites

Well The instructions i used split it in 4x 4 bits and then I reassemble them.
should work in simple mode as well. and if you use label simple mode you could create a FB for it.

 

 

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