how to combine integers

khalil

Member
Join Date
Jan 2003
Location
Templestowe
Posts
176
hi ,

i want to combine to integers "from" two diferent places
so i can use them as a one number, for example ...

{ vw0 = 8

{ vw3 = 6


i want to combine the 8 and the 6 together
to form one integer , " 86 "

note : im using s7 2xx plc , i know that ther's an
easy way to do it but i dont know how !!!

im trying to this but its not working ,

any help will be graet , thank you in advance .
 
steve ,
what im trying to do is that i have 10 push buttons
marked from 1 to 9 , i have a display unit wich i want it to
display the numbers like a calculator , the numbers 8 and 6 are only for example , but how to let the numbers get shifted to the left ,
each the operator press any button ??

thank you all for you help.
 
What has been explained is the basics of our positional, base-10, numbering system. There is really no more than that.


To carry the example further.
Now we have "86" on the display and the operator presses "5"
Just multiply "86" by 10 to get 860.
Now add the 5
You have "865" on the display.
You can keep going until your diplay runs out of digits.
 
I am not good with the S7 so I will just attempt to explain it in the way I understand it.

In STL if your rung has an enable bit to starts this function that would be first.

LD I0.0
MUL AC1, vw0 (ACI would be 10) result can be put back in vw0 or..
ADD vwo, vw3 adds the 80 + 6

I suggest you download S7-200 manual: http://www4.ad.siemens.de/dnl/jA2MzU3AAAA_1109582/S7200N_e.pdf

I believe seppo probably has shown a better way but not being familiar enough with them I can not say.

The Instruction List is in that manual and brief explanations of ADD and multiply.
 
I'm not absolute sure of S7, but attached description is for S5-135U CPU's. I have used ACCUmalators properties, so it is not necessary put temporary calculations to memory words, becourse they are still in some accu.
I hope I'm not unnecessary confusing enyone with this stuff.

s5_135u_accu.jpg
 
seppo ,

i know how to do it now , all i have to do is ;

vw0 x 10 = vw5

vw5 + new number(vw3) = result

thank you seppo for your help ,
 

Similar Topics

Hi; I have installed Weintek HMIs at different machines. I have configured data logging and HMI logs the data in a file having extension...
Replies
0
Views
1,304
Hi; I have installed Weintek HMIs at different machines. I have configured data logging and HMI logs the data in a file having extension...
Replies
0
Views
1,207
I am getting data from a modbus device and I need to combine 2 16 bit N registers in to 1 32bit L register. I have tried a CPW N242:2 -> L245:0...
Replies
5
Views
2,158
Hello Everyone, I am working on CCW 9.0 software with PLC Micro820. I am communicating with Energy meter over Modbus RTU. I...
Replies
3
Views
4,110
How do es a person combine two words of data into one. N7:0 and N7:1, High word and Low word, 1234 and 5678 and get 12345678.
Replies
7
Views
2,284
Back
Top Bottom