×

Subscribe to newsletter

subscribe to our weekly newsletter to get notified with latest story and article Subscribe now!




PLC BLOG | Omron PLC Conversion Instructions - CX-Programmer

Share on Facebook Share On Twitter Share on LinkedIn Share on Whatsapp


Omron PLC Conversion Instructions - CX-Programmer

conversion Instructions help to convert one form of Data to another form of Data. Conversion instructions also convert data from one data type to another. Conversion of data is depends on Instructions block which we used for example ASC Instructions Converts 4-bit hexadecimal digits in the source word into their 8-bit ASCII equivalents. In Omron PLC have many useful conversion Instructions. We discuss in two parts so it is first part of Omron PLC Conversion Instructions.


Omron PLC Gray Code Conversion Instructions Block

GRAY CODE Conversion Instructions Block Converts the gray binary code in a specified word to standard binary data, BCD data, or an angle at the specified resolution. as we know that Gray codes are reflected binary code in this code two consecutive values differ by only one bit. for example decimal value 1 in binary number system equivalents to 1010 In Gray code, 10 are equivalents to 1111. so i think you already know about grey code in your engineering classes. GRAY CODE Conversion Instructions Block used for angle measurement, encoder and where precision is play a very important role. in Omron have you can convert grey code to binary or binary to gray code.


Omron PLC Binary to GRAY CODE Conversion Instructions Block

this instructions block convert binary to gray code. Gray code conversion instructions block classified according to data size which are following:
  • BINARY TO GRAY CODE CONVERT (BIN_GRAY): it convert 16 bit binary to 16 bit gray code.
  • DOUBLE BINARY TO GRAY CODE CONVERT (BIN_GRAYL) : it convert 32 bit binary to 32 bit gray code.

Omron PLC Binary to GRAY CODE Conversion Instructions Block

above is the example Omron PLC Binary to GRAY CODE conversion Instructions block, where D1 in BIN_GRAY is source word input which converted into gray code and stored in D200 which is known as destination word. Same for BIN_GRAYL where D10 is source word and D220 is Destination word where after conversion of data stored in the form of gray code.


Omron PLC GRAY CODE to Binary Conversion Instructions Block

these conversion block convert gray code into binary code. These are also classified as according to data size which are following
  • GRAY CODE To BINARY CONVERT (GRAY_BIN): it convert 16 bit gray code to 16 bit binary.
  • GRAY CODE TO double BINARY CONVERT (GRAYL_BINL) : it convert 32 bit gray code to 32 bit binary code.

Omron PLC GRAY CODE to Binary Conversion Instructions Block

above example of Omron PLC GRAY CODE to Binary Conversion Instructions where D200 16 bit gray code input these gray code input converted into 16 bit binary and stored into D210. same for next rung but size of data is 32 bit gray code(D220) converted into 32 bit binary(D250).


Omron PLC GRAY CODE to Binary Conversion Instructions (GRY)

GRY conversion instructions Converts the gray code into standard binary data, BCD data, or an angle at the specified resolution. Other gray code conversion which we discuss above don't control data resolution. but GRY control resolution of data which specified in control word.
    GRY Conversion Instructions have following structure
  • Control WORD : it control resolution of data and conversion mode. control word have three type of conversion mode Binary mode, BCD mode, Angle Mode.
  • Source WORD : input of gray binary code which we converted into binary
  • Destination Word: it contain the results of converting data (gray binary code) at the resolution which specified in control data word.

Omron PLC GRAY CODE to Binary Conversion Instructions (GRY)

above is the example of Omron PLC GRY Instructions so we know control word control and set conversion mode of block so first we use a block as binary mode. In binary mode Gray binary code is converted to binary data between 0000 0000 and 0000 7FFF hex. Zero point offset. in BCD mode the data is converted to BCD between 0000 0000 and 0003 2767 and in 360 Mode Gray binary code is converted to BCD data. The data is converted to an angle between 0000 0000 and 0000 3599 (0.0 to 359.9 in 0.1 increments).


 
Share on Facebook Share On Twitter Share on LinkedIn Share on Whatsapp


Suggested Post


 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

comment