S5 To Ladder Conversion

Help Please

Member
Join Date
Feb 2010
Location
Decatur
Posts
9
Hello,

I am converting a printout of an S5 STL program to ladder. I have found alot of information on this site so far but now I am stuck. I am not familiar with how the program uses the ACCU1...ACCU2 and so on. The printout shows this...

:L IW64
:T FW60
:O F40.7
:O F41.1
:JC =L16
:SLW 1
:SRW 4
:T FW42
:
:
:L FW14
:-F
:JP =L17
:CSW
Then L17 starts

I understand the 1st 5 lines. On the 6th line the SLW shifts ACCU1 to the left 1 place. Then line 7 shifts ACCU1 to the right 4 places. Is this correct? And if you shift a word right or left is it copied left or right or cut left or right. If I understand the T instruction correctly than it should load ACCU1 into FW14 in line 8, but I am not sure what would be there as a result of this logic. Any help would be appreciated.
 
Without any experience dealing with this, I'd guess maybe they were cutting off data on the left and right side of a desired bit, or something. Kinda like an aproximation of a masked move... I could be wrong though.
 
Its an analogue input.

SLW1 removes the left sign bit.

SRW4 comes back the one bit and then a further 3 to remove the 3 right hand bits which leaves the remaining 12 bits, which is the actual value.

Can't remember what the other bits were for.

:L IW64 - Transfer the value held in IW64 into the accumulator
:T FW60 - Transfer the value held in the accumulator into FW60
:O F40.7 - If either F40.7 or F41.1 are on then JUMP to L16
:O F41.1
:JC =L16
:SLW 1 - Move the contents of the accumulator Left 1 bit (left bit is lost, a zero in RH bit)
:SRW 4 - Move the contents of the accumulator Right 4 bits (Right 4 bit are lost, a zero in the 4 LH bits)

:T FW42 - Transfer the result left in the accumulator into FW42
:
:
:L FW14 - Transfer the value held in FW14 into the accumulator
:-F - Subtract FW14 from FW42 (accumulator values) result is held in accumulator 1
:JP =L17 - Jump to L17 if the above result was a positive number
:CSW - Invert accumulator 1
Then L17 starts
 
Last edited:
Ah, so my instincts were more or less correct. I figured it was doing something like that, but having little experience with real world stuff, I wasn't quite sure.

PLC languages are still FAR behind proper programming languages.... Would it kill them to model their languages on something OTHER than assembly?
 

Similar Topics

I have a machine which is undergoing upgradation. As part of the process two SEW drives are being replaced., existing Gen B with new Gen C. The...
Replies
3
Views
229
Hello, I am having some trouble converting my Elapsed Time from TIME data type to INT data type so that I can display it on my HMI. While I can...
Replies
6
Views
1,745
Long time viewer, first time poster. First I want to start, yes I know, PLC-2 and PLC-5 do not belong in manufacturing plants anymore, but...
Replies
5
Views
2,084
Dear Sir, I want to convert my Allen Bradly Ladder logic into Mitshubishi GX Developer, is there any particular software for this or...
Replies
3
Views
2,341
Hello! I know that there is no way that we can convert ladder logic directly in allen bradley rs logix 500 or 5000 but we can still edit them and...
Replies
6
Views
5,368
Back
Top Bottom