• matthew@hierthinking.com

Forum

Please or Register to create posts and topics.

Editing filed's values through focas

Hi, I was wondering if it was possible to, through focas libraries, edit an object's value in the DIR3_MDATE directory.

In my case for example I wanted to, if requested by the user, update an object's field (which is DateTime) and have it saved both in the focasExplorer currently displaying all the object's values (which is not a problem since by refreshing the istance after setting the new value you get the updated result) and in the CNC itself (in order to be able to permanently change the value of the field, as the focasExplorer object doesn't maintain the updated values once you close and re-open it).

Can't really wrap my head around how to permanently set the new value for it to be memorized and displayed everytime focasExplorer gets opened ... if someone has tips or suggestions please fell welcome to answer

Hi Tommaso,

 

I am not entirely sure I understand what it is that you are attempting to do. The DIR3_MDATE object that you mentioned looks to be used in the cnc_rdprogdir3 function. This is meant to read the data and display it, not to change it. The DIR3_MDATE field is the last modified date of the file you are reading, so I don't think you can change it through Focas. Now, you may be able to work around it by "editing" the file and saving it. That should change the date. But you will not be able to set an arbitrary date.

 

Like I said, I am not sure if this is what you are trying to do or if I am misunderstanding, so please correct me if I am off base.

 

Back in the days of MSDOS, programs would sometimes set a file's timestamp by setting the machine's time to the desired value, saving the file, then restoring the machine's time.

Which leads me to wonder if there's a Focas API to set the CNC's time. I could add a button to my upcoming app to copy the PC's time to the CNC, so my machinists wouldn't have to set that manually. (Their machines are connected by a private Ethernet link to the PC at the bench, and not directly to the company LAN. But if they were, do the Fanuc controls do SNTP to query time from a server?)