Dynomotion

Group: DynoMotion Message: 12559 From: frank_19_88 Date: 12/2/2015
Subject: Konnect 32 inputs and 16 outputs visable on Mach3 screen.

 Hi TK,

 

Is it possible to make the 32 inputs and 16 outputs visible within a mach3 screen?

What I know so far:

I can use Mach3 OEMLED 1000-2250

 

Kflop code:

#include "KMotionDef.h"

#define DROIN 7
#define DROOUT 8
main()
{
double *pin = (double *)&persist.UserData[(DROIN -1)*2];
double *pout = (double *)&persist.UserData[(DROOUT-1)*2];

for(;;)
{
Delay_sec(2);
*pout = VirtualBitsEx[0]>>0;
printf("DROIN %d = %f DROOUT %d = %f\n",DROIN,*pin,DROOUT,*pout);
}
}

 

Mach3 code:

NotifyPlugins(18008) 'Read the result from KFLOP
x=GetOEMDRO(1008) 'Check the value passed back

 

Now I have a GetOEMDRO with an number representive to the In/Output data.

1 = input 0

2 = input 1

3 = input 0 & 1

...

How can I convert this number to the OEMLED's?

Or is there any better solution?


With kind regards,

 

Frank

 

Group: DynoMotion Message: 12562 From: TK Date: 12/2/2015
Subject: Re: Konnect 32 inputs and 16 outputs visable on Mach3 screen.
Hi Frank,

You might do something like:



Dim x As Integer
Dim Bit As Integer

x=32+256  ' set bit 5 and 8 as an example


Bit0 = GetBit(x,0)
Bit1 = GetBit(x,1)
Bit2 = GetBit(x,2)
Bit3 = GetBit(x,3)
Bit4 = GetBit(x,4)
Bit5 = GetBit(x,5)
Bit6 = GetBit(x,6)
Bit7 = GetBit(x,7)
Bit8 = GetBit(x,8)
Bit9 = GetBit(x,9)


Regards
TK

On 12/2/2015 4:28 AM, frank_19_88@... [DynoMotion] wrote:
 

 Hi TK,

 

Is it possible to make the 32 inputs and 16 outputs visible within a mach3 screen?

What I know so far:

I can use Mach3 OEMLED 1000-2250

 

Kflop code:

#include "KMotionDef.h"

#define DROIN 7
#define DROOUT 8
main()
{
double *pin = (double *)&persist.UserData[(DROIN -1)*2];
double *pout = (double *)&persist.UserData[(DROOUT-1)*2];

for(;;)
{
Delay_sec(2);
*pout = VirtualBitsEx[0]>>0;
printf("DROIN %d = %f DROOUT %d = %f\n",DROIN,*pin,DROOUT,*pout);
}
}

 

Mach3 code:

NotifyPlugins(18008) 'Read the result from KFLOP
x=GetOEMDRO(1008) 'Check the value passed back

 

Now I have a GetOEMDRO with an number representive to the In/Output data.

1 = input 0

2 = input 1

3 = input 0 & 1

...

How can I convert this number to the OEMLED's?

Or is there any better solution?


With kind regards,

 

Frank

 


Group: DynoMotion Message: 12565 From: TK Date: 12/3/2015
Subject: Re: Konnect 32 inputs and 16 outputs visable on Mach3 screen.
Hi Frank,

Oops.  Just realized I left out the GetBit Bunction:


Function GetBit(Value as Integer, Bit as Integer) as Boolean
    GetBit = (Value And (2^Bit)) <> 0   
End Function

Regards
TK

On 12/2/2015 1:19 PM, TK tk@... [DynoMotion] wrote:
 

Hi Frank,

You might do something like:



Dim x As Integer
Dim Bit As Integer

x=32+256  ' set bit 5 and 8 as an example


Bit0 = GetBit(x,0)
Bit1 = GetBit(x,1)
Bit2 = GetBit(x,2)
Bit3 = GetBit(x,3)
Bit4 = GetBit(x,4)
Bit5 = GetBit(x,5)
Bit6 = GetBit(x,6)
Bit7 = GetBit(x,7)
Bit8 = GetBit(x,8)
Bit9 = GetBit(x,9)


Regards
TK

On 12/2/2015 4:28 AM, frank_19_88@... [DynoMotion] wrote:
 

 Hi TK,

 

Is it possible to make the 32 inputs and 16 outputs visible within a mach3 screen?

What I know so far:

I can use Mach3 OEMLED 1000-2250

 

Kflop code:

#include "KMotionDef.h"

#define DROIN 7
#define DROOUT 8
main()
{
double *pin = (double *)&persist.UserData[(DROIN -1)*2];
double *pout = (double *)&persist.UserData[(DROOUT-1)*2];

for(;;)
{
Delay_sec(2);
*pout = VirtualBitsEx[0]>>0;
printf("DROIN %d = %f DROOUT %d = %f\n",DROIN,*pin,DROOUT,*pout);
}
}

 

Mach3 code:

NotifyPlugins(18008) 'Read the result from KFLOP
x=GetOEMDRO(1008) 'Check the value passed back

 

Now I have a GetOEMDRO with an number representive to the In/Output data.

1 = input 0

2 = input 1

3 = input 0 & 1

...

How can I convert this number to the OEMLED's?

Or is there any better solution?


With kind regards,

 

Frank