Forum
Getting Part Count from FOCAS2
Quote from Mattia Donnini on March 23, 2022, 10:25 amIs there a way to get part counts via the following method or another?
cnc_rdmacroinfo()
Is there a way to get part counts via the following method or another?
cnc_rdmacroinfo()
Quote from Versex on March 23, 2022, 12:01 pmHi Mattia,
You can retrieve the part count by utilizing Focas1.cnc_rdparam(). However, in order to get this information the option has to be enabled on the machine. If it is, then you should have no problem, however, if you try to read the part count and get a return code of 6, it means that the option is not installed and you'll have to call Fanuc and pay to get it enabled.
So in my case, the code I used is:
Focas1.IODBPSD_1 m = new Focas1.IODBPSD_1();
short ret = Focas1.cnc_rdparam(Fanuc.Handle, 6712, 0, 8, m);I do not know if different models store the part count in different places, but parameter 6712 is where I read my part count from. So if yours is the same, then the code should work just fine. Let me know if this helps.
Hi Mattia,
You can retrieve the part count by utilizing Focas1.cnc_rdparam(). However, in order to get this information the option has to be enabled on the machine. If it is, then you should have no problem, however, if you try to read the part count and get a return code of 6, it means that the option is not installed and you'll have to call Fanuc and pay to get it enabled.
So in my case, the code I used is:
Focas1.IODBPSD_1 m = new Focas1.IODBPSD_1();
short ret = Focas1.cnc_rdparam(Fanuc.Handle, 6712, 0, 8, m);
I do not know if different models store the part count in different places, but parameter 6712 is where I read my part count from. So if yours is the same, then the code should work just fine. Let me know if this helps.
Quote from Mattia Donnini on March 25, 2022, 9:12 amThanks Versex! I solved it using cnc_rdparam3 as follows:
Focas1.IODBPSD data = new Focas1.IODBPSD();
short ret = Focas1.cnc_rdparam3(handle, 6711, 0, 8, 0, data);I think it's the same result as you posted.
Thanks Versex! I solved it using cnc_rdparam3 as follows:
Focas1.IODBPSD data = new Focas1.IODBPSD();
short ret = Focas1.cnc_rdparam3(handle, 6711, 0, 8, 0, data);
I think it's the same result as you posted.