Pages

Sunday, August 7, 2022

Coordinate Conversion & Averaging Instruction in Idec PLC

 Hello Everyone,

7-AUG-2022

Welcome to Channel "Geek Nepal."

Average and Conversion Conversion


Today, I will be working on co-ordinate conversion instructions.

Coordinate Conversion Instructions are used to convert one data point to another value 

using a linear relationship between x and y value data points.


XYFS instruction is used for setting the format of x and y values. 

CVXTY instruction is used to convert the x value to the corresponding y value. 

CVYTX instruction is used to convert the y value to the corresponding x value. 




Let's begin by implementing the XY Format Set (XYFS) instruction.

Integer and word are the valid data types while using XYFS instruction. 

when the input, output, and memory internal relay are used, 16 points are used. 

While Timer, Counter, and Data Register are used, 1 point is used. 

The current value of time and count TC and CC are displayed when using a word. 

It cannot be used in interrupt programs. 

S1 is a source one, The function of the S1 is format number.

It should be a constant value ranging from 0 to 7. The maximum number of formats would be 8.

x and y values can go up to 32 points. x0 to x32 or y0 to y32. 

n would be 0...31

The x value of a word or integer ranges from 0 to 65,535

The y value of integer ranges from -32, 768-32,767




When the input is on, In the example, when the device is in operation mode, 

The format for xy conversion is a set that defines the linear relationship between X and Y.

Once the format is set, one can convert from x to y and y to x. 

In the example, I have used 3 set points. 


On to the next instruction CVXTY, when the input is on, the value in Data register D001 (that is source 2 ) is converted to Data register D0002( that is destination register D1) 


Don't get confused with Data Register and destination register. 




We will also be looking into (AVRG) Average instruction. 

It is mainly used for averaging analog signals (temperature, speed that varies), which are increasing or decreasing. 

S1 is a source 1 that could be any sampling data from I, Q, M, R, T, C, D 

S2 is a source 2 that could be sampling end input I, Q, M, R

S3 is scan times (sampling cycles)  I, Q, M, R, T, C, and D that could range from 0- 65,535


D1 is a Destination 1, device address to store data. The data will be stored in the data register. 

D2 is a destination 2, sampling completion output Q, M 


If timer and counter are to be used, use S1 and S3 only. CT or CC will be displayed. 

If float data is used, use S1 and D1 only.

When the input is on, the average instruction gets executed. 

based on the scan time value of s3, the value of s1 is processed in each cycle. 

if s3 = 0 then the average instruction turns on/off based on input. 

https://www.youtube.com/watch?v=O2PRvCNU4wI

No comments:

Post a Comment