Siemens S7-300

mj82

Member
Join Date
Dec 2005
Location
leigh on sea
Posts
3
Hi guys
does anyone have any idea why this does not work with S7-300 siemens plc

OB81 : power Supply Fault

Network 1: Error of Battery, incoming event

L #OB81_FLT_ID
L B#16#22
==I
= M 81.1
L #OB81_EV_CLASS
L B#16#39
==I
= M 81.2

U M 81.1
U M 81.2
S M 81.0

Network 2: Battery ok, outgoing event

L #OB81_EV_CLASS
L B#16#38
==I
R M 81.0


regards

Matthew
 
mj82

I see that you are using a compare (==) INT, but you are reading the event class from OB81 TEMP data which is in HEX.

You will have to convert the TEMP data to INT first then compare for the 'low battery' event.

Paul
 
mj82 - what does not work, the detection of the battery fault or the clearing of the battery fault ? Have you monitored OB81 and then disconnected the battery and viewed the CPU registers ?

I have downloaded your code into a 318-2DP (the battery has been "borrowed" from this CPU !), monitored OB81, restarted the plc and OB81 runs and sets M81.0 so it is working in my CPU.
As the battery is missing I can't re-connect to check the outgoing event.

Which CPU are you using ?

(NB: OB81 cannot be downloaded into a 317-2DP. I guess the new S7-300 MMC style CPU's don't have batteries and hence don't support OB81)
 
Last edited:
I have check, it is that. U is not an useble commarnd with the CPU that i am useing and is hilighlted in red when i tri to enter it ?
 
SimonGoldsworthy said:
I have downloaded your code into a 318-2DP (the battery has been "borrowed" from this CPU !), monitored OB81, restarted the plc and OB81 runs and sets M81.0 so it is working in my CPU.

Simon,

So are you telling me that everytime I have done this in the past I have not had to convert the OB81_FLT_ID to an INT for it to work?

The ==I will compare two HEX values then?

Paul
 
Paul,

the compare instructions (such as ==I at least) simply treat the contents of the accus as integers. Only if you're programming in LAD or FBD you have to move the hex values to integers OR you have to disable the type checking in the LAD/FBD editor (Options - Customize - select LAD/FBD tab - uncheck 'Type Check of Addresses'). But: do remember, if you're comparing hex values, that everything from 8000h on upwards to FFFFh will be treated as negative numbers.

Kind regards,
 
Jean Pierre

Thanks for the reply, as I only ever program in LAD, that would explain why I have had to convert each time.

I used to do a lot of STL when I programmed Step 5, I couldn't stand it then, so I tend not to use it now unless I really have to.

That's another little difference between STL and LAD to store in the back of the ol' grey matter.

Paul
 

Similar Topics

Hello all. I have an ESA HMI that is connected to a Simatic S7-300 (CPU312). I have uploaded the program from the PLC which is written with Step7...
Replies
6
Views
1,444
Hello. There is a problem with Siemens S7 300. We got a replacement PLC but it does not run the program from the MMC. The new PLC is dated 2011...
Replies
3
Views
689
Hi to all, Our company does not usually use Siemens PLCs, but have a press with one in it. We are trying to change the IP address in our Simatic...
Replies
2
Views
1,066
G'day guys, I am setting up a s7-300 as a test rig for the workshop and when I downloaded the PLC is not going into run mode, I keep getting a...
Replies
35
Views
5,217
I am trying to write just MSEC to S7 300 Controller date/time using OI.SIDIRECT Aveva communication driver? The old HMI (WINCC) tag is assigned...
Replies
1
Views
1,059
Back
Top Bottom