NgoHoang

Bit Transfer

10 posts in this topic

Dear all!

Could you tell me, how to move amount bit anywhere of D1 to anywhere of D2 in PLC Mitsubishi?

I read in manual SH(NA)-080809 but I not yet found.

Thanks and best regard!

Capture.JPG

Edited by NgoHoang

Share this post


Link to post
Share on other sites

ROR(P)

RCR(P)

Share this post


Link to post
Share on other sites
Just now, Gambit said:

ROR(P)

RCR(P)

Thanks for yor reply!

But my mean is difference: I want to copy 3 bits of D0 ( ex: bit 10 to bit 12) to 3 bit of D1 (bit 2 to bit 4) and another bits of D1 is not change!

Thanks and best regard!

 

Share this post


Link to post
Share on other sites

Well the easiest would than probably be to  use the bit notation of the word adres   D0.A, D0.B and D0.C 

 

Capture.JPG

Share this post


Link to post
Share on other sites
5 hours ago, Gambit said:

Well the easiest would than probably be to  use the bit notation of the word adres   D0.A, D0.B and D0.C 

 

Capture.JPG

Gambit is correct. There is no instruction that will get three random bits in one word to transfer to another. The best would be using the Kn designation to move 4bits (minimum, 32 bits maximum at 4bit increments) at a time.

 

Share this post


Link to post
Share on other sites
11 hours ago, Akahige said:

Gambit is correct. There is no instruction that will get three random bits in one word to transfer to another. The best would be using the Kn designation to move 4bits (minimum, 32 bits maximum at 4bit increments) at a time.

 

Thanks all!

I'm looking for a command same with this command in PLC Omron.

If you know it in Mitsubishi, pls post it on the topic

Thanks

Capture.JPG

Capture.JPG

Edited by NgoHoang
Add new image

Share this post


Link to post
Share on other sites

First: It's very hard to help if you cannot explain what the purpose is. Why do you want to do exactly this?

Second: To solve your problem, use a combination of the answers you have already received, and the easiest is probably @Gambit's bit notation when you only have two or three bits. If not, then again please explain what you want to accomplish then it's easier to help you with the most elegant solution.

Share this post


Link to post
Share on other sites
Just now, kaare_t said:

First: It's very hard to help if you cannot explain what the purpose is. Why do you want to do exactly this?

Second: To solve your problem, use a combination of the answers you have already received, and the easiest is probably @Gambit's bit notation when you only have two or three bits. If not, then again please explain what you want to accomplish then it's easier to help you with the most elegant solution.

Thanks for your reply!

I make a example:

In some case, PLC receive data 2 word D0 and D1 as below image. I want to merge Data 1 and Data 2 to 1 Word (example D2). 

Could you tell me the best simple way to do this in PLC Mitsubishi (Last time I do this with Omron is very easy)? 

Capture.JPG

Share this post


Link to post
Share on other sites

You should look at:

DIS(P) 4-bit dissociation of 16-bit data

UNI(P) 4-bit linking of 16-bit data

WTOB(P), BTOW(P) Data dissociation in byte units, data linking in byte units

Share this post


Link to post
Share on other sites
1 hour ago, Gambit said:

You should look at:

DIS(P) 4-bit dissociation of 16-bit data

UNI(P) 4-bit linking of 16-bit data

WTOB(P), BTOW(P) Data dissociation in byte units, data linking in byte units

Dear! 

DIS, UNI, WTOB, BTOW also can not correct for this matter.

So, I can do it by WAND, WOR....with data before merge it.

Thanks all

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