[Ma...] Posted October 7, 2020 Share Posted October 7, 2020 We have the Julian date stamped on our parts. The operators type in this date along with the hour it was produced before running on the CMM. The reports are saved to a directory using this along with some other identifiers set up in "Name definition of output file". Is there a clever way or is it even possible to add the current Julian date to a UserField automatically? Link to comment Share on other sites More sharing options...
[Er...] Posted October 8, 2020 Share Posted October 8, 2020 You can always calculate it, if you have pcm. d=executeCode("Win32_SYSTEMTIME getSystemTime").asTimestamp JD=367*d.year-int((7*(d.year+int((d.months+9)/12d)))/4d)+int((275*d.months)/9d)+d.day+1721013.5+((d.hour)+d.minutes/60d+d.seconds/(60**2))/24d-0.5*sign(1,100*d.year+d.months-190002.5)+0.5 setRecordHead("customVar",formatR(JD)) Do some tests, I have not checked that AM/PM work properly etc. But you get the idΓ©a π Link to comment Share on other sites More sharing options...
[Is...] Posted October 8, 2020 Share Posted October 8, 2020 ... Link to comment Share on other sites More sharing options...
[Ma...] Posted October 8, 2020 Author Share Posted October 8, 2020 Thanks for the ideas, but unfortunately I do not have PCM. I wasn't sure if that was my only option to achieve this. Link to comment Share on other sites More sharing options...
[Mi...] Posted October 8, 2020 Share Posted October 8, 2020 I Link to comment Share on other sites More sharing options...
[Er...] Posted October 8, 2020 Share Posted October 8, 2020 Well, he might have a hard time add the code if he don't have the license? Anyway, another way could be a batch-file. I have attached an example. Then just get the output from the file with shOne: and add it to a recordhead variable of your choice. Here's a sneaky way of using "PCM" without a license I picked up from Henrik Lindahl years ago. Just multiply with zero, some where the nominal is supposed to be 0. Only your imagination sets the limit... πjdate.txt Link to comment Share on other sites More sharing options...
[Er...] Posted October 8, 2020 Share Posted October 8, 2020 Haha just read your question again, you wish to read the date from a file name? Or have a entry field to add the date to, manually, so it can be used as your path for saving? Or? Link to comment Share on other sites More sharing options...
[Ma...] Posted October 8, 2020 Author Share Posted October 8, 2020 Please sign in to view this quote. Ideally, I would like to have an entry field that the Julian date would be there updated automatically (and could be manually changed if needed) and I can use this in the "Name definition for output files" for saving. Link to comment Share on other sites More sharing options...
[Er...] Posted October 8, 2020 Share Posted October 8, 2020 Then just create a new report header parameter and force input at cnc-start. DUUUUDE! π No need for the above stuff then. Press F1 and search for "Editing INI file for header data". It's one of those thing no normal person remember how to do. Link to comment Share on other sites More sharing options...
[Ma...] Posted October 8, 2020 Author Share Posted October 8, 2020 Yeah I just don't know how to get the Julian date to populate it. You see the problem I am having with manual entries by the operators is they can't seem to keep all the numbers in order and it makes for a messy and sometimes hard to navigate folder. I believe I can set the number of digits so they can't exceed it which would help, but I thought having the Julian date automatically entered into a UserField would be sweet. This way all they would really have to do is hit go and walk away. Although I'm sure that will get messed up somehow too. π Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in