Newbie Programming with Focas library


Results 1 to 16 of 16

Thread: Programming with Focas library

  1. #1
    Registered
    Join Date
    Jul 2008
    Location
    US
    Posts
    1
    Downloads
    0
    Uploads
    0

    Default Programming with Focas library

    Hey guys, I'm new to the forum and I'm an ME student interning at a manufacturing company. We use mostly 4 axis machines with Fanuc controllers. The project I was just given was to use the Focas1/2 libraries and create a program that will display simple actions (spindle on/off, etc.) of the machines at any time. I have been researching and reading through the Focas documentation but I cannot figure out how to even start this project. I have done a little VBA and C++ and plan on using VB.NET for this project, but I am no programmer. Any help that you guys can provide or even just pointing me towards some tutorials would be amazing.

    Thanks!

    Similar Threads:


  2. #2
    Registered
    Join Date
    Mar 2005
    Location
    France
    Posts
    12
    Downloads
    0
    Uploads
    0

    Default

    First Code in VB6 for Focas; Just in ordre to test the connection between your PC and the NControler

    '---------------------
    ' Ethernet connection
    '---------------------
    ' allocate library handle 3
    Declare Function cnc_allclibhndl3 Lib "fwlib32.dll" (ByVal sIPaddr As String, ByVal nPort As Integer, ByVal nTimeout As Long, FlibHndl As Integer) As Integer

    Private Sub Form_Load()
    Dim LibHndl As Integer
    Dim Ret As Integer

    Ret = cnc_allclibhndl3("192.0.0.1", "8193", 10, LibHndl)

    End Sub



  3. #3
    Registered
    Join Date
    Feb 2017
    Location
    India
    Posts
    1
    Downloads
    0
    Uploads
    0

    Default Re: Programming with Focas library

    Can u be little more specific with a sample code ??



  4. #4
    Registered
    Join Date
    Mar 2008
    Location
    Germany
    Posts
    26
    Downloads
    0
    Uploads
    0

    Default Re: Programming with Focas library

    Hi,
    although we're doing C++ programming the following might help:
    https://www.inventcom.net/support/fa...-states#SOURCE

    You can also take a look at the FOCAS documentation here:
    https://www.inventcom.net/support/fanuc/focas-library

    Martin



  5. #5
    Registered
    Join Date
    Jun 2017
    Posts
    5
    Downloads
    0
    Uploads
    0

    Default Re: Programming with Focas library

    Hi,

    i'm a bit in late

    I'm trying to create a program (VB and Focas) whit the purpose to edit the part program from pc.

    First of all I've tested the Focas function and the IP setting on CNC trough a free demo application (Opn Communications): all works!

    Then I use command cnc_allclibhndl3 from my VB's program but it return me error number -15: "There is no DLL file for each CNC series corresponding to specified node"..
    What is mean?? I've incorporate in the folder of my VB's project the file Fwlib32.dll. Do I need some other library files?

    Thanks!



  6. #6
    Member vincent.pomerleau's Avatar
    Join Date
    Feb 2010
    Location
    Canada
    Posts
    69
    Downloads
    3
    Uploads
    0

    Default Re: Programming with Focas library

    Yes! there are other .dll than the fwlib32.dll, it depend on the control you're using



  7. #7
    Registered
    Join Date
    Jun 2017
    Posts
    5
    Downloads
    0
    Uploads
    0

    Default Re: Programming with Focas library

    Thanks Vincent for the answer.

    I use a 31 series, so I put in the same folder (bin\debug) of fwlib32.dll the file fwlib31i.dll but the result don't change, always error number -15. I tried to add also the files of the whole series but nothing.

    Instead, if I add the files fwlibe1.dll and fwlib32.lib, running cnc_allclibhndl3 takes longer time and returns error number 172031984 (???). I don't understand



  8. #8
    Member vincent.pomerleau's Avatar
    Join Date
    Feb 2010
    Location
    Canada
    Posts
    69
    Downloads
    3
    Uploads
    0

    Default Re: Programming with Focas library

    According to my documentation, with a 31i control you need the FWLIB30i.DLL, if it's a FS31i, you need the FWLIBNCG.DLL.



  9. #9
    Registered
    Join Date
    Jun 2017
    Posts
    5
    Downloads
    0
    Uploads
    0

    Default Re: Programming with Focas library

    I'll try with the fwlibncg.dll.
    Is it enough to put it in the folder or do I have to import it via vb code?
    Could you send me documentation via private message please? What I had was lost who knows where...



  10. #10
    virkinder's Avatar
    Join Date
    Oct 2019
    Posts
    2
    Downloads
    0
    Uploads
    0

    Default

    I am also trying and getting error LNK1104,i have tried my best but in vain. Can You please suggest me how did you link Fwlib32.lib file in Linker-Input(Is there any special way to provide path).Kindly assist as you have crossed this stage.
    Anyways for error -15 I think you need to copy Fwlibe1.lib into debug folder where is your .cpp file.



  11. #11
    virkinder's Avatar
    Join Date
    Oct 2019
    Posts
    2
    Downloads
    0
    Uploads
    0

    Default

    Kindly someone suggest me how to get rid of LNK1104.This error has ruined my life...????????..I am simply copying path and pasting into Linker- Input and General.Looking for some assistance from you guys. Thanks in advance



  12. #12
    Member Versex's Avatar
    Join Date
    May 2020
    Posts
    8
    Downloads
    0
    Uploads
    0

    Default Re: Programming with Focas library

    Hey folks,

    If anyone is looking for a Focas programming tutorial for .Net I have started a series of posts on my blog. Check it out and let me know what you think. If there is anything you want to see or think should be added, let me know.

    https://hierthinking.com/2020/04/25/...e-to-focas-p1/



  13. #13
    Member
    Join Date
    Nov 2012
    Location
    USA
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default Re: Programming with Focas library

    Quote Originally Posted by Versex View Post
    Hey folks,

    If anyone is looking for a Focas programming tutorial for .Net I have started a series of posts on my blog. Check it out and let me know what you think. If there is anything you want to see or think should be added, let me know.

    https://hierthinking.com/2020/04/25/...e-to-focas-p1/
    I am going through your tutorial.
    Thank you,



  14. #14
    Member
    Join Date
    Nov 2012
    Location
    USA
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default Re: Programming with Focas library

    Thank you.
    I am going through your tutorial now.



  15. #15
    Member henriquenunez's Avatar
    Join Date
    Sep 2020
    Posts
    0
    Downloads
    0
    Uploads
    0

    Default Re: Programming with Focas library

    Quote Originally Posted by Versex View Post
    Hey folks,

    If anyone is looking for a Focas programming tutorial for .Net I have started a series of posts on my blog. Check it out and let me know what you think. If there is anything you want to see or think should be added, let me know.

    https://hierthinking.com/2020/04/25/...e-to-focas-p1/
    Hey, just checked your posts. Congratulations for your work, it is quite good!

    I'm wondering if .NET delivers a good performance for fast data acquisition (mostly machine positioning around 1kHz). Anyone here knows?

    Thanks



  16. #16

    Default Re: Programming with Focas library

    Quote Originally Posted by henriquenunez View Post
    Hey, just checked your posts. Congratulations for your work, it is quite good!

    I'm wondering if .NET delivers a good performance for fast data acquisition (mostly machine positioning around 1kHz). Anyone here knows?

    Thanks
    The problem isn't .NET it's the network connection. The execution of your .NET code is going to be faster than a network response by an order of magnitude. So you should be asking yourself about the latency of the connection between the machine control and your PC.



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

Programming with Focas library

Programming with Focas library