Add date and time stamp to post

Add date and time stamp to post

Anonymous
3,607 Views
11 Replies
Message 1 of 12

Add date and time stamp to post

Anonymous
Not applicable

Could someone please give me an example of the code to add to get the date and time of the post output was processed added to the top just after the file name of each posted program?

Thanks in advance!

0 Likes
3,608 Views
11 Replies
Replies (11)
Message 2 of 12

LibertyMachine
Mentor
Mentor

It's a two-part edit.

 

First, you need to add a variable into your variable list. I added mine here: (the added variable is in RED)

// collected state
var sequenceNumber;
var currentWorkOffset;
var optionalSection = false;
var forceSpindleSpeed = false;
var activeMovements; // do not use by default
var currentFeedId;
var g68RotationMode = 0;
var angularProbingMode;
var now = new Date ();
var wfo;
var suppress = 0;
var smoothing = 0;
var output = 0;
var Clearance = 0;

And then further down the post, you need to add this line:

writeComment((now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear() + " " + now.getHours() + ":" + ('0'+now.getMinutes()).slice(-2));

I added that section of code right before the G20/21 language

 


What post are you working with?


Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.
Message 3 of 12

Anonymous
Not applicable

Its an Okuma post I have been working on.

0 Likes
Message 4 of 12

LibertyMachine
Mentor
Mentor

Here you go, that should get you going


Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.
0 Likes
Message 5 of 12

Anonymous
Not applicable

Hi Seth,

 

Thank you for your time in adding the date to my current post.

 

Here is a post from another CAM we use and the guys like how this is shown in the beginning of the file with the date and some simple setup notes to show what I would like to end up with if possible.

 

(GROUP - CR469T-MILL)
N1 (OKUMA M560)
N2 (TUESDAY, MARCH 28, 2017 15:47)
N3 (PART - )
N4 (NOTES - H1 PROBE BOSS FOR X/Y. PROBE TOP OF PART TO SET Z OFFSET)
N5 (NOTES - )
N6 (NOTES - H2 PROBE INSIDE BORE FOR X/Y. PROBE INSIDE FACE OF JAWS )
N7 (NOTES - + FINISH PART THICKNESS + .850" TO Z OFFSET.)
N8 (NOTES - CYCLE TIME 7+14 )
N9 (NOTES - 5+45 1.5 RIPPER 400 IPM CHAMFER)
N10 (T175 H175 D175 - 1.75 INDEXABLE DRILL)
N11 (T100 H100 D100 - 1.5" RIPPER FACE MILL 4.0" GAUGE LENGTH)

0 Likes
Message 6 of 12

Anonymous
Not applicable
One thing I did notice is that if you use the program comment section of the post dialog to add setup info, it will not remember it the next time you post out the program. Is there a better way of doing this besides printing a setup sheet?
0 Likes
Message 7 of 12

Anonymous
Not applicable

Don't know if its possible but if you write the setup info to the setup folder in inside the CAM setup by using the "edit notes" tab it will print to the set sheet if you use them but we prefer to have it in the header of the program along with the machine the file is intended for.

0 Likes
Message 8 of 12

LibertyMachine
Mentor
Mentor

Yes, it is possible to have those output to the program. I'm in the middle of a setup, so limited on time. You can search on the post forum and see if this has been requested before (I suspect it has)


Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.
0 Likes
Message 9 of 12

Anonymous
Not applicable
No worries, Adding the time stamp was what I needed for now as were testing different versions of the same program and it really helps to know which one is the most current loaded in the control.
Thanks again for your help!
0 Likes
Message 10 of 12

MetalRipper_
Advocate
Advocate

It works. Thank you @LibertyMachine 

My two cents: Default FANUC post don't allow the following characters

/ :

 

So add these characters in the post or use different characters that are permitted.

 

gokul1078_0-1642241693259.png

 

Gokul Kannan
Making Parts at MetalRipper using Fusion 360
Youtube.com/@metalripper-
CNCexpert.com/gokul-kannan
0 Likes
Message 11 of 12

richardBL2WN
Participant
Participant

Excuse me, I want to know what it means, and tutorial.
" writeComment((now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear() + " " + now.getHours() + ":" + ('0'+now.getMinutes()).slice(-2));  "

0 Likes
Message 12 of 12

MetalRipper_
Advocate
Advocate
Can you elaborate what you donot understand?

The code is written in javascript language for fusion 360 post processor to output date and time while exporting g - code.
Gokul Kannan
Making Parts at MetalRipper using Fusion 360
Youtube.com/@metalripper-
CNCexpert.com/gokul-kannan