S7 SCL timer

CharlesM

Member
Join Date
Aug 2005
Location
Arkansas
Posts
1,129
Ok I just got my S7 Pro upgrade. I want to read information into an array every 10ms. I have the for loop working but I cant figure out how to add the timer in SCL. Should I try to use a timer or just look at the system clock?
 
Why not call your block every 10ms from one of the timed interrupt OB's.
I normally use a 317 CPU and set OB35 to run every 10ms and then call all my 10ms routines from there.
 
Ok if OB35 is called every 10ms and I have a loop running in OB35 does that mean it will run the entire loop every 10ms or just one pass through the loop every 10ms?
 
What ever you have coded will run when called from OB35. The execution of the code is no different to calling it from OB1. (except of course that if you reference process image data it will only be updated by the normal processing at the start/end of OB1)
 
Ok, I may be able to do that. I would have to setup a count that would index each time it scanned. What I was thinking was to put a 10ms delay inside of my for next loop.

The real problem I have is I am reading data from the Robot. When I give it the command to send me the data it takes 10ms to respond. So I want to send a command, wait 10ms, read data into array, increase count, send next command.....
 

Similar Topics

Hello, please, what are the steps to insert ( S_ODT ) TIMER in SCL by using ( INSERT menu )? Thanks in advance Maher
Replies
4
Views
5,238
Hi guys, Is it possible to make a function to use a timer more than ones? I'll been trying it but cannot solve it Here is my function It's a...
Replies
4
Views
8,230
I have an input that has to be on for 1 second before something can happen. How can I write this in SCL ?
Replies
9
Views
3,644
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
82
Hi, I have an intermediate-advance knowledge of programming with TIA Porta in Ladder, would you recommend me to start learning SCL for it to...
Replies
11
Views
559
Back
Top Bottom