585,604 active members*
3,299 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Dynomotion/Kflop/Kanalog > GetVirtualBits(49): Don't seem to work like GetKflopBitState(6)??
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004
    Posts
    235

    GetVirtualBits(49): Don't seem to work like GetKflopBitState(6)??

    Greetings,

    GetVirtualBits(49): Don't seem to work like GetKflopBits()??

    Is there something special I need to do, to get the info., as to "if" the output is on or off, or the input is on or off?

    I use this for my LED control, on my CNC Software Screens... I am wanting to make an option to use the Konnect board, which I have. The functionality of the board works, outputs are going on and off. Just need to get control of the LED's... when using or when I install a Konnect board.

    Thanks so much!
    __________________________________________________ __________

    private void ReadBits()
    {
    if (GV.outputtype == 1) //CNC4PC BOARD
    {
    GV.out5 = MainStatus.GetKFlopBitState(5);
    GV.out6 = MainStatus.GetKFlopBitState(6);
    GV.out7 = MainStatus.GetKFlopBitState(7);
    GV.out16 = MainStatus.GetKFlopBitState(16);

    GV.out17 = MainStatus.GetKFlopBitState(17);
    GV.out18 = MainStatus.GetKFlopBitState(18);
    GV.out19 = MainStatus.GetKFlopBitState(19);
    GV.out20 = MainStatus.GetKFlopBitState(20);


    GV.in0 = MainStatus.GetKFlopBitState(0);
    GV.in1 = MainStatus.GetKFlopBitState(1);
    GV.in2 = MainStatus.GetKFlopBitState(2);
    GV.in3 = MainStatus.GetKFlopBitState(3);

    GV.in4 = MainStatus.GetKFlopBitState(4);
    GV.in21 = MainStatus.GetKFlopBitState(21);
    GV.in22 = MainStatus.GetKFlopBitState(22);
    GV.in23 = MainStatus.GetKFlopBitState(23);
    }

    if (GV.outputtype == 2) //KONNECT BOARD
    {
    GV.out5 = MainStatus.GetVirtualBits(48);
    GV.out6 = MainStatus.GetVirtualBits(49);
    GV.out7 = MainStatus.GetVirtualBits(50);
    GV.out16 = MainStatus.GetVirtualBits(51);

    GV.out17 = MainStatus.GetVirtualBits(52);
    GV.out18 = MainStatus.GetVirtualBits(53);
    GV.out19 = MainStatus.GetVirtualBits(54);
    GV.out20 = MainStatus.GetVirtualBits(55);


    GV.in0 = MainStatus.GetVirtualBitsEx0(1024);
    GV.in1 = MainStatus.GetVirtualBitsEx0(1025);
    GV.in2 = MainStatus.GetVirtualBitsEx0(1026);
    GV.in3 = MainStatus.GetVirtualBitsEx0(1027);

    GV.in4 = MainStatus.GetVirtualBitsEx0(1028);
    GV.in21 = MainStatus.GetVirtualBitsEx0(1029);
    GV.in22 = MainStatus.GetVirtualBitsEx0(1030);
    GV.in23 = MainStatus.GetVirtualBitsEx0(1031);
    }

    GV.out47 = MainStatus.GetKFlopBitState(47); //HOME INDICATOR

    }
    private void LEDControl()
    {
    if (GV.out5 != 0) { led9.Show(); } else { led9.Hide(); }
    if (GV.out6 != 0) { led10.Show(); led23.Show(); } else { led10.Hide(); led23.Hide(); }
    if (GV.out7 != 0) { led11.Show(); led24.Show(); } else { led11.Hide(); led24.Hide(); }
    if (GV.out16 != 0) { led12.Show(); led25.Show(); } else { led12.Hide(); led25.Hide(); }

    if (GV.out17 != 0) { led13.Show(); led26.Show(); } else { led13.Hide(); led26.Hide(); }
    if (GV.out18 != 0) { led14.Show(); led48.Show(); } else { led14.Hide(); led48.Hide(); }
    if (GV.out19 != 0) { led15.Show(); led49.Show(); } else { led15.Hide(); led49.Hide(); }
    if (GV.out20 != 0) { led16.Show(); led47.Show(); } else { led16.Hide(); led47.Hide(); }

    if (GV.in0 != 0) { led1.Show(); } else { led1.Hide(); }
    if (GV.in1 != 0) { led2.Show(); } else { led2.Hide(); }
    if (GV.in2 != 0) { led3.Show(); } else { led3.Hide(); }
    if (GV.in3 != 0) { led4.Show(); } else { led4.Hide(); }

    if (GV.in4 != 0) { led5.Show(); } else { led5.Hide(); }
    if (GV.in21 != 0) { led6.Show(); } else { led6.Hide(); }
    if (GV.in22 != 0) { led7.Show(); } else { led7.Hide(); }
    if (GV.in23 != 0) { led8.Show(); } else { led8.Hide(); }

    if (GV.out47 != 0) { led38.Show(); } else { led38.Hide(); } //HOME INDICATOR
    }
    Robot & Machine Design - BLUECNC4, GreenCNC3, RedCNC2L, SilverCNC2; CNC Software!
    www.truemachinedesign.com - - - - - - - - - - - - - www.truemachineautomation.com

  2. #2
    Join Date
    Jul 2004
    Posts
    235

    Re: GetVirtualBits(49): Don't seem to work like GetKflopBitState(6)??

    Note: I am able to get the input LED's to work... and the code for them works. GetVirtualBitsEx0(1024). This is my input 1 on the Konnect Board.

    Problem is with the GetVirtualBits(??).

    Thanks,
    Robot & Machine Design - BLUECNC4, GreenCNC3, RedCNC2L, SilverCNC2; CNC Software!
    www.truemachinedesign.com - - - - - - - - - - - - - www.truemachineautomation.com

  3. #3
    Join Date
    May 2006
    Posts
    4045

    Re: GetVirtualBits(49): Don't seem to work like GetKflopBitState(6)??

    Hi jeffserv,

    The 1024 Extended Virtual bits are packed into 32-bit words. The first 32 (first word) are uploaded with the main status (as VirtualBitsEx0) as a quick way of being able to access those first 32 without having to do a more expensive USB communication to KFLOP to get them individually. To access those "fast" Virtual Extended Bits use the GetVirtualBitsEx0() function with a parameter of 0-31 that correspond to KFLOP Bits 1024-1055.

    Similarly you can read the 16 original Virtual bits with GetVirtualBits() function with a parameter of 0-15 that correspond to KFLOP Bits 48-63

    You might look at the source code for the KM_MainStatus for which values are available in the Main Status and how to access them.

    HTH
    Regards
    TK
    TK
    http://dynomotion.com

  4. #4
    Join Date
    Jul 2004
    Posts
    235

    Re: GetVirtualBits(49): Don't seem to work like GetKflopBitState(6)??

    That is it... 0-15... Thanks, I will try that.

    The Ex0(1024) seems to work however also.

    Thanks,
    Robot & Machine Design - BLUECNC4, GreenCNC3, RedCNC2L, SilverCNC2; CNC Software!
    www.truemachinedesign.com - - - - - - - - - - - - - www.truemachineautomation.com

Similar Threads

  1. Laid-off from work but made my G0704 CNC start to work
    By GLENNCAI in forum Benchtop Machines
    Replies: 3
    Last Post: 10-24-2014, 01:57 PM
  2. Work Planes / Work Coordinates
    By MICFDI in forum Esprit
    Replies: 11
    Last Post: 10-04-2014, 02:41 PM
  3. Need some work cnc lathe work done
    By slickcdb2000 in forum RFQ (Request for Quote)
    Replies: 4
    Last Post: 09-07-2013, 05:32 AM
  4. Trade of services Cad work + Cash for CNC work.
    By asv4k8 in forum North America RFQ's
    Replies: 0
    Last Post: 11-20-2012, 10:40 AM
  5. Work holding options to hold thin round work? .024, .046 etc
    By KyleH2 in forum MetalWork Discussion
    Replies: 0
    Last Post: 06-07-2010, 07:22 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
  •