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.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


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

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old August 10th, 2018, 02:08 AM   #1
Mihir_007
Member
India

Mihir_007 is offline
 
Mihir_007's Avatar
 
Join Date: Apr 2014
Location: ahmedabad
Posts: 58
-1.QNaN with compactlogix controller

Hi there,

I am fetching some data(basically energy consumption-kWh) from Schneider make power monitor EM7230 over a modbus with CIP generic message instruction from integer to Real data type with COP. Voltage/PF/Current shows good values so far. But the energy consumption reading is showing -1.QNAN. I have read about this QNAN saying it is not a number or invalid number or the number is devided by 0 or kind off....

Can anybody share, how to resolve the same? As I am just copying the data from device to device, and there is no compution in logix regarding this fetch.
  Reply With Quote
Old August 10th, 2018, 04:06 AM   #2
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,401
Quote:
Originally Posted by Mihir_007 View Post
Hi there,

I am fetching some data(basically energy consumption-kWh) from Schneider make power monitor EM7230 over a modbus with CIP generic message instruction from integer to Real data type with COP. Voltage/PF/Current shows good values so far. But the energy consumption reading is showing -1.QNAN. I have read about this QNAN saying it is not a number or invalid number or the number is devided by 0 or kind off....

Can anybody share, how to resolve the same? As I am just copying the data from device to device, and there is no compution in logix regarding this fetch.

You cannot use COP to convert Integers to Real data-types.


I do not know the power monitor you are using, but would hazard a guess that the V/PF/A figures are Real values being passed in integer data, so using COP to restore a valid real would be possible.


However the "energy consumption" value, since it is a value that could feasibly exceed the constraints of a single integer, may be being passed as a LONG integer, and you may have to devise a way to get it into a REAL.


You need to double-check the data sheets of the power monitor....
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old August 10th, 2018, 11:47 PM   #3
Mihir_007
Member
India

Mihir_007 is offline
 
Mihir_007's Avatar
 
Join Date: Apr 2014
Location: ahmedabad
Posts: 58
Smile

Quote:
Originally Posted by daba View Post
You cannot use COP to convert Integers to Real data-types.


I do not know the power monitor you are using, but would hazard a guess that the V/PF/A figures are Real values being passed in integer data, so using COP to restore a valid real would be possible.


However the "energy consumption" value, since it is a value that could feasibly exceed the constraints of a single integer, may be being passed as a LONG integer, and you may have to devise a way to get it into a REAL.


You need to double-check the data sheets of the power monitor....

Hi Daba,

Thanks for the response.

I understand what your are saying. Let me explain you in a brief what exactly i am doing..

1. I am fetching a data using CIP Generic MSG with source Length 8 .Both Source and destination tags are INT. Let us say destination tag is "X"
2. Now copying the array of X, into INT tag let us say "Y".
3. Now using COP, Source data as Y(which is INT), and destination data as Z(Which is Real) with length 2, I am getting the desired value in data tag Z.

Hope you understand.
  Reply With Quote
Old August 11th, 2018, 09:31 AM   #4
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 6,253
You may need to swap the two INTs before copying to the REAL.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old August 12th, 2018, 08:01 AM   #5
AustralIan
Member
United Kingdom

AustralIan is offline
 
Join Date: Jan 2013
Location: UK
Posts: 790
I think the energy registers are actually 5 INT values.
First int is 10^n
Second int is 10^n+3
Third is 10^n+6
And so on

You can set n somewhere on the meter.
  Reply With Quote
Old August 13th, 2018, 11:00 AM   #6
Mihir_007
Member
India

Mihir_007 is offline
 
Mihir_007's Avatar
 
Join Date: Apr 2014
Location: ahmedabad
Posts: 58
Unhappy

Quote:
Originally Posted by bernie_carlton View Post
You may need to swap the two INTs before copying to the REAL.
And How to do that?
  Reply With Quote
Old August 13th, 2018, 11:02 AM   #7
Mihir_007
Member
India

Mihir_007 is offline
 
Mihir_007's Avatar
 
Join Date: Apr 2014
Location: ahmedabad
Posts: 58
Quote:
Originally Posted by AustralIan View Post
I think the energy registers are actually 5 INT values.
First int is 10^n
Second int is 10^n+3
Third is 10^n+6
And so on

You can set n somewhere on the meter.
Nooo...

Address registers are fixed.
Like....
#126 is for kWh
#128 is KVAH

and for rest of the meters it working in the same way....
  Reply With Quote
Old August 13th, 2018, 11:16 AM   #8
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 6,253
Swapping integers - let's say you received the two integers into MyInteger[0] and MyInteger [1] Now in two instructions copy MyInteger[0] to MyInteger[3] then copy MyInteger[1] to MyInteger[2]. Now they are in the opposite order within an array. Of course you can copy to any array you wish. Then, using this example, copy MyInteger[2] to MyReal - with a length of 1.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old August 13th, 2018, 12:55 PM   #9
Mihir_007
Member
India

Mihir_007 is offline
 
Mihir_007's Avatar
 
Join Date: Apr 2014
Location: ahmedabad
Posts: 58
Quote:
Originally Posted by bernie_carlton View Post
Swapping integers - let's say you received the two integers into MyInteger[0] and MyInteger [1] Now in two instructions copy MyInteger[0] to MyInteger[3] then copy MyInteger[1] to MyInteger[2]. Now they are in the opposite order within an array. Of course you can copy to any array you wish. Then, using this example, copy MyInteger[2] to MyReal - with a length of 1.
Hi,

Tried same. It shows 0.

  Reply With Quote
Old August 13th, 2018, 03:55 PM   #10
Helliana
Member
United States

Helliana is offline
 
Join Date: Nov 2011
Location: Arkansas
Posts: 606
Quote:
Originally Posted by Mihir_007 View Post
And How to do that?

SWPB instruction in Logix5000 will swap them for you.
  Reply With Quote
Old August 14th, 2018, 12:20 AM   #11
kamenges
Member
United States

kamenges is offline
 
kamenges's Avatar
 
Join Date: Nov 2002
Location: Brillion, WI
Posts: 3,661
Are you sure energy consumption is supposed to be a REAL value? Is is possible it is a DINT?

Keith
  Reply With Quote
Old August 16th, 2018, 11:11 AM   #12
Mihir_007
Member
India

Mihir_007 is offline
 
Mihir_007's Avatar
 
Join Date: Apr 2014
Location: ahmedabad
Posts: 58
Quote:
Originally Posted by Helliana View Post
SWPB instruction in Logix5000 will swap them for you.
Thanks. But it is not working....
  Reply With Quote
Old August 16th, 2018, 11:13 AM   #13
Mihir_007
Member
India

Mihir_007 is offline
 
Mihir_007's Avatar
 
Join Date: Apr 2014
Location: ahmedabad
Posts: 58
Quote:
Originally Posted by kamenges View Post
Are you sure energy consumption is supposed to be a REAL value? Is is possible it is a DINT?

Keith
It must be real...
Because, same setup is working ok with other energy meters.

Rdds,
Mihir
  Reply With Quote
Old August 16th, 2018, 02:45 PM   #14
AustralIan
Member
United Kingdom

AustralIan is offline
 
Join Date: Jan 2013
Location: UK
Posts: 790
Post the contents of the sints before you copy it to a real.

Also, What value does the meter say it should be when you use its keypad and screen?

Are you sure this is the same energy meter as the others and not an updated model as the old one is obsolete?
  Reply With Quote
Old August 17th, 2018, 03:52 AM   #15
BryanG
Member
United Kingdom

BryanG is offline
 
Join Date: Feb 2005
Location: Manchester
Posts: 1,291
This link shows that accumulated energy is stored in 64 bit registers, if you are reading 3204 and onward. Sorry about the complex link, I couldn't get to it without going through Google:
https://www.google.com/url?sa=t&rct=...48lofQBlASDntU
Different meters store the same data in different formats, so you can't directly compare one with another.
__________________
Knowledge is power, share the knowledge.
  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
Communication problem between panelview 800 to compactlogix l2 controller erivinoth LIVE PLC Questions And Answers 6 July 13th, 2017 02:21 PM
Flashing the firmware on CompactLogix 5370 controller technolog LIVE PLC Questions And Answers 9 October 22nd, 2015 06:03 PM
CompactLogix Controller Tags LMBrian LIVE PLC Questions And Answers 6 November 15th, 2013 12:48 PM
Temperature controller interfacing with a CompactLogix RonJohn LIVE PLC Questions And Answers 12 September 24th, 2013 09:54 AM
L32E CompactLogix Controller runx999 LIVE PLC Questions And Answers 4 April 14th, 2006 04:28 PM


All times are GMT -5. The time now is 09:07 AM.


.