I want to make the CPU go from 0% utilization back to 100% every 10 seconds.
Kind of like waves if that makes sense.
I was wondering if anybody could help me since I have no clue how to do it.
You may try Address TSO "OPSWAIT 10" and some kind of busy loop.
Related
I'm taking snapshots from AR view 30 times per sec and sending it on another vc to process, the cpu usage goes eventually until 280% and the device gets too hot and the performance decrease and then I have frame drops.
I'm thinking of using Thread.sleep to make the thread sleep for 1 sec in every minutes, my question is, do you think it's a good approach? does it have any effects at all to reduce CPU usage or cool down the phone a bit? Or there is another better way?
If the thread sleep for 1 sec in 1 min, doesn't matter much for me.
Thank you so much
I'm trying to implement a high-precision, millisecond-timescale timer in matlab. Every T seconds, I want to query a camera linked to matlab, and if there is an image in the memory, I want to pull it out. The actual connection to the camera is straightforward - but a problem arises because images are coming in every ~60ms, and need to all be pulled off before another image enters the camera buffer. This essentially means that I need to be checking the camera buffer at least every ~30ms, and ideally every ~5ms.
While MATLAB's built in timer function ostensibly allows millisecond timing, it suffers from poor precision. While in >95% of executions the built in MATLAB timer will indeed pause for ~5ms between runs, in ~5% of cases it hovers around ~30ms, and in ~1% of cases it takes >100ms between executions, which unacceptably kills the performance. I should clarify in MATLAB's defense that simultaneously there are two other timers running (both with 1 s periods), as well as a number of figure windows open, so even though my machine is beefy (16-core, 64GB RAM), there is certainly a lot to be doing all at once. I have tried using timers based on .NET timers (System.Timers.Timer(period)) as well as with the Java sleep function (java.lang.Thread.sleep(period)), both of which should theoretically be more precise, and while both are better than the MATLAB timer (at the cost of being more unwieldy), none are able to consistently achieve <60ms execution delay across thousands of iterations.
Maybe I'm asking for something which is not implementable - but I hope that there is some way to implement a high-precision timer in MATLAB which will continue executing at a ms time-scale even when there are other figures/timers/commands being executed semi-simultaneously. I should maybe clarify that when running just a timer with no other timers/figures open I am able to consistently achieve <60ms execution (and really, consistent <10ms execution for a 5ms timer period). This is possible even when all those timers/figures are open in a different instance of MATLAB, so it seems the problem is to somehow separate the timer from the rest of MATLAB. Any advice or guidance would be appreciated in this regard.
Depending on what exactly you are doing, the timing system of Psychtoolbox may help you.
Specifically, check out the WaitSecs function and its documentation. It is supposed to be more precise than timer, and the documentation contains some tips about achieving high precision timing in general.
Also related is the GetSecs function.
It might however happen that switching to WaitSecs will not help you. In that case you can be quite sure that your machine is just too loaded to do what you are trying to do.
I have a Dell PowerEdge t630 server 750W power with PF 94%, I need a UPS that make my server Up for 6 hours at least
please advice the UPS capacity in KVA
thanks
The UPS power capacity will need to be at least 750VA. With a power factor that high, watts and VA are effectively the same. To supply 750W, you need a 750VA UPS.
Make sure the UPS can also supply 750 watts. Not every 750 VA UPS can supply 750 watts. Many UPSes can supply more reactive power than they can real power. You may wind up needing a UPS rated for 1,000 VA to get one that can supply 50 watts.
The amount of time the UPS needs to last has no effect on how much power it needs to be able to supply. A 100 watt light bulb needs 100 watts, whether it's on for a minute or a year.
I would caution you that there is no reliable way to compute a UPS's run time at a given load based on its stated efficiency or reserve time at other load values. Battery efficiency changes drastically with load. For example, halving the battery size will often cut the run time by much more than half. The only reliable way to predict UPS run time is to ask the manufacturer or look at at the manufacturer's graph of run time versus load.
Note that doubling the battery size will typically more than double the run time. This means that, for example, a UPS that claims to run for one hour at half load will almost certainly not run for half an hour at full load, it will usually run for much less time than that.
For such a long run time, look for a UPS that can be expanded with additional battery modules. The manufacturer should provide a chart that will tell you how long each module will last, and that will let you figure out how many modules you will need. Be aware that adding more battery modules often increases the charge time.
I have a function that is printing reports to the console with fprintf. But it's writing a lot, making it impossible to follow with the eye. So I want to make it "slower", or decrease the amount of writing. Can I make a decision based on mod(current_time, something)?
So what I want to achieve is, the system should go verbose for 0.5 seconds, then go silent for 1 second, and repeat.
Is this possible?
Thanks for any help!
I am trying to measure elapsed time.
Above ladder logic tries to measure the time for which 6000.03 is on.
It read around 6000 ms where as my stopwatch showed around 11 seconds.
What is wrong in the logic?
EDIT:
Had tried with below logic as well but got again different results:
The timer is reset in plc cycle. It cause the delays.
Make the timer run longer. About 1s and count 600 pulses. I am sure you will get lower error.
Other solution is to find system clock bit and use it. It is not plc cycle dependent. For now i cannot remember the system bit addresses for omron. If you still have problem just let know i will look for it for you.
The idea is right but the start/stop/reset bits maybe cause the problem?