• matthew@hierthinking.com

Forum

Please or Register to create posts and topics.

Getting Part Count from FOCAS2

Is there a way to get part counts via the following method or another?

cnc_rdmacroinfo()

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.

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.