Andrei Blagaila

Double Word Type variable

12 posts in this topic

I've been searching the manuals and either i search the wrong thing or i've been searching the wrong manuals. How to I name a double word Variable? (I need 32 Bits stored in the same variable)

Share this post


Link to post
Share on other sites

 

  In ladder, generally we write a "D" before instructions with words, like this:

 

MOV K100 D0  // move value 100 to D0 (single word)

DMOV K100 D0  // move value 100 to D0 and D1 ( D0 is last significant)

When we use bits , we need write how many bits is necessary, like this:

MOV K1 K1M0  // move value 1 in M0,M1,M2 and M3 (M0 is last significant)

MOV K1 K2M0  // move value 1 in M0,M1,M2, M3,M4,M5,M6 and M7 (M0 is last significant)

and so on...

to 32 bits

MOV K1 K8M0 // move value 1 to M0 - M31

 

Best regards

 

Share this post


Link to post
Share on other sites

So I need to store a RF-ID that i read. Now it's on 16bits. I want to pass it to 32. I want to store them in the same variable for example D1. It's not 100% clear form the examples. so not bit by bit but the whole thing. How do I do that keeping in mind the value I read needs to be a double word as well.

Share this post


Link to post
Share on other sites

I just use DMOV instruction like DMOV D0 D2 to move the value D0 and D1 intro D2 and D3? (d0 and d1 being the value I read and D2 D3 being the double word I store them in)

 

Share this post


Link to post
Share on other sites

That's all there is to it...

Share this post


Link to post
Share on other sites

 

Hi,

Which instruction do you want use "D0.1"?

I think is not possible use "D0.1" in MOV instruction, just the whole word(D0)..

Is possible use like a open contact or another type of contact instruction

Share this post


Link to post
Share on other sites

 

Yeah,

This is possible !

Edited by AlexMota

Share this post


Link to post
Share on other sites
Quote

To use it as a condition not with MOV but like D0.1 and D0.2 -> Y1

 

Think this is dependent upon what PLC you are using - For example I’m pretty sure you can’t do this on Fx3G’s - but you can on Fx3U’s and Q’s etc

 

 

Share this post


Link to post
Share on other sites

Edit: Misread, yes you can use D0.0 or D0.F to access bit in words.

Edited by kaare_t

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