585,982 active members*
4,766 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Fanuc > FOCAS pmc_rdpmcrng function in the c#
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2021
    Posts
    3

    Post FOCAS pmc_rdpmcrng function in the c#

    PMC_RDPMCRNG from within the Focas library | I want to pull this function using the ready-made function below, but I am getting an error in the byte part, can you help?



    public short sample(ushort start=3, ushort end=4)
    {
    short ret, idx;
    short adr_type, data_type;
    ushort length;

    adr_type = 2; // In case that kind of PMC address is G
    data_type = 0; // In case that type of PMC data is Byte
    length = (ushort)(8 + (end - start + 1));
    byte[] bytes = new byte[length];
    ret = Focas1.pmc_rdpmcrng(_handle, adr_type, data_type, start, end, length, bytes[1]);
    if (ret == Focas1.EW_OK)
    {
    for (idx = 0; idx <= end - start; idx++)
    {
    Console.WriteLine("#{0:d4} 0x{1:X2}", idx, bytes[8 + idx]);
    }
    }
    else
    {
    Console.WriteLine("ERROR!({0})", ret);
    }
    return (ret);
    }

  2. #2

    Re: FOCAS pmc_rdpmcrng function in the c#

    Hello,
    Did you solve the problem?

Similar Threads

  1. FOCAS cnc_rddynamic function in the c#
    By EmirC in forum Fanuc
    Replies: 2
    Last Post: 11-30-2022, 07:56 PM
  2. Fanuc CNC Focas
    By vik27pc in forum Fanuc
    Replies: 3
    Last Post: 02-22-2022, 01:57 AM
  3. FOCAS Communication issue
    By yaji63 in forum Fanuc
    Replies: 6
    Last Post: 09-17-2015, 01:30 PM
  4. FOCAS. What is that?
    By Leha_Blin in forum Fanuc
    Replies: 2
    Last Post: 06-06-2013, 06:10 PM

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
  •