galluccinator Posted July 7, 2014 Report Posted July 7, 2014 Hello, I am designing a rig for a very fast, time sensitive experiment. The end result is to have a plot with pressure change versus time, so it needs to measure on the order of miliiseconds. I have a Vision 570, and the newest software. I already am able to take ~10 ms increment data and store it into a data table. Is there any way to record the RTC in milliseconds and store that in the data table as well? The system Integers don't seem to have that precision. Note: I do NOT want the scan time resolution, I want the actual time the data point is being taken, so I will need either a timer or real time clock that has this precision. Thanks in advance!!
Alexander Posted July 7, 2014 Report Posted July 7, 2014 Hello, The RTC does not include a time resolution in milliseconds, but as you mentioned this should be possible with the use of a timer. You can utilize the Load Timer Current function to reference a timer and store the value into a ML. Please note that the value being stored is in units of 10ms. For example if 250ms have elapsed the value being stored into the ML will read as 25. This can be easily corrected by multiplying the value by 10. Also important is that the timer that you are running is synced to the RTC. You don't want it running ahead or behind the current RTC value in seconds. One solution to solve this is to start the timer only when the current RTC value is seconds is 0 and reset it once the timer is complete. Logic used to write the RTC date, time, and current value in milliseconds is shown below.
galluccinator Posted July 8, 2014 Author Report Posted July 8, 2014 Thank you, this helped a lot!! One more quick question that came up, is there a way to write an instruction in the code itself to reset every possible MB bit to 0, like you would if you initialized the PLC in info mode?
s.pratt Posted July 8, 2014 Report Posted July 8, 2014 Hello, If you wish to reset and initialize the whole controller, you could set SB 24 and reset it off of the power-up bit (SB 2). If you only wish to reset the MBs, you could perform a vector store from MB 0 for 8192 MBs(or 4095 MBs depending on your controller) storing a value of SB 0 (always 0).
Alexander Posted July 8, 2014 Report Posted July 8, 2014 You're welcome, I'm glad that it was helpful. Yes, absolutely. If you set SB 24 it will perform an initialization of all of the operands and reset the controller.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now