Sweep time

jcp

Member
Join Date
Feb 2010
Location
Multan
Posts
369
Hi;
I want to read the sweep time. I use the svc_req #9 but %R5200 always shown the value 4. it means 4 msec. But at the bottom of LM90 it shows the 7 to 8 ms. i attached a image for refrence.
is it correct?

time.jpg
 
I suggest you use SVC_REQ #16 instead of #9. You'll have to add some ladder logic to save the elapsed time value for one scan and then subtract the current scan's value from the preceding scan's value.

SVC_REQ #9 only reads the time span from the beginning of the scan until the time the function is executed.
 
Hi;
ok i follow as under;
svc_req # 16 used the block is always on. i start the PARM at %R0007. In the documaentaion i understand that
%R7 have seconds in lower order, %R8 have second in high order and %R9 have 100 micro second tick.
Then i use another SVC_REQ and apply value %R9 but it shows same value which is in R7. Also value shows like 2f like this. but when i go to table and change format INT it shows the seconds can i set the format for particular register?
reagrds
 
Hi;
Sorry now i got somthing. I divide the value %R9 to 1000 and get 8msec. But i see it contineous vary 0 to 8. it is current scan value i think. now what i do further to get preceding scan value?
Regards
 
SVC_REQ #16 does not give you scan time. It gves you the value in a free-running clock that increments in 100 microsecond ticks.

You don't execute two SVC_REQ instructions in the same scan. You execute a single SVC_REQ every scan. You will need to save the result from scan X so you can subtract it from the result you get in scan X+1 to calculate the difference. Then throw away the scan X result, replace it with the scan X+1 result so you can calculate the difference between it and scan X+2.
 
SIR;
sorry i try to understand it. Pleae confirm am i on the right way.
alw_on----svc_req #16---->Parm begning address is %R0007
then
Lst_scn----svc_req #16---> Parm begining address is %R0010
then subtract the %R10 -%R7
plz guide me
i am confuse how i determine the begning of each scan first scan is only true when power up the CPU or from stop to run.
In normal operation which bits i used to get it?
Regards
 
Stop and think for a minute. I explained what the return value from SVC_REQ #16 is.

The PLC scan is a continuous process. It repeats a cycle over and over and over...

The SVC_REQ instruction occurs at the same point in the cycle every time the cycle repeats. You can use the SVC_REQ #16 function to capture the time at each execution of the function. The time between successive executions of the function is equal to the scan time.

Think of it this way. You're driving a race car around a 1 kM track. Your pit crew wants to calculate your average speed for a lap, but their stop watch is broken. They do have a watch that continuously runs. When your car passes a fixed point, a member of your pit crew writes down the time, for example 9:15:12.345. One lap later, when your car passes the same point, they write down the time again, for example 9:15:23.456. The time it took for you to complete the last lap was the difference between 9:15:12.345 and 9:15:23.456 or 11.111 seconds.

Please draw a block how i get it? i am very thankful to u.
Absolutely not! Use your own brain. I've outlined a method for you. The details of how to actually get it done are up to you. If you can't figure it out, then maybe PLC programming isn't what you should be doing. Every time someone simply gives you a completed program, it becomes more likely that whenever you're stuck, you'll ask someone else to do your work rather than figure out a solution yourself.
 
Last edited:
Ok i follow ur suggestion and now i do the following.
i ahve one stop watch that is SVC_REQ #16
i put the block right start of the logic and using ALW_ON assign %R0007 and sucefull move tell me %M0001.
next rung have subtrat INT R14-R7 and save result r16
next rung have
NO of %M001-- move INT r7 to R14.
Now race start svc_req execute %M001 true which move the data r7 to r14. in next cycle r7 have new value while r14 have old value subtract from it. But r16 reamins 0.
I think alw_on create the problem. And i used only one SVC_REQ.
please give me logic of block.
 
Three registers used
%r7= seconds from power on low order
%r8= seconds from power on high order
%r9= 100 micro second ticks
Sir i can not understand the low and high order.
Please tell me which bit i used i am so thankful to u.
 

Similar Topics

Dear Fellows; Good day. Here i share two images one is PLC Sweep Time control and Monitor Screen and the other one PID Control Screen. First i...
Replies
1
Views
234
I am starting a new plc. Download okay no faults. But on CPU Start I get: Error 8533: Unable to start runtime. Controller Error - Invalid sweep...
Replies
3
Views
5,691
I'm working on a vibration test machine that uses a VFD to control a set of counter weights to create specific displacement test. What I need to...
Replies
4
Views
1,638
I've been told that I absolutely have to have a full 360 degree gauge on my HMI, and as you are all aware, out of the box, RSView seems quite...
Replies
9
Views
3,636
Is there a way to see the scan time, like a special utility register, in the logic itself to be displayed by a touch screen/operator interface? I...
Replies
2
Views
3,572
Back
Top Bottom