属性値の限界値超過、ASF SDKでの異常判別について

PI-DA、PI-AFの属性値に設定可能な数値の限界値、またそれらのAF SDKでの参照、変更についてお聞きしたいことがございます。

 

まず、型をInt32に定義したタグAを作成し、そのタグを参照するよう属性A[rpm]を設定しました。

 

公式のリファレンスによるとInt32の範囲は、Int32:-2,147,483,648~2,147,483,647とあり、

 

その下限値(-2,147,483,648)をPI System Explorerにて属性Aに設定したところ、エラー発生しRange Overとなりました。

 

(普通のInt32であれば、0x80000000が下限であるが、0x80008000が下限である様子(0x80008001以下が格納できずにRange Overになる))

 

上記の事象が起こる理由が分からないのですが、属性の型や単位など、要因があるのでしょうか。

 

また現状、属性値の参照、属性値への設定をアプリからAF SDKにて行っており、上記現象の回避方法として、Element、EventFrameのIsGoodを使用して判定し、エラーとしているのですが、この対処方法は適切なのでしょうか。

 

AF SDKによるもっと別の評価方法があればご教示いただけないでしょうか。
  • QUESTION From Google Translate

    I would like to ask you about the numerical limits that can be set for the attribute values of PI-DA and PI-AF, and the references and changes in those AF SDKs.

     

    First, I created a tag A with the type defined in Int32, and set the attribute A [rpm] to refer to that tag.

     

    According to the official reference, the range of Int32 is Int32: -2,147,483,648 to 2,147,483,647, and when

     

    the lower limit (-2,147,483,648) was set to attribute A in PI System Explorer, an error occurred and Range Over occurred.

     

    (In the case of ordinary Int32, 0x80000000 is the lower limit, but 0x80008000 seems to be the lower limit (0x80008001 or less cannot be stored and it becomes Range Over))

     

    I do not know the reason why the above event occurs, but the attribute Is there a factor such as type or unit?

     

    Also, at present, the attribute value is referenced and the attribute value is set from the application using the AF SDK, and as a workaround for the above phenomenon, it is judged using IsGood of Element and EventFrame, and an error occurs. Is this workaround appropriate?

     

    Would you please tell me if there is another evaluation method by AF SDK?

     

    There are different pieces at play.  PI System Explorer will use the industry limits of Int32 but that would be for things that are NOT PIPoints.  For a PIPoint, the limit is:

     

    PI Server PointType

    Integer values between -2147450880 and 2147483647 (32-bit signed integers). The PI System reserves the lowest 32,767 values of the 32-bit range for digital states

    .

    Besides the LiveLibrary link above, you may also see this in the PI System Management Guide.  Look for a heading of PointType.

     

    But let me address something else ... you have a UOM of rpm.  Maybe your field sensor is sending an Int32 value to represent rpm, and its fine that your PIPoint would be defined as an Int32, assuming that you understand the lower limit exception.  However, I would suggest that your AFAttribute should be defined either as a Single or Double, and if you expect really huge values on either extreme, it should definitely be a Double. It is perfectly okay for your source PIPoint to be an Int32, while having the AFAttribute referencing it be a Double.

     

    Why?  If you plan on UOM conversions, such conversions would coerce to the type of the AFAttribute.  If the attribute is defined as an Int32, then any converted value will also be an Int32, which for some conversions may not be desirable to omit the decimal places.  By defining the attribute to be a floating point such as Double or Single, then conversions can have better precision.  If the range of your sensor was something like -500_000 to 500_000, then a Single may suffice.  But if you expect to push the extremes of a 32 bit value, I would urge you to define the attribute as a 64 bit Double.

     

     

    Google翻訳からの回答

    さまざまな作品が演奏されています。 PI System ExplorerはInt32の業界制限を使用しますが、それはPIPointではないものに適用されます。 PIPointの場合、制限は次のとおりです。

     

    PIサーバーPointType

    -2147450880から2147483647までの整数値(32ビット符号付き整数)。 PIシステムは、デジタル状態用に32ビット範囲の最低32,767値を予約します

     

    上記のLiveLibraryリンクに加えて、PI System ManagementGuideでもこれを確認できます。 PointTypeの見出しを探します。

     

    しかし、他のことを取り上げさせてください...あなたはrpmの単位を持っています。おそらく、フィールドセンサーがrpmを表すInt32値を送信しており、下限の例外を理解していると仮定すると、PIPointがInt32として定義されることは問題ありません。ただし、AFAttributeはSingleまたはDoubleとして定義することをお勧めします。どちらかの極端な値が非常に大きいと予想される場合は、間違いなくDoubleにする必要があります。ソースPIPointがInt32であり、それを参照するAFAttributeがDoubleであっても、まったく問題ありません。

     

    どうして? UOM変換を計画している場合、そのような変換はAFAttributeのタイプに強制変換されます。属性がInt32として定義されている場合、変換された値もInt32になります。これは、一部の変換では、小数点以下の桁数を省略することが望ましくない場合があります。属性をDoubleやSingleなどの浮動小数点として定義することにより、変換の精度を高めることができます。センサーの範囲が-500_000から500_000のようなものである場合は、シングルで十分な場合があります。ただし、32ビット値の極値をプッシュする場合は、属性を64ビットのDoubleとして定義することをお勧めします。

  • Toshimitsu Tsuyoshi

    ご投稿ありがとうございます。

     

    Rickからの返信の通り、PI Data Archive側の制約により格納できない値があります。

    今回のご要望であれば精度を優先し、Double、Float64での定義が良いかと思います。

     

    Event FramesのIsGood関数を使用して判断しているとの事でしたが、こちらは値が登録された事を確認するという事でしょうか?

    (登録に失敗するとPI Pointの値にシステムステータスが入り、それをIsGood関数で検知?)

     

    使い方としては問題ありませんが、点数が多いと多数のEvent Frameが作成される事となりますので、

    定期的に不要なEvent Frameは削除していただければと思います。