S7-200

DIMPOL

Member
Join Date
Oct 2002
Posts
24
Hi, i have the S7-200 PLC and i want to measure the 100 recently values of an analog signal every 5 seconds, how can i proggramm the PLC to do it? If you help me it will be very usefull for me, thank you very much.
 
You can use a timed interrupt in a subroutine to retrieve the analog value every 5 seconds.

Main Program
LD SM0.1 First scan memory bit
CALL 0 Call subroutine 0

END

SUBROUTINE:
SBR 0 Begin subroutine 0

LD SM0.0 Always on memory bit
MOVB 5000, SMB34 Set timed interrupt 0 interval to 5 seconds

ENI Global Interrupt Enable

ATCH 0, 10 Attach timed interrupt 0 to Interrupt routine 0

RET

Interrupt Routine:
INT 0 Begin Interrupt

MOVW AIW4, VW100 Sample AIW4

RETI Terminate interrupt routine

To store the 100 samples I suggest you use Add to Table, I will let you work that part out after testing this code to verify it will work. My Disk 1 of Micro/Win is bad and I dont have it installed now to verify this code but I am sure it will work. Maybe one of the more experienced programmers will offer their opinion now.

Y'all were correct, this STL does make it easier to write than ladder, once you halfway understand the terms and how they are used.
 

Similar Topics

Hello, I have a question about an encoder that has absolute measurement. Specifically, it's the Lika SMA5, which I would like to connect...
Replies
2
Views
55
Hello, I have a question about an encoder that has absolute measurement. Specifically, it's the Lika SMA5, which I would like to connect...
Replies
0
Views
32
Hi. I have a 222 CPU. I need to recover the program from the eeprom memory. Is it possible?
Replies
1
Views
108
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
6
Views
271
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
97
Back
Top Bottom