1 Reply Latest reply on Jul 11, 2018 3:49 PM by rschmitz

    Not able to get the time series data in PI vision custom symbol


      Hi All,


      while doing exercise 4 and 5 I am not able to get the time series data.

      In data.Data[0] and getting and error


      "TypeError: Unable to get property '0' of undefined or null reference

         at dataupdate (http://bbmwtpics01/PIVision/Scripts/app/editor/symbols/ext/sym-TimeSeriesValue.js:37:10)

         at Scope.prototype.$digest (http://bbmwtpics01/PIVision/Scripts/angular/angular.js:18261:23)

         at Scope.prototype.$apply (http://bbmwtpics01/PIVision/Scripts/angular/angular.js:18531:13)

         at done (http://bbmwtpics01/PIVision/Scripts/angular/angular.js:12547:36)

         at completeRequest (http://bbmwtpics01/PIVision/Scripts/angular/angular.js:12785:7)

         at requestLoaded (http://bbmwtpics01/PIVision/Scripts/angular/angular.js:12702:9)"

      Please find the below screen shot:


      Could you please help me to understand where i am doing wrong ?


      Thanks and regards,

      Prasad Chaudhari

        • Re: Not able to get the time series data in PI vision custom symbol

          Hi Prasad,


          Off hand, I'm not seeing anything that looks out of the ordinary. That error you typically see if you drop the "if (!data) return" check in your code. That makes me think perhaps you had an earlier iteration of the symbol without that check which is being cached for the page and causing that error. If you close and reopen your browser or do a hard refresh on the page that drops the caches, does the issue persists?


          Before we touch on Exercise 5 any more, were you able to get exercise 4 to display data in your symbol? You question mentions both, though the error should be specific to exercise 5 since it's erroring out when you're trying to retrieve something in the array which shouldn't be an issue for exercise 4.


          Also, I see you have the log to console line commented out. If you uncomment that out, what do you see for the structure of the 'data' variable being returned to you?