<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to STRING-Arrays as data-points in a graph</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/805e4f0589/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Visualization/thread/805e4f0589/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Visualization/thread/805e4f0589/</id><updated>2021-03-16T18:21:58.363000Z</updated><subtitle>Recent posts to STRING-Arrays as data-points in a graph</subtitle><entry><title>STRING-Arrays as data-points in a graph</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/805e4f0589/?limit=25#c30c" rel="alternate"/><published>2021-03-16T18:21:58.363000Z</published><updated>2021-03-16T18:21:58.363000Z</updated><author><name>tvm</name><uri>https://forge.codesys.com/u/tvm/</uri></author><id>https://forge.codesys.com0ba9d642bfa2b6a2f809aab157231fba2f5e7b39</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm doing this by creating a separate X axis array in the visualization that's nothing more than an array of numbers counting up&lt;/p&gt;
&lt;p&gt;within the visu that's displaying the XY Chart:&lt;br/&gt;
VAR&lt;br/&gt;
    XAxisData:      ARRAY&lt;span&gt;[1..1440]&lt;/span&gt; OF REAL:= INIT_XAXIS();&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;where the INIT_XAXIS function is simply:&lt;br/&gt;
FOR i:= 1 TO 1440 DO&lt;br/&gt;
//initialize X Axis: 1 to 1440&lt;br/&gt;
    INIT_XAXIS&lt;span&gt;[i]&lt;/span&gt;:= INT_TO_REAL(i);&lt;br/&gt;
END_FOR&lt;/p&gt;
&lt;p&gt;then I hide all the X axis numbers, ruler, ets, and create the timestamps manually using text fields and some functions to get the correct timestamp from the array&lt;/p&gt;
&lt;p&gt;FUNCTION TIMESTAMP : DT&lt;br/&gt;
VAR_INPUT&lt;br/&gt;
    Index:          REAL;   //percent of full scale&lt;br/&gt;
END_VAR&lt;br/&gt;
VAR&lt;br/&gt;
    timestampindex: UINT; &lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;timestampindex:= TO_UINT(((XAxisControl.rMax - XAxisControl.rMin) * (Index/100)) + XAxisControl.rMin);&lt;br/&gt;
timestampindex:= MAX(timestampindex, 1);&lt;br/&gt;
timestampindex:= MIN(timestampindex, 1440);&lt;br/&gt;
TIMESTAMP:= Data&lt;span&gt;[timestampindex]&lt;/span&gt;.TimeStamp; &lt;/p&gt;
&lt;p&gt;These functions both assume data and timestamp arrays of 1..1440&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>STRING-Arrays as data-points in a graph</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/805e4f0589/?limit=25#6d95" rel="alternate"/><published>2021-03-12T17:40:11.005000Z</published><updated>2021-03-12T17:40:11.005000Z</updated><author><name>Morberis</name><uri>https://forge.codesys.com/u/morberis/</uri></author><id>https://forge.codesys.com60216e891b1a574e7191b2097423b0cc37b5ee68</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have not seen someone post a solution yet. That doesn't mean it doesn't exist though. I had seen someone do this but they did the work external to Codesys using Grafana I think and the graph was accessed on the PLC with the browser.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>STRING-Arrays as data-points in a graph</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/805e4f0589/?limit=25#3e76" rel="alternate"/><published>2021-03-12T07:07:32.894000Z</published><updated>2021-03-12T07:07:32.894000Z</updated><author><name>augustaseltva</name><uri>https://forge.codesys.com/u/augustaseltva/</uri></author><id>https://forge.codesys.com8680dd395d722e1041e3f9bfb6ba295d8b010840</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hey,&lt;/p&gt;
&lt;p&gt;I'm trying to do the same thing, basically, I am storing a variable REAL and a timestamp in DT format to a CSV file on the PLC flash memory, and at the same time I would like to read the CSV file and display it on XY chart (it is like a custom made trend recording, since Schneider M241 dosen't support codesys trend recording manager). Anyways, I read the CSV file succesfully and store the timestamp and value in seperate arrays, however, XY chart dosent support neither DT variables nor string variables. Hopefully, someone has got a solution for this :)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>STRING-Arrays as data-points in a graph</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/805e4f0589/?limit=25#a803" rel="alternate"/><published>2021-02-25T10:06:58.565000Z</published><updated>2021-02-25T10:06:58.565000Z</updated><author><name>agerkvist</name><uri>https://forge.codesys.com/u/agerkvist/</uri></author><id>https://forge.codesys.com037bb41e0be959a68449297c0efd62c7b98554a0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry if the question is trivial, but I am new to codesys :)&lt;/p&gt;
&lt;p&gt;I am currently working on retrieving some JSON-formatted sample-points through a http GET request. &lt;br/&gt;
I can successfully retrieve and split the sample points, but the sample-points for the X-axis is a timestamp  (epoch time). &lt;br/&gt;
I am trying to plot the sample points by using the XYchart visual element, but as the used variables for the XYChart is basic integer types, the visualization of a DT by using a interger-type is not optimal. &lt;/p&gt;
&lt;p&gt;My question is then: is it possible to "hack" and then be able to plot strings in a graph? &lt;/p&gt;&lt;/div&gt;</summary></entry></feed>