CangkeMan

How to move 8 bit only in data memory D ?

6 posts in this topic

Can someone help me how to transfer D memory in gx works 2 but only 8 bit (Mitsubishi D memory is 16 bit cmiiw) ?

Share this post


Link to post
Share on other sites

Easiest I know is to use the move instruction. 
 

MOV K2M0 D0

This moves 2 nibbles (K2=2 nibbles=8 bits) starting at M0 to D0. 

1 person likes this

Share this post


Link to post
Share on other sites

@CangkeMan You should use SMOV or AND data with H0F like this

Assume that data in D0 and destination are D10

-| M0 |------[SMOV D0 K2 K2 D10 K2]

or use "AND" function

-| M0 |------[WAND D0 H0F D10]

2 people like this

Share this post


Link to post
Share on other sites

do you want to preserve remaining 8-bits in the destination?

1 person likes this

Share this post


Link to post
Share on other sites

@Wasan I didn't find SMOV instruction, I use Q01UD PLC. 

So i use serial to communicate with some devices. the device can't accept null data (which is one ASCII Character 8 bits data) in the middle or front in the row data of the  device format requested. null data must be behind CR in order to be read by the device.  how can i move the data 8 bits forward ? 

https://drive.google.com/file/d/1SdY9aCKCJx5YcUwinYg31LIsBFEEQX2d/view?usp=sharing

 

Share this post


Link to post
Share on other sites

Thanks for the answers guys, case closed. I am using $+ to combine data and it is work for me.

 

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