Shell_Casing

function snippet

Dec 25th, 2018
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async function getValuesThenPlotChartsAndTabulateData() {
  2.  
  3.     let queryUrl = generateQueryUrl();
  4.     console.log(queryUrl);
  5.  
  6.     const options = { headers: { 'Authorization': `Bearer ${ API.access_token }` } };
  7.     let response = await fetch(queryUrl, options);
  8.  
  9.     let historianData = await response.json();
  10.     let timeStampsAndValues = historianData['Data'][0].Samples;
  11.  
  12.     // display error message in case of Historian Error code 7: "Service call to central buffer server fail."
  13.     if (historianData['Data'] === undefined) {
  14.         errorMessage.style.display = 'block';
  15.     }
  16.  
  17.     let timeStampsAndValues2 = historianData['Data'][1].Samples || [];
  18.     let timeStampsAndValues3 = historianData['Data'][2].Samples || [];
  19.     let timeStampsAndValues4 = historianData['Data'][3].Samples || [];
  20.  
  21.     console.log(timeStampsAndValues);
Add Comment
Please, Sign In to add comment