Hi,
I am looking for a sample codes including source writing in C/C++ using the FANUC FOCUS library to talk to the FANUC controller. Any sample code is appreciated.
Thanks,
Henry
Hi,
I am looking for a sample codes including source writing in C/C++ using the FANUC FOCUS library to talk to the FANUC controller. Any sample code is appreciated.
Thanks,
Henry
henry95, Did you ever find anything on this? I'm looking for the same thing.
Not really, but it's more simple than I thought. First, I assume you already have the Focus library from FANUC, here is an example:
unsigned short FlibHndl; // Focus Library hanlde
int status;
// Get handle by calling cnc_allclibhndl, cnc_allclibhndl2,
// or cnc_allclibhndl3 depends on what you want
status = cnc_allclibhndl(&FlibHndl);
if (status == EW_OK)
{
// Ok, we get the handle. now use the handle to call
// other functions
short spdl;
status = cnc_rdnspdl(FlibHndl, &spdl);
if (status == EW_OK)
{
// So we got the number of spindles
printf ("Number of spindles = %d", spdl);
}
....
// Release the handle
cnc_freelibhndl(FlibHndl);
}
And that's all folks!!
Good luck,
Henry