Jump to content

Adding Julian Date in UserFields Editor


---
 Share

Recommended Posts

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

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

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.
114_998d21e92b3f5f22cad4a685ee993e2a.png
Only your imagination sets the limit... πŸ˜ƒ

jdate.txt

Link to comment
Share on other sites

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

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

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

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

 Share

×
×
  • Create New...