1st bit of the status word.

NoName

Member
Join Date
Sep 2003
Location
Domžale
Posts
273
Hello.

What I need is to transfer the first bit(it's the indicator that the position has been reached) of the status word 2 to an output bit so that I could use it elsewhere in the program.How could I achive this?

The second status word is located on PIW270 to 272 in the hardware manager.So basicly I would need only a PIW270.0, but the program doesn't allow that kind of addressing.

Thank you
>Ales<
 
So... are you saying that status word is supposed to give positional status to the program? And that you can't READ that Status Word?

Is this "hardware manager" a motion control card?

If so, are you running it in Open-Loop?
 
Terry the PIW you used and the MW you used is off by a byte. You would use m200.0 to match PIW270.0. Another way to do it, if you want just the LSB (Least Significant Bit) is needed, ignoring the rest.


L PIW270
L W#16#1 // IF MSB is needed change to 8000
AW // And Word
T MW270
NOP 0


L M 271.0 // for LSB or M270.7 for MSB
= Q 0.0 // What ever output
 
RRobbins said:
Terry the PIW you used and the MW you used is off by a byte. You would use m200.0 to match PIW270.0. Another way to do it, if you want just the LSB (Least Significant Bit) is needed, ignoring the rest.


L PIW270
L W#16#1 // IF MSB is needed change to 8000
AW // And Word
T MW270
NOP 0


L M 271.0 // for LSB or M270.7 for MSB
= Q 0.0 // What ever output

When I try to load this, the PLC gives me an error msg.
And this line is red so I deleted it in my program and then loaded it to the plc.Is this the couse of the error???
L M 271.0 // for LSB or M270.7 for MSB
 
Replace
L M271.0 With
A M271.0 Then Q0.0 will be 1 if M271.0 is 1.
If you write somthing that Step7 dosent approv of the syntax will be red and if you look at the lower left corner you will see the reason in this case you cant load a bit into accu 1 it has to be atlest a byte
 
I changed it to A M270. 1instead of M.And it still doens't work.Now the PLC gives me this error msg.
Event ID:16# 6539 Ilegal command in block (detected by compiler)

What could be wrong??
 
What type of module/card are you trying to adress??? Is it a Profibus module???? It would be great if you posted a copy of the program.
 
Use an M word below 126. I didn't see where you said which PLC you were using. Some of the smaller S7-300's only use 0-126. Sorry.
 
I work in FBD by the way, So if I understand correctly this will then enable the output let's say q125.4 when the PIW270(first bit is 1) and W#16#1 are the same.Right???
 
I am assuming you are using the LSB or the right most bit. Type this in EXACTLY and you will be able to toggle FDB to STL and FDB and it will display in FDB.

A(
L IW270
L W#16#1
AW
T LW 0

SET
SAVE
CLR
A BR
)
A L 1.0
= Q 125.4
 
I see no reason to filter this. The memorybyte is occupied by the instruction anyway. Just load the Peripihal inputbyte into a memorybyte. This way you can use the rest of the status bits in Pib270 aswell.

L PIB 271
T MB 100

A M100.0 (Pib271.0)
= Q125.4

When M100.0 (Pib271.0) turns 1 memorybit Q125.4 will be 1.

Or if you could adress the input directly

A I271.0
= Q125.4

This might also work

L PIB 271
T IB271

A I271.0
= Q125.4

Try and see its all depending on what card or module you are using if it is a profibus module/card then this might not be enough you then have to use Systemfunctions to transfer the Pib!
 
Last edited:
RRobbins said:
I am assuming you are using the LSB or the right most bit. Type this in EXACTLY and you will be able to toggle FDB to STL and FDB and it will display in FDB.

A(
L IW270
L W#16#1
AW
T LW 0

SET
SAVE
CLR
A BR
)
A L 1.0
= Q 125.4

This works just like I want it to work thank you very much RRobbins!!
 

Similar Topics

Maybe this is obvious to someone more experienced with DP/DP couplers than I am. We have setup a system with my PLC connected to a supervisory...
Replies
2
Views
4,191
The ABB PM573-ETH PLC is not equipped (as far as I am aware) with a 1st scan bit (system register). Has anyone managed to create bespoke code that...
Replies
0
Views
2,267
As far as I know the UKCA mark is mandatory from 2023, and that is 9 months from now. That is not a lot of time to investigate, design, validate...
Replies
22
Views
4,728
Hi All, I cannot seem to find a way to move a Boolean from an Arrays UDT into a DINT. I have an Array of 32 elements with a UDT data type of 4...
Replies
3
Views
1,735
Stupid question i know but i know i have seen this done before and yet i cant get it to work For the preset value of a TON I want to use a tag...
Replies
3
Views
1,810
Back
Top Bottom