oneshot, store MD value to DB

ason

Member
Join Date
Oct 2005
Location
Home
Posts
317
Hey, i run on a trouble to day, we got a aplication that use FB1
That make a larm if a bit in MD200-300 something (alot of MD) change to 1
and it stops and need to reset the alarm so it can goo on,
but we dont have Alarmtext on every alarm so we dont know why it stops and there is alot of instruction to look over.
after reset the machine start.
is there anyway to make a one shot, like a move instruction when it stop.
of the MD200 maybe to DB so we can see where we got the Alarm from?

i didnt have anytime to see if the MD uses to/from any DB but think that maybe so..

any idés that i can try tomorrow?
think a got something in my backhead but cant get it out o_O
:site:
 
For alarms I generally use a SET instruction to latch the fault. Fault reset will then clear the fault bit. For your problem, there must be some code that is scanning the MD200-300 bits to determine when to stop the machine. If a stop is requested, copy the MD bits to a DB, that way you will get a copy of the faults if and only if the stop is requested. You will still need to clear them before the next run ready for the next fault to be detected.
 
Is FB1 open sourse ?

L L#0
MD200: L MD200
==D
SPBN MD204
T DB??.DBD2 ; save MD-contents
L 200
T DB??.DBW0 ; save MD-number
BEB

MD204: L#0 ; anyhow, akku1 is L#0 allready in this point
L MD204
OSV. 25 times

or something like that
 
Yes FB 1 is open source, i did take a look at it to day,

and it reads alots of MD.. 200 to 300 something
decl, an output
and if one bit is 1, it sets the output,
and in a FC it use this FB, and the decl. output sets Q32.0 something.

I was thinking that if i trigger Q32.0 on a posetive edge i use a move instruction to move the hole serie of FD (or DB if there is dB in this) to ---> DB so i get a snapshot of what did that alarm, but realy dont kow how to program it in step 7 in a good way.

every comments is in germany, so i dont understand everything what is going on there.

im pretty new in PLC programing so need to learn alot.

Seppo: i will try that out tomorrow..
 
Hi ason,

I think SFC20 may be able to do what you want. You could use the positive edge of Q32 (or whatever)to call SFC20. This moves an area of memory, (in your case MD) to another. You could move the entire contents (or just part)of the MD to a new DB.

When SFC20 is called you need to specify the "IN" "OUT" and, I think an INT where you can save an error code for the SFC.
I don't have Simatic in front of me now, but the code would be something like.........

CALL SFC 20
IN =:p#MD200 BYTE 100 //100 byte of data
Ret_error =:#code //temp var for error
OUT =:p#DB1.DBX0.0 BYTE 100//new DB to store
 
ihavent tryied anything of the tips above, at work they told me that we cant try any new fc on this application, need to talk to them that did the machine first, so we going to contact them for help.

to bad now when i wanna try some stuff :)

here is the part of program that i wanna log..

In FC 2 Net 1
we got STOE and HUPE

and in FB1 Net 2 we decl. those output

this is not the complete program, (dont know if i can post it here) if u need more parts of the prog. just tell me..

so if i try the tips above, can i have a snapshot then?

thanks for the help..
 

Similar Topics

Hey all, I'm kind of new to structured text programming and I'm trying to understand why a routine someone else wrote doesn't quite work. There is...
Replies
2
Views
1,427
Hi all, With ControlLogix, I know that we can do something similar to ONS in Strutured text, I cannot remember how to make. It is something like...
Replies
3
Views
1,557
Hi Guys! I'm writing a Function Block and I want an internal counter to reset at the call of this FB. Now I have searched at it seems I can't...
Replies
7
Views
3,622
How to I trigger on a positive transition oneshot in function block? In ladder I just use the |P| coil, but can't find anything similar in...
Replies
2
Views
4,434
I know Rockwell is trying to steer users into using multiple timed tasks instead of the old standby of having one continuous task as a way of...
Replies
13
Views
5,630
Back
Top Bottom