Siemens S5 to S7 help

PLCKeef

Member
Join Date
Nov 2005
Location
Australia
Posts
68
Hi all
I need some help to move from s5 to s7 programming.
Here is an S5 program that I need to know how to do in s7.

Lets say I have a 4 digit thumbwheel switch at IW124 and I want to use the right hand digit to specify where the left three digits are transferred to.

e.g
FB1
LIW124
LKH000F
AW
TFW20;right hand digit on it's own

LIW124
LKHFFF0
AW
SRW4
TFW22;left hand digits on their own

LFW22
DO FW20
TDWO;transfer FW22 to the data word specified by FW20


I am having trouble with doing the last part in s7 I can't work out how to make the pointer variable under S7 ?
LFW22
DO FW20
TDWO

Any help would be great.
 
Here is my code snippet. Note that in Step7 the addressing scheme refers to bits, hence to find a word number you need to shift left 4 bits.

Code:
	  L	 MW	20	 //get Step 5 dw number
	  SLD   4			//convert to Step 7 dbw
	  LAR1			   //address register allows indirect access
	  T	 DBW [AR1,P#0.0] //then finally transfer
 
Hi,

I guess there is a little typo in Simons post.
Instead of 'SLD 4' write 'SLD 3' .Then it will
work correctly.
( the lowest 3 bits refers to the bit-adress 0-7 )


cheers

Rolf
 
LAR1 loads address register AR1 with the contents of ACCU 1 (32-bit pointer). ACCU 1 and ACCU 2 remain unchanged. The instruction is executed without regard to, and without affecting, the status bits.
 

Similar Topics

Hi all, i am the new controls guy at the plant and i have inherited a pc from the previous controls guy with Siemens tia portal version 16 and 17...
Replies
20
Views
920
Hi, I have a customer with a S7300 from around 2013 which they link to approx 25 inverters, 3 DP to DP converters and 5 IM153 remote I/O units...
Replies
8
Views
325
Hi all, First, thank you for reading the thread. So I had a task as the following: An up-counter must be programmed as part of a batch-counting...
Replies
7
Views
298
Hi I’m after some help , I have a plc program with a baumer verisens vision camera attached I have got the signals working ect but I have an...
Replies
9
Views
966
Good, Code Totalizer: IF ( Hour = 23) and ( Minute = 59) and ( Second = 59) THEN totalizerDay_previous : = totalizerDay; totalizerDay= 0; End_IF...
Replies
8
Views
1,579
Back
Top Bottom