You need to convert the gray code to binary in the PLC.Hi all
I have a gray code 3bit is useing in determining the angle of the machine,
also i have the plc unite type s7 315-2dp
but i need to know :
- how can i get the angle by gray code 3bit by using the plc ?
best regards
MAHER
[XIC(Inputs_I_04.2)XIO(Actual_Encoder_Pos.3),XIO(Inputs_I_04.2)XIC(Actual_Encoder_Pos.3)]OTE(Actual_Encoder_Pos.2); [XIC(Inputs_I_04.1)XIO(Actual_Encoder_Pos.2),XIO(Inputs_I_04.1)XIC(Actual_Encoder_Pos.2)]OTE(Actual_Encoder_Pos.1); [XIC(Inputs_I_04.0)XIO(Actual_Encoder_Pos.1),XIO(Inputs_I_04.0)XIC(Actual_Encoder_Pos.1)]OTE(Actual_Encoder_Pos.0);of course
but i need an application to illustrate this steps by using plc
thanks alot
maher
[XIC(Inputs_I_04.2)XIO(Actual_Encoder_Pos.3),XIO(Inputs_I_04.2)XIC(Actual_Encoder_Pos.3)]OTE(Actual_Encoder_Pos.2); [XIC(Inputs_I_04.1)XIO(Actual_Encoder_Pos.2),XIO(Inputs_I_04.1)XIC(Actual_Encoder_Pos.2)]OTE(Actual_Encoder_Pos.1); [XIC(Inputs_I_04.0)XIO(Actual_Encoder_Pos.1),XIO(Inputs_I_04.0)XIC(Actual_Encoder_Pos.1)]OTE(Actual_Encoder_Pos.0);
The code above will do the decoding of the gray to binary.
Use an integer for (Actual Encoder Pos)
Your integer will display the number you are looking for.
You have to do it in your PLC, not sure what hardware you use but the above was done using control logix series hardware.
| Grey input bit 2 Converted Bit 2
|--------| |----------------------------------------------( )-------|
| |
| Grey Input Bit 1 Converted Bit 2 Converted Bit 1 |
|--------| |-----------------|\|-------------+------------( )-------|
| | |
| Grey Input Bit 1 Converted Bit 2 | |
|--------|\|-----------------| |-------------+ |
| |
| Grey Input Bit 0 Converted Bit 1 Converted Bit 0 |
|--------| |-----------------|\|-------------+------------( )-------|
| | |
| Grey Input Bit 0 Converted Bit 1 | |
|--------|\|-----------------| |-------------+ |