Using the "FOCAS" set of libraries (FANUC Open CNC API Specifications)
Hello everybody,
First of all, I apologize in advance for my English mistakes.
Do someone know how to use the "FOCAS" set of libraries ?
(Despite the documentation and some researchs on the Internet, I need some help)
I do a professional training and I'm trying to create a little application in C# which uses the fwlib32 library (which is included in FOCAS) to communicate with a FANUC controller Oi-MB.
When I call the function "cnc_delall" to clear the memory of the machine, the machine must be in EDIT mode (if it doesn't be in this mode, the return of the fonction is : "the machine is busy")
To avoid a manual operation on the operator panel, I want to change the mode automatically. That's why I try to use this functions :
cnc_wropnlsgnl (Writes the output signal of software operator's panel.)
cnc_rdopnlsgnl (Reads the output signal image of software operator's panel.)
When I try to read the data, there is no error return, but all the values readed are 0 whatever the mode is.
Is it the function which I need ?
If there is a need, I will give more details.
Thank you in advance for your help.
Regards,
Gwaihir
Re: Using the "FOCAS" set of libraries (FANUC Open CNC API Specifications)
Hi,
I have the same problem with cnc_rdopnlsgnl.
This is my code:
IODBSGNL sgnl;
short slct_data = (1 << 4) | (1 << 5); // bit 5: Feedrate override signal, bit4: Manual feedrate override signal
short ret = cnc_rdopnlsgnl(m_handle, slct_data, &sgnl);
if (ret == EW_OK)
{
printf("FEED: t:%d f:%d j:%d", sgnl.type, sgnl.feed_ovrd, sgnl.jog_ovrd);
}
And the output is: FEED: t:48 f:0 j:0 all the time.
And I think this should be 100 for feed_ovrd and 10 for jog_ovrd according to the manual, when there is no override.
Is this working for anybody ?
Thank you!
Re: Using the "FOCAS" set of libraries (FANUC Open CNC API Specifications)
I have found a solution! I have tested with 0i-F and 0i-D. The negative values might have to handle differently for some machines...
"m_handle" -is what cnc_allclibhndl3 gave back.
IODBPMC pmc;
short ret = pmc_rdpmcrng(m_handle, 0, 0, 12, 12, 9, &pmc); // G012 = FeedOvr
if (ret == EW_OK)
{
short value = pmc.u.cdata[0];
if (value < 0)
value = -value - 1;
return value;
}
Quote:
Originally Posted by
sbela
Hi,
I have the same problem with cnc_rdopnlsgnl.
This is my code:
IODBSGNL sgnl;
short slct_data = (1 << 4) | (1 << 5); // bit 5: Feedrate override signal, bit4: Manual feedrate override signal
short ret = cnc_rdopnlsgnl(m_handle, slct_data, &sgnl);
if (ret == EW_OK)
{
printf("FEED: t:%d f:%d j:%d", sgnl.type, sgnl.feed_ovrd, sgnl.jog_ovrd);
}
And the output is: FEED: t:48 f:0 j:0 all the time.
And I think this should be 100 for feed_ovrd and 10 for jog_ovrd according to the manual, when there is no override.
Is this working for anybody ?
Thank you!