Need Help! Get data from Fanuc OI mate using OPC server


Results 1 to 7 of 7

Thread: Get data from Fanuc OI mate using OPC server

  1. #1
    Member ermanzrnc's Avatar
    Join Date
    Sep 2021
    Posts
    5
    Downloads
    0
    Uploads
    0

    Post Get data from Fanuc OI mate using OPC server

    Hello,

    I need help with something related to my thesis.

    I am using a CNC controlled lathe with a Fanuc OI Mate controller. I'm trying to get realtime data such as feed rate and spindle speed at the time of processing using OPC Server. I can get S and T code data (eg #4319 spindle speed) from system variables without any problem. However, I cannot access the “actual values” of these variables because I do not know their addresses. I've gone through the controller's manual and other related PDF files and I'm pretty confused. For example, how can I measure the instantaneous loads on each axis? Do I need to make any changes in CNC parameters, such as reading PMC values over Ethernet? I have no idea about Parameter. Just try to change looking for the Manuel if I am sure.

    I guess I may be having this problem because of the difference in receiving data over NC and PMC?
    For example, while System Variable values allow me to receive data via NC, is data received via PMC with address values that I do not know?
    I need your help on this. Thanks.

    Similar Threads:


  2. #2

    Default Re: Get data from Fanuc OI mate using OPC server

    Im not overly familiar with OPC but I do know it is limited in what data is available. Programed feedrate is available through #4109. Actual feedrate would only be available through a Function call from OPC if a function is available. #4319 is programed S not actual. So again you would need a function from OPC to read the actual spindle speed.
    The same is true for anything you are wanting to read "real time" vs modal.
    If this is a T control there is a function "Actual spindle speed output" the you can use to read the spindle encoder information from PMC address F40. But there is no such function for actual feed rate.
    You could use PMC window functions and read the actual feedrate, loads, and spindle speed and store it in a PMC register (R,D, E) and access that through OPC. I would hope PMC address access is available to OPC.


    Focas pretty much opens up the whole control and has far more power than OPC.



  3. #3
    Member Algirdas's Avatar
    Join Date
    Mar 2009
    Location
    United Arab Emirates
    Posts
    1982
    Downloads
    2
    Uploads
    0

    Default Re: Get data from Fanuc OI mate using OPC server

    Quite specific task. Please, bear in mind, that all tags intended to be OPC accessible must be marked as such in the PLC ( Fanuc ) side. Means the tag ( variable ) must have an attribute "accessible from outside" turned on. Sometimes it's easier to make a special function to output required data instead of use a standard OPC server.



  4. #4
    Member ermanzrnc's Avatar
    Join Date
    Sep 2021
    Posts
    5
    Downloads
    0
    Uploads
    0

    Default Re: Get data from Fanuc OI mate using OPC server

    Thank you so much "oetkbyentc". It was really informative.

    I still need more detail about things you said. For example, if we would like to assignment “loading data for each axis” into R, D, E register, What path should I follow on the cnc side. My specific area is computer science. So I need more details about fanuc interface.

    Could you give us more details about this? Thanks.

    Last edited by ermanzrnc; 10-14-2021 at 09:22 PM. Reason: Adding


  5. #5
    Member ermanzrnc's Avatar
    Join Date
    Sep 2021
    Posts
    5
    Downloads
    0
    Uploads
    0

    Default Re: Get data from Fanuc OI mate using OPC server

    Quote Originally Posted by Algirdas View Post
    Quite specific task. Please, bear in mind, that all tags intended to be OPC accessible must be marked as such in the PLC ( Fanuc ) side. Means the tag ( variable ) must have an attribute "accessible from outside" turned on. Sometimes it's easier to make a special function to output required data instead of use a standard OPC server.
    Thank you so much. I will take into account what you have said.

    - - - Updated - - -

    Quote Originally Posted by oetkbyentc View Post
    Im not overly familiar with OPC but I do know it is limited in what data is available. Programed feedrate is available through #4109. Actual feedrate would only be available through a Function call from OPC if a function is available. #4319 is programed S not actual. So again you would need a function from OPC to read the actual spindle speed.
    The same is true for anything you are wanting to read "real time" vs modal.
    If this is a T control there is a function "Actual spindle speed output" the you can use to read the spindle encoder information from PMC address F40. But there is no such function for actual feed rate.
    You could use PMC window functions and read the actual feedrate, loads, and spindle speed and store it in a PMC register (R,D, E) and access that through OPC. I would hope PMC address access is available to OPC.


    Focas pretty much opens up the whole control and has far more power than OPC.
    Thank you so much "oetkbyentc". It was really informative.

    I still need more detail about things you said. For example, if we would like to assignment “loading data for each axis” into R, D, E register, What path should I follow on the cnc side. My specific area is computer science. So I need more details about fanuc interface.

    Could you give us more details about this? Thanks.



  6. #6

    Default Re: Get data from Fanuc OI mate using OPC server

    Given your computer science background I suggest looking at the Fanuc Focas functions and libraries.
    These allow direct access to the control using a C or VB application and Fanuc supplied DLL's. Provided your 0i Mate is at least a B series most of the items you are looking to access should not require any options in the control and the imbedded Ethernet should be plenty fast enough.

    A Focas call for Actual Feedrate as an sample of what their documentation provides:

    Declaration
    #include "fwlib32.h" or "fwlib64.h"
    FWLIBAPI short WINAPI cnc_actf(unsigned short FlibHndl, ODBACT *actualfeed);
    Description
    Reads the actual feed rate of the controlled axes of CNC. The actual feed rate is stored in "data" of "ODBACT".
    Arguments
    FlibHndl [ in ]
    Specify the library handle. See "Library handle" for details.
    actualfeed [ out ]
    Pointer to the ODBACT structure including the actual feed rate of the controlled axes. The ODBACT structure is as follows.
    typedef struct odbact {
    short dummy[2]; /* dummy */
    long data; /* the actual feed rate(F) */
    } ODBACT ;

    A code sample;
    void example( void )
    {
    ODBACT buf ;
    cnc_actf( h, &buf ) ;
    printf( "CURRENT F=%ld\n", buf.data ) ;
    }

    The other method would require PMC modifications to add Window read instructions to read the desired NC data that is not available to OPC and store it in PMC registers .
    This can be cumbersome as some NC data is broken into "Fast" and "Slow" data types. If the NC data being read is slow type then you can only have on window executing until the slow data is read. Fast data types can have window reads active constantly. Focas has no such constraints.



  7. #7
    Member ermanzrnc's Avatar
    Join Date
    Sep 2021
    Posts
    5
    Downloads
    0
    Uploads
    0

    Default Re: Get data from Fanuc OI mate using OPC server

    Quote Originally Posted by oetkbyentc View Post
    Given your computer science background I suggest looking at the Fanuc Focas functions and libraries.
    These allow direct access to the control using a C or VB application and Fanuc supplied DLL's. Provided your 0i Mate is at least a B series most of the items you are looking to access should not require any options in the control and the imbedded Ethernet should be plenty fast enough.

    A Focas call for Actual Feedrate as an sample of what their documentation provides:

    Declaration
    #include "fwlib32.h" or "fwlib64.h"
    FWLIBAPI short WINAPI cnc_actf(unsigned short FlibHndl, ODBACT *actualfeed);
    Description
    Reads the actual feed rate of the controlled axes of CNC. The actual feed rate is stored in "data" of "ODBACT".
    Arguments
    FlibHndl [ in ]
    Specify the library handle. See "Library handle" for details.
    actualfeed [ out ]
    Pointer to the ODBACT structure including the actual feed rate of the controlled axes. The ODBACT structure is as follows.
    typedef struct odbact {
    short dummy[2]; /* dummy */
    long data; /* the actual feed rate(F) */
    } ODBACT ;

    A code sample;
    void example( void )
    {
    ODBACT buf ;
    cnc_actf( h, &buf ) ;
    printf( "CURRENT F=%ld\n", buf.data ) ;
    }

    The other method would require PMC modifications to add Window read instructions to read the desired NC data that is not available to OPC and store it in PMC registers .
    This can be cumbersome as some NC data is broken into "Fast" and "Slow" data types. If the NC data being read is slow type then you can only have on window executing until the slow data is read. Fast data types can have window reads active constantly. Focas has no such constraints.


    Dear friend oetkbyentc ,

    First of all, I would like to state that your valuable comments are very useful for us. We are working on the last topic you wrote, I wanted to complete this work and reply to you like that, but this process will take a little longer. That's why I wanted to thank you.



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Get data from Fanuc OI mate using OPC server

Get data from Fanuc OI mate using OPC server