Help!) Command error MSG in S7

Bandy

Member
Join Date
Jun 2019
Location
Seoul
Posts
18
Hello! Guys! I finally solved the problem of convert S5 to S7 !
Really thank you for your advice!

And then, I have a question about command in Funtion Block .
'DO' (in S5) -> 'TAK' (in S7)
K-030.png

1. Why does this PGM act number 1 (SLW 13 & SRW 13)

2. Why does this use the same command in a different way(SLW3, SLW4)??

Thank you for your help
 
TAK in S5 swaps the two accumulators i.e. L DW10 L DW12 TAK swaps the two round DO processes the word for example L KF 10 T FW100 DO FW 100 L DW 0 will actually load DW 10 as pointed to in ACC 1 so the DO instruction loads the word pointed to in FW 100.
 
Further to the information given by @sigmadelta

S7 pointers use the bottom 3 bits as the bit number while the upper bits are the byte number.

In the code, The bit number is in MB212 and the byte number is coming from MB213.

Code:
L MB212  'Load ACCU1 with contents of mb212
SLW 13    ' Shift left accu1 13 times
SRW 13   'Shift Right accu1 13 times

The instructions above strip out any extraneous bits and leave only the bottom 3 bits in ACCU1

Code:
L MB213   ' Load MB213 to ACCU1 (contents of ACCU1 go to ACCU2)
SLW 3      ' Shift ACCU1 left 3 times
OW          ' Logical OR ACCU1 with ACCU2

The instructions above get the byte number, shift left 3 and or with the bit number in the format xxxxxxxxxxxxx.yyy where X is byte number and Y is bit number.

Nick
 

Similar Topics

Has anyone used the "MAJ" motion command? I'm trying to move an injector in the reverse direction. I would appreciate some help. THanks.
Replies
5
Views
2,146
I'm begginer at VBA. What should be the correct way to check if a display is currently showing and then show another display? I tried to put this...
Replies
17
Views
8,330
Hello :) I have two of the question about S7 plz help and answer me the all of the question 1)) In this picture , you can see the LIR & TIR *...
Replies
15
Views
4,690
I am trying to create a macro that displays local message displays when a tag value turns to 1. My issue is figuring out the command for the...
Replies
5
Views
2,975
Redlion G306 I'm trying to set the minimum value data limit of a tag named CT01_HighAlarmSet where the minimum value is...
Replies
2
Views
2,245
Back
Top Bottom