Sign in to follow this  
Followers 0
Joelylin

scaling for CJ1W-AD08-V1

6 posts in this topic

There are a few questions , I would like to ask 1. How to do scaling for -10V to +10 V signal. I saw some posts on the FB with parameters. I could not look at the FB because it is locked. I have the idea on the scaling for 0-5 V and 4-20mA , by using y=mx+c equation in the ST FB. For +- 10V, how can I do? 2. How can I save the data , every 2ms,16 data from analog input. I have tried with shift register, every 2 ms, 16 data is saved in the DM area. But these data are kept changing, even before I can do averaging. What I want to do is, 2ms - store the data - take the average and store the average at DM area. I'm thinking if i can use interrupt task and then IORF instruction to refresh for new data. But how do I use it? I would appreciate if I could get any guideline in print screen. Thanks

Share this post


Link to post
Share on other sites
Scaling is relatively easy, the most common setup for your module is that the minimum value is +0, the maximum value is +4000. So if -10:+10, then a value of +0 = -10v, & +4000 = +10v. Why do you want an immediate refresh, do you have a long scan time? I am not sure if the IORF can be used in an interupt, I have had an issue before with an instruction, but cannot recall exactly which one.

Share this post


Link to post
Share on other sites
fyp2.cxpfyp2.cxpfyp2.cxpHi .. Thanks for your reply. My scaling is ok now. I'm facing another problem. pls see the "store data" section. I'm using TMHH to read the 2ms interval for each data for the set of 15 datas. I did one pulse up w11.00, to read 15 data from AD unit. I use these 15 data to calculate the time in the formula vsinwt, time differences between each data is 15ms. How can i improve to read 2ms sampling interval. 500 hz sampling rate. Edited by Joelylin

Share this post


Link to post
Share on other sites
Put your program in the timed interrupt task and set scheduled interrupt interval in PLC Settings for 2 mSec. This will ensure your averaging task is always evaluated every 2mSec. and is independent of normal Cyclic programs.

Share this post


Link to post
Share on other sites
I treid as you suggested in the program. but it does not work. Maybe it is not the right way. Pls see the attach file. What I want to do is, data from 2001 will move to the DM900 to DM915. 2ms delay difference in DM900 and DM901 data. Pls help me with the screen shot so that I can visualise. thanks for your help Plc.doc

Share this post


Link to post
Share on other sites
Hi all I have tried the method on the document. But it seems program is not working. Pls advise me what is wrong interrupttime.doc Edited by Joelylin

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
Sign in to follow this  
Followers 0