Step 7 Indirect addressing for machine with multiple part types

I thought I'd seen #conv_akku1 somewhere before - it's in the back of the Berger book which shows some Step 5 converted to Step 7 and then also shows the optimised program.
 
Seems quite lazy to me, you'd think they'd look at the converted code to tidy it up and comment it.

Just write a ladder network with a few parallel branches, including things like timers etc, then change to STL to see how inefficient it is.

pwaah

:cry:

anyway, just got home, wifes going out with some ex-workmates, what shall I do tonight.

🤾

hmmm

:whistle: I know...... 🍺
 
A BLKMOV in LAD looks a lot simpler than what I have seen so far.

PeterW said:
đź“š you want to introduce him to the wonderful world of the ANY pointer.. :p

I use to use the working area technique back in the days of the 8085 when indirect addressing was messy and not very fast. The debug tools weren't up to the task either.

My first job out of the Navy was writing code for a lumber sorter. There were a handfull of different species with different dimensions but these didn't change often. If I had to always index into a species table for each board then there wouldn't have been enough processing power.

BLKMOVs are simple as long as the ANY pointers are hard coded. In anycase, only the DB part would need to change.
 
[fin]Pete,

You helped me realize that my indicating that the programmer was German might have seemed like I was putting him down. Quite the contrary, in fact, I was simply letting everyone know in case it helped to indicate a particular style of programming that anyone might recognize. Also, your observation that this was an S5 to S7 conversion is correct. It slipped my mind that that may be why the code seems cumbersome to these guys. Thanks for the reply.

Bri@zf
 
I was considering purchasing the Berger book. How do you like it? It seems like about the only one that I can find by searching online. Does anyone have any other suggestions?
 
Peter Nachtwey said:
I use to use the working area technique back in the days of the 8085 when indirect addressing was messy and not very fast. The debug tools weren't up to the task either.

Sad but true; 31,00,00 = LXI SP,0 - some of the 8085 op-codes are embedded in my mind after typing them in countless times using my SDK-85 development board. Eventually I got an audio tape interface to store programs! Good to see someone else who used this bit of kit.
 
bri@zf said:
I was considering purchasing the Berger book. How do you like it? It seems like about the only one that I can find by searching online. Does anyone have any other suggestions?

No other suggestions from me (is there a gap in the market here?), I would get it!
 
Below is a simplified version of the same thing.


Code:
	 L	 DB253.DBW 66	 // Current Running Part No.
	 T	 #Current_Part
	 L	 DB244.DBW  2	 // Last Running Part No.
	 ==I 
	 JC	End				// If Same then End
 
	 L	 3
	 *I				// Calculate address to store last 
	 L	 20		 // settings for previous part
	 +I	
	 SLW 4			// Turn into pointer and store in AR1
	 LAR1 
 
	 L	 DBW 34		   // Save last settings in correct DW's
	 T	 DBW [AR1,P#0.0]
	 L	 DBW 36
	 T	 DBW [AR1,P#2.0]
	 L	 DBW 38
	 T	 DBW [AR1,P#4.0]
 
	 L	 #Current_Part	 // Recover new part no and update last running
	 T	 DBW	2
	 L	 3				 // Calculate address to recover last 
	 *I					 // settings for new part
	 L	 20
	 +I	
	 SLW 4				 // Turn into pointer and store in AR1
	 LAR1 
 
	 L	 DBW [AR1,P#0.0]	// Recover new settings from correct DW's
	 T	 DBW 34
	 L	 DBW [AR1,P#2.0]
	 T	 DBW 36
	 L	 DBW [AR1,P#4.0]
	 T	 DBW 38
 
End: NOP 0

The worse convesrions I've seen is when trying to see structured text in STL (no editor for ST). That is bad when converted.
 
Last edited:
Just an after thought, essential for indirect addressing.


I presume its there somewhere, either in the HMI or before this code is called. Limits on the number that can be entered. That wonderful red light followed by calming silence follows where limits are not used.
 
Hi guys,

I am entering in the world of the pointers, and I have a question.
In the code above, and some other code I saw, before to store the value in the AR1 there ist a SLW command.

Well, I didn't understand why. Do you have a simple exemple?

Thanks
 
Ron the bon - if you are new to indirect addressing/pointers etc. then you should use SLD rather than SLW. Have you got the book by Berger ? If not then I recommend you get it.
 
SimonGoldsworthy said:
Ron the bon - if you are new to indirect addressing/pointers etc. then you should use SLD rather than SLW. Have you got the book by Berger ? If not then I recommend you get it.

nobody noticed that before :) embarrasing :oops:
 

Similar Topics

Need the explaination of the code given below... Wgy not adding more than 8 real values.... L P##Measuring_values //Address of...
Replies
3
Views
2,092
I get a weekly email from Siemens Tech Support. It has Tech notes updates etc. This week they have the following example of indirect addressing...
Replies
0
Views
2,455
C
Does anyone know how I can indirectly address data in a datablock in step 7? EG. I have a DB containing multiple 'records'. I would like to...
Replies
1
Views
4,124
I have a question regarding the use of indirect addressing and pointers. Is there a difference between using the SLW3 and multiplying the original...
Replies
9
Views
19,639
Hi, What I need is: I'm writing a function. At the outside of the block I just want the parameter P_OFFSET_BYTE. PIB256 PIB257 PIB258 ...
Replies
2
Views
1,660
Back
Top Bottom