5 Categories and Use of Basic Application Instructions API 130 Operands: S : Source device (0 °≦ S < 360 ° ) D : Operation result Explanations: 1. SIN instruction performs sine operation on S and stores the result in D 2. F refers to floating point input. Be sure to add a decimal point when using it. 3. Only 32-bit instructions DSIN and DSINP are applicable. 4. The value in S can be set as radian or degree by Radian/Degree selection flag M1760/M1920 = OFF indicates radian mode. RAD = degree Чπ /180. M1760/M1920 = ON indicates degree mode. Degree range: 0 °≦ degree < 360 ° 5. If the result = 0, zero flag will be ON. 6. Flags: 7.
The figure below offers the relation between radian and the result. R S: Radian R: Result (SIN value) 1 S -2 3 2 -2 2 3 2 2 2 - 0 - -1 Program Example 1: Radian/Degree selection flag = OFF indicates radian mode. When X0 = ON, DSIN instruction conducts sine operation on binary floating value in (D1, D0) and stores the SIN value in (D11, D10) in binary floating format.
M1002 X0 DSIN RAD value(degree x π /180) binary floating point SIN value binary floating point DVP-PM Operation Instruction 5-110 Mnemonic Operands Function Controllers 20PM 10PM D SIN P Sine Type OP Bit Devices Word Devices Program Steps X Y M S F H KnX KnY KnM KnS T C D V Z D S * * D * OX O100 ro flag M1808 M1968 adian/Degree flag M1760 M1920 RST Degree/radian flag D0 D10 D1 D0 D11 D10