salah9719

PLC_omron_cx_programmer

5 posts in this topic

hello everyone,

i need your help for scaling an analog input laser (4-20MA) (0m-75m) (O1D106)  for the calcul of position 

i want to use this Block function : (Rate:=(Scaled_max-Scaled_min)/(input_max-input_min);
output:=(input-input_min)*Rate+Scaled_min); that i have created, could you pls tell me if this will work as required?

PLC: CJ2M

thank you in advance 

Share this post


Link to post
Share on other sites
18 hours ago, salah9719 said:

hello everyone,

i need your help for scaling an analog input laser (4-20MA) (0m-75m) (O1D106)  for the calcul of position 

i want to use this Block function : (Rate:=(Scaled_max-Scaled_min)/(input_max-input_min);
output:=(input-input_min)*Rate+Scaled_min); that i have created, could you pls tell me if this will work as required?

PLC: CJ2M

thank you in advance 

Hello @salah9719

 

I have attached the screenshot of the Function Block. (So you can figure out what are the input tags and output tags for this function block)

Here is the logic of that block.

 

SCALED_OP:= (((SCAL_MAX-SCAL_MIN)*(INT_TO_REAL(AI_RAW)-INT_TO_REAL(RAW_MIN)))/(INT_TO_REAL(RAW_MAX)-INT_TO_REAL(RAW_MIN)))+SCAL_MIN;
SCALED_OP_INT:= REAL_TO_INT(SCALED_OP);

 

Hope this helps.

FB.JPG

Share this post


Link to post
Share on other sites
2 hours ago, SillyBoy said:

Hello @salah9719

 

I have attached the screenshot of the Function Block. (So you can figure out what are the input tags and output tags for this function block)

Here is the logic of that block.

 

SCALED_OP:= (((SCAL_MAX-SCAL_MIN)*(INT_TO_REAL(AI_RAW)-INT_TO_REAL(RAW_MIN)))/(INT_TO_REAL(RAW_MAX)-INT_TO_REAL(RAW_MIN)))+SCAL_MIN;
SCALED_OP_INT:= REAL_TO_INT(SCALED_OP);

 

Hope this helps.

FB.JPG

thank you SillyBoy ^^, could you please tell me where can i find the Raw-in and Raw-max? it's not (0m-70m) right? is it the resolution ADC of my Analog module ?

it must be these  <mini.>-32768 <maxi.>32767? but it's based on how much bits ? 

ANA_card.PNG

Share this post


Link to post
Share on other sites

According to the full-scale resolution of the module, you will get the AI_RAW in a channel-specific address.

 

(if the module resolution 1:1000) you will get 0 for 4mA and 1000 for 20mA in the appropriate CIO Address.

(if the module resolution 1:4000) you will get 0 for 4mA and 4000 for 20mA in the appropriate CIO Address.

(if the module resolution 1:8000) you will get 0 for 4mA and 8000 for 20mA in the appropriate CIO Address.

 

RAW MIN = 0

RAW MAX = (1000/4000/8000 according to module resolution)

 

AI RAW = Your channel address (for your case I guess somewhere between CIO2001 to CIO2100) (You can check by monitoring the CIO area after sourcing any channel to find exact address because I am not very much familiar with Omron Addressing)

 

if you want to scale the analog input in 0 to 25000.

SCAL MIN = 0

SCAL MAX=25000/

Share this post


Link to post
Share on other sites
On 07/09/2021 at 11:04 AM, SillyBoy said:

According to the full-scale resolution of the module, you will get the AI_RAW in a channel-specific address.

 

(if the module resolution 1:1000) you will get 0 for 4mA and 1000 for 20mA in the appropriate CIO Address.

(if the module resolution 1:4000) you will get 0 for 4mA and 4000 for 20mA in the appropriate CIO Address.

(if the module resolution 1:8000) you will get 0 for 4mA and 8000 for 20mA in the appropriate CIO Address.

 

RAW MIN = 0

RAW MAX = (1000/4000/8000 according to module resolution)

 

AI RAW = Your channel address (for your case I guess somewhere between CIO2001 to CIO2100) (You can check by monitoring the CIO area after sourcing any channel to find exact address because I am not very much familiar with Omron Addressing)

 

if you want to scale the analog input in 0 to 25000.

SCAL MIN = 0

SCAL MAX=25000/

thank you so much sir for your help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now