You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old November 5th, 2021, 01:05 PM   #1
JLand
Member
United States

JLand is online now
 
Join Date: Apr 2019
Location: Madison, Wisconsin
Posts: 65
E+H Pressure Transmitter to CompactLogix via IOLink

Hi folks,

I am having a hell of a time getting an E+H PMP23 scaled correctly in a CompactLogix PLC. I have tried all sorts of data manipulation to get this dang thing working but nothing has helped. I called IFM (I have an IFM IOLink master) and they couldn't help, and I am waiting of E+H to call me back but I am not holding my breath.

The manual says the the first 30 bits (0-29) is the raw process data spread across 2 16 bit INTs, with bit 0 being the LSB. The last 2 bits of the the second INT is for something else. I have tried:

COP INT1 into a DINT BTD INT2 dest 16 len 14
BTD INT1 dest 0 len 14 BTD INT 2 dest 14 len 16

and I have also tried addressing INTs 2 and 3 as well as reversing which INTs I use (COP INT2 first instead of INT1, for example.)

When I push my finger on the sensor, only INT2 changes. INT1 is always 16383 and INT3 is 0. My guess is INT2 is the least significant process data and INT3 is the most significant process data, but I tried that and I couldnt get it to work.

IFM tells me the transmitter should be sending the actual PSI value of the sensor divided by 1000.

See my screenshots attached for a better picture of what I am working with.

When the sensor is sitting there with nothing on it, INT2 is either -250 or -220.

Here is the manual for the sensor under downloads/IOLink Operating Instructions:

https://www.endress.com/en/field-ins...duct-downloads


I am at the end of my rope, can someone help? Thanks a bunch in advance.
Attached Images
File Type: png RawData.png (8.6 KB, 24 views)
File Type: png Manual.png (62.8 KB, 20 views)
File Type: png Ex1.png (16.2 KB, 20 views)
File Type: png Ex3.png (16.3 KB, 16 views)
File Type: png Ex4.png (15.6 KB, 15 views)
  Reply With Quote
Old November 5th, 2021, 01:58 PM   #2
MikeyN
Lifetime Supporting Member
United States

MikeyN is offline
 
Join Date: Dec 2017
Location: Illinois
Posts: 157
Quote:
Originally Posted by JLand View Post
The manual says the the first 30 bits (0-29) is the raw process data spread across 2 16 bit INTs, with bit 0 being the LSB. The last 2 bits of the the second INT is for something else.
I am not familiar with E+H or the IFM IO Link, but this did catch my eye. Are you sure the manual says spread across 2 16 bit INTs?

Quote:
The device's process data are transmitted cyclically in 32-bit chunks.
Bit 0 is your LSB, bit 29 is your MSB, bit 30 is the switch output status, and bit 31 is reserved. This sounds like a single DINT to me, but I could be very mistaken.
__________________
C:\Dos
C:\Dos Run
Run Dos Run
  Reply With Quote
Old November 5th, 2021, 02:03 PM   #3
JLand
Member
United States

JLand is online now
 
Join Date: Apr 2019
Location: Madison, Wisconsin
Posts: 65
Mikey, I had a similar thought. However, the array size of the data structure is set by the IO Link master (according to the IFM support guy), and not the device. This means the device is transmitting 32 bit chunks to the master but the master is interpreting it and transmitting it in 16 bit chunks. He verified, for my master (IFM AL1123) that the IO data structure should be 16 bit INTs.
  Reply With Quote
Old November 5th, 2021, 02:09 PM   #4
Ken Moore
Lifetime Supporting Member
United States

Ken Moore is offline
 
Ken Moore's Avatar
 
Join Date: May 2004
Location: North, West, South Carolina
Posts: 3,228
Try COP Int1 to DINT length 1.
You should get both INT's in the DINT. Then strip out bits 31 and 32.
You say the value is divided by 1000, but I would think multiplied by 1000 to give 3 implied decimals. So multiply the DINT by .001 and store in a REAL.

If the value is not correct, you may have to swap Int1 and Int2.
__________________
Certified Siemens Functional Safety Professional,
ID: SFSP17010238
NRA Benefactor
  Reply With Quote
Old November 5th, 2021, 02:48 PM   #5
widelto
Member
Colombia

widelto is offline
 
widelto's Avatar
 
Join Date: Jul 2005
Location: Barranquilla, Colombia
Posts: 3,127
+++ Ken Moore
__________________
My two cents.
  Reply With Quote
Old November 5th, 2021, 02:49 PM   #6
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 4,174
16383 is 13 1s, and 1 less than 16384, i.e. bit 14 is 1, all others are 0 in a 16-bit INT, that bit 14 could also be bit 30, or the switch status, of the second INT of the pair.

Can you toggle the switch output and see what changes? If not, what is the state of the switch?

-250 is all 1s in the high byte, and -(-256-250) = 6 (0b00000110) in the low byte.

When you see -250 or -220, what is the actual pressure, and in what units, that the sensor is measuring?

When you push your finger on the sensor, do you have any idea what the pressure reading is?

I wonder if the bits are flipped?
__________________
i) Take care of the bits, and the bytes will take care of themselves.
ii) There is no software problem that cannot be solved with another layer of indirection.
iii) I solemnly swear that I am up to no good

Last edited by drbitboy; November 5th, 2021 at 03:00 PM.
  Reply With Quote
Old November 5th, 2021, 03:33 PM   #7
JLand
Member
United States

JLand is online now
 
Join Date: Apr 2019
Location: Madison, Wisconsin
Posts: 65
Update - I think I got it. The solution is to treat INT2 as PSI*1000, but you need to strip out the last bit of INT2. This bit is set when the pressure is above a setpoint in the device itself. When I originally played with INT2 I did not strip this bit out and this caused the readings to jump all over the place and look like garbage.

I think INT1 is just for status bits, and INT3 and 4 are not used for my application (they are always 0 - perhaps they have a use but not for me).

My biggest gripe here is the documentation from E+H. It is not particularly clear in what needs to be done and I would wager it may not be accurate. According to it, it looks like I should be treating INT1 bits 0-15 and INT2 bits 0-13 as my pressure reading, with INT1 bit 0 being LSB. This is not congruent with my results.

Thanks to all for the help. I sincerely appreciate it.
  Reply With Quote
Old November 5th, 2021, 03:38 PM   #8
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 4,174
There is no way Ex3.png is right.

.Data3 does not exist, so there is no way Ex4.png is right.

Assume dest is a DINT, either

BTD .Data1 0 dest 0 16 BTD .Data2 0 dest 16 16


OR

BTD .Data2 dest 0 16 BTD .Data1 dest 16 16


Then

XIC dest/29 BST OTE dest/30 NXB OTE dest/31 BND


If that does not work, byte-swap each of .Data1 and .Data2 individually and repeat.

One of those four options will work, and you will get -250 or -220 in DINT dest without a finger on the sensor.

No wait ...

BTD .Data1 0 dest 0 16 BTD .Data2 0 dest 16 16
SWPB dest REVERSE destr XIC destr/29 BST OTE destr/30 NXB OTE destr/31 BND
SWPB dest WORD destw XIC destw/29 BST OTE destw/30 NXB OTE destw/31 BND
SWPB dest HIGH/LOW desthl XIC desthl/29 BST OTE desthl/30 NXB OTE desthl/31 BND


dest, destr, destw, and desthl, are all DINTS. The one that yields -250 or -220, without a finger on the sensor, has followed the Right Path™ and should be scaled (or just [MUL dest? 1e-3 destfloat]).
__________________
i) Take care of the bits, and the bytes will take care of themselves.
ii) There is no software problem that cannot be solved with another layer of indirection.
iii) I solemnly swear that I am up to no good

Last edited by drbitboy; November 5th, 2021 at 03:53 PM. Reason: Fixed typo: SWAPB should be SWPB; added [Source bit] to BTD instructions
  Reply With Quote
Old November 5th, 2021, 03:46 PM   #9
drbitboy
Lifetime Supporting Member
United States

drbitboy is online now
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 4,174
Quote:
Originally Posted by JLand View Post
Update - I think I got it. ...

I sincerely doubt it, but you will not notice if the process never goes outside the range [-32.768PSI:+32.767PSI].
__________________
i) Take care of the bits, and the bytes will take care of themselves.
ii) There is no software problem that cannot be solved with another layer of indirection.
iii) I solemnly swear that I am up to no good
  Reply With Quote
Old January 11th, 2022, 08:33 PM   #10
GregPirch
Member
United States

GregPirch is offline
 
Join Date: Oct 2008
Location: Texas
Posts: 6
Quote:
Originally Posted by JLand View Post
Update - I think I got it. The solution is to treat INT2 as PSI*1000, but you need to strip out the last bit of INT2. This bit is set when the pressure is above a setpoint in the device itself. When I originally played with INT2 I did not strip this bit out and this caused the readings to jump all over the place and look like garbage.
JLand,
I new project just came down the pipe that has 23 of these PMP23's spec'd for the plant.

Can you please post a screen shot of your solution? it will save me a lot of grief. Thanks!!
  Reply With Quote
Old January 11th, 2022, 08:38 PM   #11
JLand
Member
United States

JLand is online now
 
Join Date: Apr 2019
Location: Madison, Wisconsin
Posts: 65
Hi Greg, I'd be happy to. Remind me tomorrow (US - central time) and I'd gladly help out.
  Reply With Quote
Old January 12th, 2022, 11:59 AM   #12
JLand
Member
United States

JLand is online now
 
Join Date: Apr 2019
Location: Madison, Wisconsin
Posts: 65
Hi Greg, attached is an example of what should work.

It isn't exactly what I have running because I am not absolutely in love with my original method of doing this. In my application it works perfectly well and I have no issues with it but I wouldn't call it best practice nor would I call it extensible. In the screenshot, please ignore that the run isn't evaluating. It is just a config issue in the module and nothing with the rung itself.

A quick explanation:

Before you begin, if you are using IFM IOL masters be sure to set IOLink_Master:C.Swap_Port_x to 0 if you are using an AB PLC. Keep it 1 if you are using a Siemens.

Generic_8PORT_IOL is a generic AOI that conveniently addresses any 8 port IFM IOLink Master (this is using IFM AL1123 - which master you are using does change this, and this guide is written with only AL1123 in mind). This AOI isn't necessary but it makes addressing the input and output data structure much easier. If you have IFM masters, please go on their website and download their startup package, and read the guides. They are helpful but don't give you everything.

The IOLink operating instruction for PMP23 can be found on the E+H PMP23 webpage. Go to page 21 for info on how to integrate the device to your PLC. DO NOT LOOK ELSEWHERE FOR THIS PDF. Certain 3rd party manual compilation websites have old versions of this PDF and this information has changed recently. On this page, you can see the first 30 bits transmitted from the PMP23 is your pressure value. Do not think of this as a mA signal, this really is just the binary representation of your actual pressure, more akin to an EIP device.

First we move the first input INT from the generic AOI into a temporary holding DINT. We then concatenate the first INT with the second INT using BTD. Lastly, we strip out the last 2 bits (these are used as a pressure switch and some reserved bit) using a masked move and feed the this tag into a scaling AOI.

As for scaling, I would keep the unit unchanged in the device. This way a maintenance guy can swap out parts without having to configure the units in the device itself using LRDevice. I can't remember what the default units are though, if I had to guess I would say bar. On page 21 of the manual you can see that to get your bar reading you multiply your raw input by 0.0001 (or divide by 10000). From there, in your PLC, convert to whatever unit you wish.

(Just as a note of philosophy, avoid changing any configurations in your IOLink master beyond IP settings. Keep the IOLink master in dependent mode and configure from the PLC's :C data array. This keeps the hardware hot-swappable.)

I can't say with absolute certainty that this method is perfect but it should get you 95% of the way there.
Attached Images
File Type: png PMP23 IOL EX.png (25.1 KB, 51 views)
  Reply With Quote
Old January 12th, 2022, 03:07 PM   #13
GregPirch
Member
United States

GregPirch is offline
 
Join Date: Oct 2008
Location: Texas
Posts: 6
Quote:
Originally Posted by JLand View Post
Before you begin, if you are using IFM IOL masters be sure to set IOLink_Master:C.Swap_Port_x to 0 if you are using an AB PLC. Keep it 1 if you are using a Siemens.
JLand,
Thank you for this detailed explanation.

Some questions:
1) I have scoured IFM's Startup Package docs and find no reference to Swap_Port_x configuration parameter. How did you determine to set this to 0 when connected to an AB PLC?
I've been using IFM master modules for 3 years with various IO-Link devices (using both the IFM specific device AOIs and also the Generic AOI) and have not changed the value of the Swap_Port_x (which is set to 1 by default).

2) Specific to your code for the PMP23 I see your using both In_Data1 and In_Data2. It also appears that you’re stripping more than just the last two bits of PT_TEMP in your MVM instruction (or am I reading this wrong?).

Also, how would you handle negative pressure values (or is the default Bar unit in absolute pressure then just scale accordingly for gauge pressure?)?

Yes, I agree with your philosophy of doing all configuration changes in the PLC. Besides ... IMO the LRDevice app is a bit kludgy.

Anyway ... thanks a million for your time.
  Reply With Quote
Old January 12th, 2022, 03:24 PM   #14
JLand
Member
United States

JLand is online now
 
Join Date: Apr 2019
Location: Madison, Wisconsin
Posts: 65
Quote:
Originally Posted by GregPirch View Post
JLand,
Thank you for this detailed explanation.

Some questions:
1) I have scoured IFM's Startup Package docs and find no reference to Swap_Port_x configuration parameter. How did you determine to set this to 0 when connected to an AB PLC?
I've been using IFM master modules for 3 years with various IO-Link devices (using both the IFM specific device AOIs and also the Generic AOI) and have not changed the value of the Swap_Port_x (which is set to 1 by default).

2) Specific to your code for the PMP23 I see your using both In_Data1 and In_Data2. It also appears that you’re stripping more than just the last two bits of PT_TEMP in your MVM instruction (or am I reading this wrong?).

Also, how would you handle negative pressure values (or is the default Bar unit in absolute pressure then just scale accordingly for gauge pressure?)?

Yes, I agree with your philosophy of doing all configuration changes in the PLC. Besides ... IMO the LRDevice app is a bit kludgy.

Anyway ... thanks a million for your time.
Both fair questions

1) IFM infuriatingly doesn't reference the Swap_Port_x anywhere in their manuals. I have no idea why. This took a call to their tech support team to figure out.

2) Good catch. This is a mistake that I fixed but forgot to update the screenshot. All but the last 2 bits should be 1s.

As for negative gauge pressure, I am not sure. Perhaps bit 29 is a sign? All my applications of IOLink pressure has been positive gauge pressure.
  Reply With Quote
Old January 12th, 2022, 04:11 PM   #15
mylespetro
Supporting Member
Canada

mylespetro is offline
 
mylespetro's Avatar
 
Join Date: Dec 2015
Location: NS
Posts: 516
Seeing all of this makes me thankful for a simple 2-wire transmitter
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Pressure Transmitter ( Air pressure transmitter and Lpg pressure transmitter valu Ex) Hayat Ali LIVE PLC Questions And Answers 8 June 19th, 2020 12:50 AM
Creating a setpoint for a pressure transmitter in studio 5000. tgonz11 LIVE PLC Questions And Answers 4 April 9th, 2020 04:28 AM
Looking for a high temperature rated pressure transmitter RonJohn LIVE PLC Questions And Answers 7 December 27th, 2016 11:37 AM
Someone just had to ask. Peter Nachtwey LIVE PLC Questions And Answers 213 November 17th, 2008 08:36 PM
Pressure-Position Orn Jonsson LIVE PLC Questions And Answers 5 July 9th, 2002 05:44 PM


All times are GMT -4. The time now is 03:28 PM.


.