Indirect addressing in Unity pro

Join Date
Mar 2010
Location
Cape town
Posts
2
Hi

I want to do map the bits from a range of %KW to a %QW
for instance

Var_pointer := %MW0
%KW(Var_pointer) := %QW0;

Lets say the value %MW0 is 50
i want to map the bits inside %KW50 to my output word

I used structured text to illustrate what i wanted to do but any form is acceptable.
o_O
Please Help

Thanks
 
Simplest way is to create a tag (eg Test) and set its type as an array of %KW and then use Test(%MW) to access the value
You will need to set the project properties to allow directly accessing array variables
 
Hi thanks for getting back to me

This is what i did in the meantime

%MW0:=%KW0[%mw10];

If %MW10 has a value of 123 this will move The value that's inside %KW123 into %MW10

This is basically what i tried to do

If there is a better way i am very open to new Ideas otherwise thanks so much for the help

Now i am struggling to write/Map %MW0 to (for example) %QW0
but looks like i am using the wrong syntax to specify the specific output word

Not so clued up with Unity yet :ROFLMAO:

Thanks
 
Depends on what plc you are using.
For example m340 = %qw0.1.0
first 0= rack number
2nd 0 = slot on rack
3rd 0 = output/input number on card
 

Similar Topics

I have to check 1024 (sequential) bits for change of state in any of the bits and record which bit changed. I was going to do something like...
Replies
9
Views
4,445
Howdy folks, I am an Allen Bradley guy currently living in an Emerson world. Working with Rx3i on PacSystems Machine Edition v. 9.6? i think...
Replies
3
Views
578
Hello, I'm very new to programming with absolutely zero schooling in this field and pretty hands off training in my new role, it's been fun...
Replies
4
Views
649
Hello Friends, I am trying to index M Bits, however GX Works2 is not allowing it with following message. https://ibb.co/zPcqj6M...
Replies
3
Views
1,299
Hi All, which the best way to do the indirect addressing in an optimize DB? Ccurrently this is my partial code inside an FB...
Replies
7
Views
2,252
Back
Top Bottom