omron cp1e read analog

Previous post where I have talked about the APR function & given an example:
http://www.plctalk.net/qanda/showthread.php?t=41135
For a simple linear scale or conversion here are two examples for the CP1E.

The analogue input (ch90 & ch91) is converted into a value of 0-6000 inside the PLC this is a signed integer value which could also be treated as unsigned if we never go below zero. Actual entire data range is -300 to +6300.

This count of 0-6000 needs to be scaled to a value of 0-200.0, for the purposes of this example we will scale to 0-2000.

If we work with signed integer data (INT) for analogue input 1 your setup should be as follows:

DM100 = #0800 (Control word)
DM101 = +0 (minimum value of converted input from sensor to PLC)
DM102 = +0 (minimum scaled value)
DM103 = +6000 (maximum value of converted input from sensor to PLC)
DM104 = +2000 (maximum scaled value)

In the attached program example the converted data is in DM150, I have also used the sensor disconnected detection bit to turn on/off the APR conversion. This could also be used to set a fixed value to the converted word if a sensor fault occurs.

If we work with unsigned integer data (UINT) for analogue input 2 your setup should be as follows:

DM110 = #0000 (Control word)
DM111 = &6000 (maximum value of converted input from sensor to PLC)
DM112 = &0 (minimum scaled value)
DM113 = &6000 (maximum value of converted input from sensor to PLC)
DM114 = &2000 (maximum scaled value)

NOTE: With unsigned data conversion the x0 value must be set to the xMax value - the PLC assumes x0 = 0
This is why I prefer to work with signed data where possible (or floating point).

The sensor disconnected detection bit for input 2 is also used here to turn on/off the APR conversion.

Have a look at the attached program - I have made two sections one for signed values and one for unsigned values. Hopefully this should be self-explanatory.
You should be able to cut & paste into your program.

View attachment APR Program CP1E.zip

Merry Christmas
🍻
 

Similar Topics

Hello. I have a problem with omron sysmac cp1e controller delayed start. The controller has been working on the punch press since 2016. Recently...
Replies
1
Views
765
Hi, I need to communicate omron CP1E PLC with SCADA to get the status of the machine. There is no etherent port available but an empty expansion...
Replies
2
Views
1,611
Hello... I remove one CP1E from old useless machine and I would like to use it with something else....but it is locked/have no pass/....How can I...
Replies
0
Views
1,448
hi all i have used a real time clock to turn on a bit after 1 month. the plc was off for this whole month and when i turned on the plc after a...
Replies
2
Views
1,425
We had a CP1E go bad (power issue). Installed spare and could not get it to communicate to our motion drive via add on RS485 card. Tried...
Replies
5
Views
1,503
Back
Top Bottom