Merge two Word to one value.

Nablar

Member
Join Date
May 2016
Location
Oslo
Posts
8
I am using a Modicon M340 PLC, with Unity Pro.

I have two words. These two Word is part of one value. I need to merge these two Words and convert them to a Real value.

How can I do this?

I know I can do it by assigning each word from the array to a memory location ex. %MW100 and %MW101 and then define a DWord at %MW100.
But i need to do this in a DFB, without the ability to specify a memory address.

Anny suggestions?
 
http://static.schneider-electric.us/docs/Automation%20Products/35006144.pdf

Look at page 481 under data types. This will give an example of converting to real.
In the example the integer variable i1 is converted into a real variable before being
added to the real variable r4.
LD i1
INT_TO_REAL
ADD r4
ST r3

In your application you need to convert to real both values and then multiply the larger by the factor you want and then add.

Hope this helps you out,
Regards,
 
I am using a Modicon M340 PLC, with Unity Pro.

I have two words. These two Word is part of one value. I need to merge these two Words and convert them to a Real value.

How can I do this?

I know I can do it by assigning each word from the array to a memory location ex. %MW100 and %MW101 and then define a DWord at %MW100.
But i need to do this in a DFB, without the ability to specify a memory address.

Anny suggestions?

I am unsure what do you mean by merge ?

Do you mean literally join i.e.

Word 1 = 1234, word 2 = 5678 result word = 12345678

Or add as in an arithmetic function i.e.

Word 1 = 1234, word 2 = 5678 result word = 6912
 

Similar Topics

Hello, besides a post on this site from 2016, I haven't seen any questions or answers regarding this. Is if it is possible to strip the RSLinx...
Replies
2
Views
1,561
Is there a simple way to merge the description off line for RS 5000 Like RS 500 I am new to RS5000 and have several applications running that have...
Replies
1
Views
1,072
dear friend, i use rslogix 5000.I have a program consisting of several ladder diagrams.is there a way to merge them in only one logic diagram to...
Replies
4
Views
1,643
I have 2 different .RSX (RSLinx configuration) files. I would like to make them one file. Is there any way to merge these files?
Replies
1
Views
1,831
How do you merge off line a rs 5000 program with one that has descriptions on the tags. I have done rs 500 but never 5000
Replies
2
Views
1,457
Back
Top Bottom