Jump to content
Sign in to follow this  
galluccinator

Can the RTC be displayed in milliseconds?

Recommended Posts

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!!

Share this post


Link to post
Share on other sites

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.

 

10ms Resolution Data Table

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...