<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Array sorting</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/ab70d3d9e9/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/ab70d3d9e9/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/ab70d3d9e9/</id><updated>2020-02-27T15:27:35.888000Z</updated><subtitle>Recent posts to Array sorting</subtitle><entry><title>Array sorting</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/ab70d3d9e9/?limit=25#8d37" rel="alternate"/><published>2020-02-27T15:27:35.888000Z</published><updated>2020-02-27T15:27:35.888000Z</updated><author><name>Dave-76</name><uri>https://forge.codesys.com/u/dave-76/</uri></author><id>https://forge.codesys.com1c2c3c0202eda2bf24379bf331fe5f84ddca08d0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;rtfm: read the f.... manual to learn more about codesys&lt;br/&gt;
&lt;a class="" href="https://help.codesys.com/webapp/_cds_tutorial_refrigerator_control;product=codesys;version=3.5.14.0" rel="nofollow"&gt;https://help.codesys.com/webapp/_cds_tu ... n=3.5.14.0&lt;/a&gt;&lt;br/&gt;
&lt;a class="" href="https://help.codesys.com/webapp/_cds_struct_reference_datatypes;product=codesys;version=3.5.14.0" rel="nofollow"&gt;https://help.codesys.com/webapp/_cds_st ... n=3.5.14.0&lt;/a&gt;&lt;br/&gt;
&lt;a class="" href="https://help.codesys.com/webapp/_cds_datatype_structure;product=codesys;version=3.5.14.0" rel="nofollow"&gt;https://help.codesys.com/webapp/_cds_da ... n=3.5.14.0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The text isn't ST-code, it should be a idea for you, to find your own way to program this.&lt;br/&gt;
Yes, you can create a function like your stopwatch in ST and call it from your PLC_PRG.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Array sorting</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/ab70d3d9e9/?limit=25#214b" rel="alternate"/><published>2020-02-27T15:27:33.990000Z</published><updated>2020-02-27T15:27:33.990000Z</updated><author><name>Nira</name><uri>https://forge.codesys.com/u/nira/</uri></author><id>https://forge.codesys.comdde722c793ab50901fd14b3e0508b782e01f834d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello, and thank you for your replay.&lt;/p&gt;
&lt;p&gt;I'm from Holland indeed.&lt;br/&gt;
I appreciate your help.&lt;/p&gt;
&lt;p&gt;Can you axplain create a structure with string (for the players name) and time?&lt;br/&gt;
Do i have to that in a DUT? &lt;/p&gt;
&lt;p&gt;Declare f.eg. TopTen : Array &lt;span&gt;[1..10]&lt;/span&gt; of struct xxxxx &lt;br/&gt;
I do this in the PLC_PRG?&lt;/p&gt;
&lt;p&gt;Do i also have to make the loop in the PLC_PRG?&lt;br/&gt;
I program in funtion blocks how do i add the text?&lt;br/&gt;
if Gespeelde_Tijd is higher than the time in Array10 do nothing and exit loop.&lt;br/&gt;
if Gespeelde_Tijd is lower than the time in Array10 and higher than Array9 replace Array10 with Gespeelde_Tijd and name and exit loop.&lt;br/&gt;
if Gespeelde_Tijd is lower than the time in Array9 then copy Array9 to Array10 and go to next loop.&lt;br/&gt;
Or can i make a POU in structure text?&lt;/p&gt;
&lt;p&gt;Sorry for the beginners questions  &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Array sorting</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/ab70d3d9e9/?limit=25#6eab" rel="alternate"/><published>2020-02-27T15:27:33.317000Z</published><updated>2020-02-27T15:27:33.317000Z</updated><author><name>Dave-76</name><uri>https://forge.codesys.com/u/dave-76/</uri></author><id>https://forge.codesys.com1c443e07ce11d1a305ffd9d60d158d6319c7e704</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I would do it like this:&lt;br/&gt;
Create a structure with string (for the players name) and time&lt;br/&gt;
Declare f.eg. TopTen : Array &lt;span&gt;[1..10]&lt;/span&gt; of struct xxxxx &lt;br/&gt;
do in a loop:&lt;br/&gt;
if Gespeelde_Tijd is higher than the time in Array10 do nothing and exit loop.&lt;br/&gt;
if Gespeelde_Tijd is lower than the time in Array10 and higher than Array9 replace Array10 with Gespeelde_Tijd and name and exit loop.&lt;br/&gt;
if Gespeelde_Tijd is lower than the time in Array9 then copy Array9  to Array10 and go to next loop.&lt;/p&gt;
&lt;p&gt;in the next loop cycle:&lt;br/&gt;
if Gespeelde_Tijd is lower than the time in Array8 then &lt;br/&gt;
     copy Array8  to Array9 and got to next loop cycle&lt;br/&gt;
else store Gespeelde_Tijd and name of the player in Array9 and exit loop&lt;/p&gt;
&lt;p&gt;and so on.&lt;br/&gt;
Hope you can understand my english explanations, my native language is german&lt;br/&gt;
and i'm rigth, you are dutch?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Array sorting</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/ab70d3d9e9/?limit=25#21e4" rel="alternate"/><published>2020-02-27T15:27:32.594000Z</published><updated>2020-02-27T15:27:32.594000Z</updated><author><name>josepmariarams</name><uri>https://forge.codesys.com/u/josepmariarams/</uri></author><id>https://forge.codesys.comd8d3b33e051bb89799a8b2607b4a8f869fc43c78</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;See:&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://www.google.com/amp/s/www.geeksforgeeks.org/bubble-sort/amp/" rel="nofollow"&gt;https://www.google.com/amp/s/www.geeksf ... -sort/amp/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sent from my Moto G (5S) Plus using Tapatalk&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Array sorting</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/ab70d3d9e9/?limit=25#9cd9" rel="alternate"/><published>2020-02-27T15:27:30.697000Z</published><updated>2020-02-27T15:27:30.697000Z</updated><author><name>Nira</name><uri>https://forge.codesys.com/u/nira/</uri></author><id>https://forge.codesys.com3af77b281913bd728e82349f45c89526996591ae</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I try to make a game that works on time, for now it works but i want to make some adjustments.&lt;/p&gt;
&lt;p&gt;I would like to make the array with the fastest times.&lt;br/&gt;
I created a function in visualization where you have to enter your name, the time played must be linked to the name entered and sorted in the array.&lt;/p&gt;
&lt;p&gt;I have a start and stop sensor for detecting the played time.&lt;/p&gt;
&lt;p&gt;Is there sombody who can help me in the right direction?&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Codesys1.JPG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=4604"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>