Results 11 to 11 of 11
-
02-20-2010, 11:55 AM #11
Re: Gray Type Rotary Encoder from Farnell / Maplin
I have made this program for the" leobodnar" encoder.
It can read the encoder, but only in slow detent.
Here is the program for CRS setting:
Var 0000, name inicialization, Value 0
{
}
Var 0101, name READ_CRS, Link FSUIPC_IN, Offset $0C4E, Length 2
Var 0151, name WRITE_CRS, Link FSUIPC_OUT, Offset $0C4E, Length 2
// **********ENCODER CONTROL**********
VAR 0303, name ENCODER
Var 0301, name ENC1, Link IOCARD_SW, Input 18,
Var 0300, name ENC2, Link IOCARD_SW, Input 19,
{
iF &ENC1 = 1
{
IF &ENC2 = 1
{
&ENCODER = +1
}
}
iF &ENC1 = 0
{
IF &ENC2 = 0
{
&ENCODER = +1
}
}
iF &ENC1 <> &ENC2
{
&ENCODER = -1
}
&WRITE_CRS = ROTATE 1 ,360 ,&ENCODER
}
//************************************
Var 0902, name Schange, Link SUBRUTINE
{
&Schange = 0
&WRITE_CRS = &READ_CRS
}
SIOC is new for me, and I am in the learning process.Sincerely,
Claus
Similar Threads
-
Can I use this type of Rotary Encoder for FSBus
By RobiD in forum I/O Interfacing Hardware and SoftwareReplies: 16Last Post: 06-30-2009, 07:02 AM -
Turning a Rotary encoder with a pushbutton into a dual rotary encoder
By snizbatch in forum I/O Interfacing Hardware and SoftwareReplies: 2Last Post: 05-11-2009, 02:57 AM -
2 Bit Gray Encoder Question
By Suggy in forum I/O Interfacing Hardware and SoftwareReplies: 2Last Post: 07-29-2006, 07:12 AM