jacksonb

First program reading analog input

10 posts in this topic

Hello, I want to write a program that will respond to a voltage received by the analog input (channel 1) of an Omron PLC. I am using an Omron CJ1M, CPU22 with CJ1W-AD041-V1 analog input module and the CJ1W-DA041-V1 analog output module. Using a 0-10VDC analog voltage source. My knowledge of the analog inputs and outputs is very limited eg. I believe I need to sent a MOV(021) command to copy the value of the analog input (eg CIO2001=input channel 1) to memory (eg D0). I also use MOV(021) to copy a value from memory to an analog output (eg CIO2011=output channel 1). I believe I also need send a SET command to send a '1' to 2010.00 to enable channel 1. Edit: I think I was trying to run before I know how to walk! To start with, I'd like to know how to set a contact to high if the voltage input into channel 1 is between 5V and 7V. Thank you. Edited by jacksonb

Share this post


Link to post
Share on other sites
Basically correct. You can set your high and low points in the card setup by the way.

Share this post


Link to post
Share on other sites
When you say in the card setup, is this within CX-Programmer? I'm in a learning environment so shouldn't make any changes to the hardware setup, only load and test software. Edit: Sorry BobB, I think my first question was a step or two too far for my present knowledge level. I don't actually know how I would set a contact to high if the analog input is in a given voltage range. Edited by jacksonb

Share this post


Link to post
Share on other sites
Yes, in the I/O table where you set up the card. The anaolgue card reads, say, 0-4000 - you just have to work out your levels from there. Alternatively you can scale the input - there is a good function block in the downloads are - I nromally do not bother but just work with the raw numbers.

Share this post


Link to post
Share on other sites
You set a bit high based on the value using a simple compare. If the value coming in is over a certain value which you need to decide, then turn on an output coil.

Share this post


Link to post
Share on other sites
Thank you. I guess this is a function I would use within CX-Programmer and one of the manuals would explain how to use it?

Share this post


Link to post
Share on other sites
My apologies - I am leading you astray! I am thinking about the older cards which I have been working with lately where this facility was available - it is not in the new cards. You could have a look at either of these for scaling http://forums.mrplc.com/index.php?app=downloads&showfile=523or http://forums.mrplc.com/index.php?app=downloads&showfile=996 for scaling - you could them use the compare functions > or < for your high and low alarms. A seniors moment!

Share this post


Link to post
Share on other sites
Hello, I am using an Omron CJ1M, CPU22 with CJ1W-AD041-V1 analog input module and the CJ1W-DA041-V1 analog output module. I'm trying to understand how to use the SCL(194) command. What I need to give the command is four values: Minimum scaled value in BCD Minimum unscaled value in Hex Maximum scaled value in BCD Maximum unscaled value in Hex Edit: I think I now understand it now. For the minimum values I can give #0 as I want 0V converted to 0%. For the maximum scaled value I enter #100 as I want it to be 100%. For the maximum unscaled value I set it to 0FA0 as that is the maximum analog input value (if I'm reading the manual right). I realise there are scaling function blocks that will do all this but I'm interested in learning how to use this function as it seems to involve some fundamentals that I should know. Edited by jacksonb

Share this post


Link to post
Share on other sites
Look in the download section there is a function block for scaling Banker

Share this post


Link to post
Share on other sites
Please don't open multiple topics and send PM to users on the same subject... I have merged the topics here.

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