Is it correct ???

DIMPOL

Member
Join Date
Oct 2002
Posts
24
NETWORK 1 // Main Program
// On the first scan, call subroutine 0
LD SM0.1
CALL SBR_0


NETWORK 1 // Subroutine 0
LD SM0.0
TON T37, +50 // Set the interval for the timed interrupt 0 to 5 SEC
LD T37
ATCH INT_0 10 // Attach timed interrupt 0 (Event 10) to INT_0
ENI // Global interrupt enable



NETWORK 1 // Interrupt 0
// Read the value of AIW4 every 5 SEC

LD SM0.0
MOVW AIW4 VW100
 
Nearly...

It looks like S7-200...
1. A timed interrupt can only be triggered between 0-255ms.
2. SMB34 contains the timed interrupt interval, not T37. Event 10 is timed interrupt 0.
3. If it's a 5 second interval you need, a normal timer will do adequately.

This is from memory so you probably should check. Let us know if you need any more help.
 
Yes, it's about S7-200, thanks for ansewering. I am truing to measure an analog signal every 5 SEC.

can i do it with FOR/NEXT command ?
can i store the 1000 recent values of the signal ?
 
I wouldn't use a FOR/NEXT. Investigate the ADD TO TABLE instruction, or I'd use an indirect address pointer, as this would allow better flexibility.
A self-resetting timer calling an SBR works fine.
 
2004 (ATHENS)

NETWORK 1 // Create table with 100 entries starting with memory location VW4
LD SM0.1 // On the first scan,
MOVW +100, VW0 // define maximum length of table

NETWORK 2 // Reset table with input I0.0
LD I0.0 // On the rising edge of I0.0,
EU
FILL +0, VW2 101 // fill memory locations from VW2 with "+0"

NETWORK 3 // Write value to table with input I0.1
LD I0.1 // On the rising edge of I0.1,
EU
ATT VW100, VW0 // copy value of memory location VW100 to table

IS IT CORRECT ?
IS IT CORRECT TO WRIGHT ATT AIW4, VWO ?

HOW CAN I CREATE A DELAY TO READ THE ANALOG SIGNAL EVERY 5 SEC ?

I am a bit confused, so any help it will be very usefull.
Ôhanks for your time... anybody
BYE
 
You are doing OK.

DIMPOL said:
NETWORK 1 // Create table with 100 entries starting with memory location VW4
LD SM0.1 // On the first scan,
MOVW +100, VW0 // define maximum length of table

NETWORK 2 // Reset table with input I0.0
LD I0.0 // On the rising edge of I0.0,
EU
FILL +0, VW2 101 // fill memory locations from VW2 with "+0"

NETWORK 3 // Write value to table with input I0.1
LD I0.1 // On the rising edge of I0.1,
EU
ATT VW100, VW0 // copy value of memory location VW100 to table

IS IT CORRECT ?

Yes, if all you what to do is put VW100 in the table.


IS IT CORRECT TO WRIGHT ATT AIW4, VWO ?

Yes, see chapter 10.8 of the S7200.pdf. It says which data types are valid for each parameter.


HOW CAN I CREATE A DELAY TO READ THE ANALOG SIGNAL EVERY 5 SEC ?

See chapter 10.5 page 10-17. There is an example of at 300 millisecond retriggering timer which is similar to what you want.

Go to www.google.com. Search for s7-200 manual.
 
I find some manuals but they don' t hane any example. If you can to post it here, i will be very greatfull.

THANKS

P.S: SORRY FOR MY ENGLISH
 

Similar Topics

Daft question coming up...When I want to modify a value, what's the best/correct way to do this? At the moment, I am entering the value (e.g...
Replies
8
Views
433
Good day. I encountered a problem when calibrating a channel on the IF16H module. The module is located in the local backplane along with the...
Replies
5
Views
733
I have some programs that i received from 1 of our programmers whos installing a new machine in our plant. He added them to a external hard drive...
Replies
9
Views
1,353
Hi, At the moment, If the user fails to provide a valid username/password, the image attached appears "Invalid password or user name. Logon has...
Replies
12
Views
1,568
Hi, In a Direct On Line circuit for CW and CCW operation of a 3 phase motor, what is the right way to interlock the contactors. 1) Use a NC...
Replies
11
Views
1,532
Back
Top Bottom