CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > G-Code Programing


G-Code Programing Discuss G-code programing and problems here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 02-03-2011, 10:44 AM
 
Join Date: May 2008
Location: India
Posts: 85
yaji63 is on a distinguished road
Smile Custom Macro for Finding Cycle time

Hi,

Can someone help me with a custom macro to find out the exact cycle time for an executed program ?
Right now i enter the system clock variable value into another user variable during start and end of the program and then manually find out the time difference between the two times to find the cycle time. This is a cumbersome job when there are multiple programs with ATC being used. I was wondering whether someone knows how to subtract the end time from start time on a 24 Hr clock (also considering date of execution by taking into account system date). The date on my system reads in format hh/mm/ss and the variable is updated as hhmmss.

thanks a ton
Reply With Quote

  #2   Ban this user!
Old 02-03-2011, 11:14 AM
Perfect Circle's Avatar  
Join Date: Jul 2010
Location: USA
Posts: 263
Perfect Circle is on a distinguished road

What control are you using?
Reply With Quote

  #3   Ban this user!
Old 02-04-2011, 04:00 AM
 
Join Date: May 2008
Location: India
Posts: 85
yaji63 is on a distinguished road

Fanuc 0i-MD
Reply With Quote

  #4   Ban this user!
Old 02-04-2011, 02:50 PM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road

Hi,

You may find it simpler to use the continuous millisecond counter #3001.

Reset #3001 to zero at start of program.

At end of program save the value of #3001 to another macro variable (#500 for example). Then convert this value to a legible format (sexagesimal). I use the format hh.mmss (this works well as the values on my macro setting screen are displayed to four decimal places regardless).

Conversion example: -

#500=FIX[#500/3600000]+[[FIX[[[#500/3600000]-FIX[#500/3600000]]*60]]/100]+[[FIX[[[#500/60000]-FIX[#500/60000]]*60]]/10000]

This one-line formula rounds down to the last whole second. You can probably live with this when measuring a single cycle time.



For greater accuracy (eg if you are adding these times together) you may want to use ROUND where FIX is. This creates another issue, however - in some cases it will round up to 60 seconds and you would need to put in another couple of lines of logic to check and correct the final value if necessary.

Something like...

IF[[[#500*100]-FIX[#500*100]]EQ.6]THEN#500=#500+.004 (rounds up the minute if necessary)
IF[[#500-FIX[#500]]EQ.6]THEN#500=#500+.4 (rounds up the hour if you have now made it necessary)


DP

Last edited by christinandavid; 02-04-2011 at 04:40 PM. Reason: Made a boob...
Reply With Quote

  #5   Ban this user!
Old 02-05-2011, 03:04 AM
 
Join Date: May 2008
Location: India
Posts: 85
yaji63 is on a distinguished road
Smile

Thanks for the help

I will try the code that you gave. I will probably go with the millisecond option. Assign the value to a variable and then deduct the same value from the millisecond variable and then put it through the code that you helped with.

I was actually thinking of a code where i calculate the hours from the clock but it could get complicated during changeover of the day but your approach of calculating from milliseconds look simpler !
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 02-05-2011, 03:19 AM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road

No probs,

I managed to write one-liners for converting all the other time formats the control uses - millisecs to decimal hours and vice versa, decimal hours to hh.mmss and vice versa. Give us a shout if you need any pointers.

The system I am working on keeps track of the shift as well as seperate tools and sequences within a cycle, extracting those times from auxilliary functions such as tool and pallet changes - I'm having a hard time proving it out as it involves modifications to those macros and I have to wait for the right jobs to come along to do the testing...plus I'm not always on the control in question.

I'm getting there...slowly

DP
Reply With Quote

  #7   Ban this user!
Old 02-07-2011, 08:01 AM
 
Join Date: May 2008
Location: India
Posts: 85
yaji63 is on a distinguished road

I' am actually just looking at getting a program run time in minutes at this point of time.

My next step would be to output the concerned macro variables into a program for which i have not got a solution yet. I cant use DPRINT as my machine has a dataserver and I' am not connected by RS232 which is supposed to be a must for DPRINT to work. If only i would output the data into a program and then punch it out to data server, i have ways of processing this data externally on a computer by putting it into an excel spreadsheet and getting all the info that i want in an understandable and presentable format.

Do you know of a way to take out macro variables the way i' am wanting them ?
Reply With Quote

  #8   Ban this user!
Old 02-07-2011, 02:08 PM
christinandavid's Avatar  
Join Date: Aug 2009
Location: New Zealand
Posts: 573
christinandavid is on a distinguished road

DPRNT is the only way to get a decent report out of the machine as far as I know...

From what I have read on this site, it should be possible to set up the system parameters to output data to RS232 using DPRNT (as long as the external computer is 'ready'), while still keeping the dataserver path for programs.

Saying that - surely the macro variable values can be 'punched' to the dataserver/dataserver host, as can the system parameters? I'll look at that the next chance I get...


Hopefully I will get this sorted on our control when we get the Renishaw GUI installed (been waiting two years for that one). For now, I have a little laminated template to hold over the monitor so I can keep track of what each variable represents (my system uses from #500 up to #799...don't laugh...)

DP
Reply With Quote

  #9   Ban this user!
Old 02-07-2011, 09:58 PM
 
Join Date: May 2008
Location: India
Posts: 85
yaji63 is on a distinguished road

You use close to 300 variables for monitoring ! Thats great....seems like you dont allow any information to escape..i cant even imagine how to make use of all 300 variables in one go

I' am also looking for ways of just punching the variable values into data server and i hope i can get it sometime soon. There are things that Fanuc is very unfriendly about and i think this is one of them. Even though computers and networking technologies have moved ahead FANUC still holds onto stuff like DPRINT which does not work on an internal channel like the data server communication.
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Macro Containing G65 LostInMacro Fanuc 21 09-15-2010 03:21 PM
"difference between Custom Macro A and Custom Macro B" arulthambi Parametric Programing 4 10-05-2009 03:34 PM
First Time In still finding my way askalot Linear and Rotary Motion 1 03-05-2009 01:30 PM
Custom macro!!!! chrisryn G-Code Programing 4 05-27-2008 10:13 PM
cycle time macro program mcash3000 General CNC (Mill and Lathe) Control Software (NC) 1 03-29-2006 12:33 PM




All times are GMT -5. The time now is 07:53 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361