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

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
50
Hi folk, I would like to know what kind of Parameters should I setup for controlling with Profibus. My old Lenze 8200 motec 0.25kW have a busted...
Replies
0
Views
53
Hi, I have attached herewith one image which our programmer has been used in S7 1500 PLC. Now we need to use the same instructions in S7 1200 PLC...
Replies
4
Views
114
commentaire communiqué siemens s7-1200 avec vfd delta ? (cablage et sur tia portal )
Replies
0
Views
83
Hello, I am in possession of a WAGO PFC 200 750-8216 which I was successfully able to set up as a Modbus RTU Master to a slave device using...
Replies
0
Views
70
Back
Top Bottom