Omatic

How to read analog expansion inputs

9 posts in this topic

Hi,

Can someone help me configure a PLC so I can read the info on the analog expansion unit? I'm new at this and any or all input is appreciated. Below is a hardware list of what I am currently using. 

Omron CP1L-L14DR-A

Omron CP1W-AD041

Sensor  With Voltage Output Range From 0.4V - 2.0V

What I'm trying to accomplish. When the sensor voltage hits a certain value for a certain period of time I want to activate certain outputs on the main PLC.

Thank you,

Share this post


Link to post
Share on other sites

The L14 only uses one input word (word 0) for the CPU digital inputs, so your AD041 module will use words 1-4 for the four input channels. You will want to set the input channel that you use up for 0-5vdc. The value of the input will range from 0 to 6000 for 0 to 5 volts. Your 0.4 to 2 volt signal will range from 480 to 2400.

Edited by Mendon Systems

Share this post


Link to post
Share on other sites

Thanks for the info, but how and where do I input this information? Pardon the ignorance but my knowledge and vocabulary on this is not that vast. The hardware I mostly use have standard inputs and relay outputs. From a programming perspective I've only used timers, counters, keep, DIFU, and DIFD. Your help and knowledge is appreciated.

Thanks,

Share this post


Link to post
Share on other sites

I suggest that you use something like the AVG (average) instruction to read the input data into a DM register. For example: If you are using input 1 and you want to average 64 samples into DM100 then the instruction would be AVG 1 &64 D100. You can then compare the value in the DM register to the value you want to use as a setpoint. Note that the AVG instruction uses a buffer so this would use up DM100 through DM165 for data.

If your setpoint was 1.000 volts then you can use something like an unsigned binary compare >= D100 &1200  to compare the averaged value to the setpoint and trigger your time delay. Even averaging 64 samples isn't a very long time if your program scan is around the typical 3 ms for a CP1L but with the time delay as a filter you should be ok.

Share this post


Link to post
Share on other sites

Again, pardon the ignorance and not asking you to do my homework for me but can you show me some illustrations as to where i need to input this info / commands? I'm not familiar with this at all.

Thank you,

Share this post


Link to post
Share on other sites
Quote

For example: If you are using input 1 and you want to average 64 samples into DM100 then the instruction would be AVG 1 &64 D100. You can then compare the value in the DM register to the value you want to use as a setpoint. Note that the AVG instruction uses a buffer so this would use up DM100 through DM165 for data.

This is your example.

1 person likes this

Share this post


Link to post
Share on other sites

I'm sorry guys, I'm having no luck with this. My knowledge with this stuff is basic I/O. I'm not even sure I'm initializing the AD041 correctly. Where in CX do I input this info so it will read 0 to 5V? Can someone explain to me the simplest way to read this sensor info in the software? I'm only using one of the VIN. Your help and patience is appreciated.

 

Capture1.JPG

Share this post


Link to post
Share on other sites

n (in your table above) is the last output word of the CPU.  The L14 CPU has only one output word and it is addressed at CIO 100.  Therefore, n+1 = 101 and n+2 =102.  When you see m+1, m+2, m+3 and m+4 in the input table, that would be channels 1, 2, 3 and 4 as m is the last input channel on the CPU (only one input channel and it is 0).  

Therefore, to configure your input as 0-5V, assuming that you are using input 1, you would need to put the binary code into the three bits for that input.  So, in channel 101 on the first scan, you would need to move a binary pattern of 1000000000001011 and a binary pattern of 1000000000000000 into channel 102.

This would be a hex pattern of #800B and #8000 respectively and the ladder would look like this:

5966b6244d00f_analogsetup.thumb.jpg.411d

Bit 15 (leftmost bit in the binary patterns above) simply must be turned on.  That is why you need to write the #8000 into 102.  This catches many people.  The 4 rightmost bits of 101 which setup Analog input 1, are 1011 which is detailed in your set data picture in the post above.  From left to right, the 1 means use the input, the 0 means don't average (you can turn this on if you would like), the 11 means 0-5V.  

If you put this code in and turn power off and then on, it should work.  You will then find you converted analog value in channel m+1, or channel 1.

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