<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[REXYGEN Community Forum / SGSLP function block: Logging to Text File on external drive]]></title>
	<link rel="self" href="https://www.rexygen.com/oldforum/extern.php?action=feed&amp;tid=270&amp;type=atom"/>
	<link href="http://www.rexygen.com/oldforum/viewtopic.php?id=270"/>
	<updated>2018-12-13T07:51:10Z</updated>
	<generator>FluxBB</generator>
	<id>http://www.rexygen.com/oldforum/viewtopic.php?id=270</id>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=2193#p2193"/>
		<content type="html"><![CDATA[<p>Hi Peter,<br />thanks for your question. The new version is just around the corner. What you ask for is not included, sorry. It&#039;s definitely on our todo list for the following one.</p><p>Kind regards,<br />Jaroslav</p>]]></content>
		<author>
			<name><![CDATA[jaroslav_sobota]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=3</uri>
		</author>
		<updated>2018-12-13T07:51:10Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=2193#p2193</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=2190#p2190"/>
		<content type="html"><![CDATA[<p>Hi Jaroslav / Tomas,</p><p>Just wondering if there is anything like this as you mentioned available meanwhile. A command-line utility to extract data from the internal archive to CSV file.</p><p>Or a new function block to store data to a logging file? Maybe in the new version of Rexygen?</p><p>Regards,<br />Peter</p>]]></content>
		<author>
			<name><![CDATA[rexpeter]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=100</uri>
		</author>
		<updated>2018-12-12T21:38:22Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=2190#p2190</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1414#p1414"/>
		<content type="html"><![CDATA[<p>Hi Jaroslav,</p><p>Thanks for your feedback on this.</p><p><em>&quot;On the other hand, there is an internal archiving system in REX, which is way more efficient than storing data in a text file. The downside is that (as of current version 2.50.1) the data can be extracted only using RexView. If there was a command-line utility to extract data from the internal archive to CSV file, which you could run e.g. every day at midnight, would that fit your needs?&quot;</em></p><p>That would be great of course!<br />Thanks once more for all your effort providing these examples and information!</p><p>Regards,<br />Peter</p>]]></content>
		<author>
			<name><![CDATA[rexpeter]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=100</uri>
		</author>
		<updated>2017-01-13T22:18:32Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1414#p1414</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1412#p1412"/>
		<content type="html"><![CDATA[<p>Hi Peter,<br />glad I could help. You are right, the code is way too complicated for such a simple task. We&#039;ll add a few more commands to REXLANG, which will simplify the code.</p><p>On the other hand, there is an internal archiving system in REX, which is way more efficient than storing data in a text file. The downside is that (as of current version 2.50.1) the data can be extracted only using RexView. If there was a command-line utility to extract data from the internal archive to CSV file, which you could run e.g. every day at midnight, would that fit your needs?</p><p>As for the hand-coding, I understand your comment and thank you for that. It is not in human power to have function blocks for everything and completely avoid hand coding. Still I believe there is a lot you can do with REX without typing a line of code... </p><p>Moreover, in some scenarios, a few lines of code are worth tens or hundreds of function blocks. It&#039;s the possibility to combine these two approaches almost seamlessly which we consider one of the big advantages of REX.</p><p>Kind regards,<br />Jaroslav</p>]]></content>
		<author>
			<name><![CDATA[jaroslav_sobota]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=3</uri>
		</author>
		<updated>2017-01-13T15:07:07Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1412#p1412</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1411#p1411"/>
		<content type="html"><![CDATA[<p>Hi Jaroslav,</p><p>Thank you very much for this example.<br />Based on the &quot;relative complexity&quot; of such a basic feature, I strongly suggest to have a function block available for this.</p><p>It is not a complaint, but a challenge since I only refer to the features on the website about Rex Control stating:</p><p><strong>Features of the REX Control System</strong><br />Graphical programming <span style="color: #FF0000">without hand-coding</span></p><p>But nevertheless with this example it appears to be easy to create what I would like to have.<br />Thanks once more!</p><p>Best regards,<br />Peter</p>]]></content>
		<author>
			<name><![CDATA[rexpeter]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=100</uri>
		</author>
		<updated>2017-01-13T12:07:37Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1411#p1411</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1408#p1408"/>
		<content type="html"><![CDATA[<p>Hi guys,<br />it took way too long, but here it comes. See this <a href="http://www.rexygen.com/oldforum/img/members/3/Logging_To_Text_File.zip" rel="nofollow">example on logging data to a text file using the REXLANG block</a>.</p><p>The README file should contain all the information you need. I am not writing more about the example on purpose. Your comments are highly welcome.</p><p>Regards,<br />Jaroslav</p>]]></content>
		<author>
			<name><![CDATA[jaroslav_sobota]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=3</uri>
		</author>
		<updated>2017-01-12T15:12:38Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1408#p1408</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1402#p1402"/>
		<content type="html"><![CDATA[<p>Hi Evan,</p><p>I agree and factually still looking forward for an example of &quot;logging data to a text file&quot; as well.</p><p>Regards,<br />Peter</p>]]></content>
		<author>
			<name><![CDATA[rexpeter]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=100</uri>
		</author>
		<updated>2017-01-11T14:43:36Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1402#p1402</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1393#p1393"/>
		<content type="html"><![CDATA[<p>Hi all, I&#039;d be very interested to see an example of this, as I need to do the same kind of thing:</p><p>Store a &quot;line&quot; of comma separated temperature and other values, every one minute or so, onto a flash drive or similar for later analysis purposes. </p><p>However it is done, code or a module, an example would be really useful!</p><p>Thanks<br />Regards<br />Evan</p>]]></content>
		<author>
			<name><![CDATA[et0]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=126</uri>
		</author>
		<updated>2017-01-10T17:18:34Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1393#p1393</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1302#p1302"/>
		<content type="html"><![CDATA[<p>Thanks Jaroslav for your feedback on how to average data and to display it nicely in a trend plot.<br />But this unfortunately still does not give me the information on how to log to a txt or csv file using the most practical or easiest way.<br />I know there is archive function and a trendblock tha might capture data, but what is the most easy way to process the original request &quot;logging data to file on an external device (USB drive or NAS)?<br />Thanks in advance.</p><p>Thanks,<br />Peter</p>]]></content>
		<author>
			<name><![CDATA[rexpeter]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=100</uri>
		</author>
		<updated>2016-12-20T05:44:09Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1302#p1302</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1295#p1295"/>
		<content type="html"><![CDATA[<div class="quotebox"><cite>rexpeter wrote:</cite><blockquote><div><p>Let&#039;s say we take 2 pieces of 1-wire temperature sensors and sampling every 5 seconds, but store an average of the temperature reading for each sensor every minute to a logging file (TXT file, or CSV file or something like that).<br />...<br />I can imagine we need to save data first to RAM drive in order to avoid too many write cycles to USB drive or external drive and do the processing (averaging of data over 1 minute and eventually formatting the output (instead of 24.23019383 degrees C, that is will become 24.2 degrees C) before it will be saved to the logging file.</p></div></blockquote></div><p>Hi guys,<br />for averaging, you can use:</p><ul><li><p>AVG block - in this case it must be placed inside a task with sampling period 5 seconds and n=12 should be set. This will give you a 1-minute running average. Therefore you can export its output directly, without any need for postprocessing.</p></li><li><p>TRND block - in this case the sampling period of the task can be arbitrary, you just have to set the pfac parameter so that pfac*Ts=60, where Ts is the sampling time in seconds. It is also necessary to set ptype1=5: Average. By that, you&#039;ll get the average temperature in 1-minute intervals at the y1 output.</p></li></ul><p>Both of these approaches are handled in RAM and give you the value which you want to store in a text file.</p><p>Hope this helps somehow. I&#039;ll add some more hints...</p><p>Jaroslav</p>]]></content>
		<author>
			<name><![CDATA[jaroslav_sobota]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=3</uri>
		</author>
		<updated>2016-12-19T13:33:41Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1295#p1295</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1282#p1282"/>
		<content type="html"><![CDATA[<p>Hi Jaroslav,</p><p>I&#039;m still very interested in the way HOW to simply log data within RexControl system (without the need of running a separate script where data will be logged independently from the RexControl system. Whenever you have the possibility to come back to this, I looking forward for this.<br />Thanks in advance,</p><p>Regards,<br />Peter</p>]]></content>
		<author>
			<name><![CDATA[rexpeter]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=100</uri>
		</author>
		<updated>2016-12-13T22:29:07Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1282#p1282</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1228#p1228"/>
		<content type="html"><![CDATA[<p>Hi Peter and Scoobsalamander,<br />thanks for all your comments. SGSLP block is not intended for data logging. It is intended for storing the changes in parameters permanently (e.g. user-defined temperature setpoints via web HMI).</p><p>I would use the TRND block for averaging and archiving the data and move it to a database afterwards as Scoobsalamander recommended. Since this is not an option for Peter, I would use the AVG block for averaging the temperatures and the EPC block for storing the data in a text file. However, from there, you have to rely on &quot;Linux magic&quot; and use e.g. sed or awk commands. It&#039;s also possible to use the REXLANG block, which is very similar to the EPC-based approach.</p><p>I&#039;ll get back to this topic and create some examples based on your discussion, but not in the next week since I&#039;m at SPS/IPC in Nuernberg/Germany.</p><p>Jaroslav</p>]]></content>
		<author>
			<name><![CDATA[jaroslav_sobota]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=3</uri>
		</author>
		<updated>2016-11-20T21:53:38Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1228#p1228</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1209#p1209"/>
		<content type="html"><![CDATA[<p>Hi Scoobsalamander,</p><p>Thanks for your proposal, but i intend to use the device remotely without the using rexview. So the data logging / archieving to a CSV, or TXT file should be done automatically every week or every month. Without having checked your example, I think this is not happening if you speak about the export from the trenplot data inside RexView.<br />That is the reason I expected that there is another function block like SGSLP available for this purpose.</p><p>So I guess still not the solution I am looking for....</p>]]></content>
		<author>
			<name><![CDATA[rexpeter]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=100</uri>
		</author>
		<updated>2016-11-19T12:11:07Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1209#p1209</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1207#p1207"/>
		<content type="html"><![CDATA[<p>I would just use the TREND FB and store the data in an archive. </p><p>From within REXview you can export the data fromt the TREND and/or Archive to a CSV file.</p><br /><p><a href="https://www.rexygen.com/oldforum/img/members/6/archiving.zip" rel="nofollow">Small example (original example + TREND block) </a></p>]]></content>
		<author>
			<name><![CDATA[scoobsalamander]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=6</uri>
		</author>
		<updated>2016-11-19T00:11:42Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1207#p1207</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: SGSLP function block: Logging to Text File on external drive]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1206#p1206"/>
		<content type="html"><![CDATA[<p>Hi all,</p><p>This is more or less what I want to achieve. A TXT or CSV file that provides and overview of the historical parameters saved once every minute with date / time stamp and a header information.<br />Which function block to use for such kind of archive / logging file? If such files automatically can be stored as a single file once every week or month it would be great.</p><p>There or various blocks but I could not find a nice example on how to achieve this. And I feel this might be a commonly used thing in industrial applications.</p><p>So basic question: Who can provide a basic example that is doing such a job?</p><br /><p>Example file below (TAB separated values):</p><p>TIME&#160; &#160; MM&#160; &#160; DD&#160; &#160; T01&#160; &#160; T02&#160; &#160; T03&#160; &#160; T04&#160; &#160; T05&#160; &#160; T06&#160; &#160; T07&#160; &#160; Operate&#160; &#160; Cycle&#160; &#160; RunHrs&#160; &#160; ActiveHrs&#160; &#160; Counter1&#160; &#160; LatchingAlarm<br />00:00&#160; &#160; 02&#160; &#160; 01&#160; &#160; 41.16&#160; &#160; 47.9&#160; &#160; 52.74&#160; &#160; 3.07&#160; &#160; 0.51&#160; &#160; 7.27&#160; &#160; 0.23&#160; &#160; 0&#160; &#160; 1&#160; &#160; 678&#160; &#160; 672&#160; &#160; 1329&#160; &#160; 0<br />00:01&#160; &#160; 02&#160; &#160; 01&#160; &#160; 40.98&#160; &#160; 49.38&#160; &#160; 54.48&#160; &#160; 3.13&#160; &#160; 0.51&#160; &#160; 7.27&#160; &#160; 0.23&#160; &#160; 0&#160; &#160; 1&#160; &#160; 678&#160; &#160; 672&#160; &#160; 1329&#160; &#160; 0<br />00:02&#160; &#160; 02&#160; &#160; 01&#160; &#160; 40.89&#160; &#160; 48.53&#160; &#160; 53.28&#160; &#160; 3.35&#160; &#160; 0.51&#160; &#160; 7.28&#160; &#160; 0.23&#160; &#160; 0&#160; &#160; 1&#160; &#160; 678&#160; &#160; 672&#160; &#160; 1329&#160; &#160; 0<br />00:03&#160; &#160; 02&#160; &#160; 01&#160; &#160; 40.83&#160; &#160; 53.05&#160; &#160; 54.94&#160; &#160; 3.13&#160; &#160; 0.51&#160; &#160; 7.28&#160; &#160; 0.22&#160; &#160; 0&#160; &#160; 1&#160; &#160; 678&#160; &#160; 672&#160; &#160; 1329&#160; &#160; 0<br />00:04&#160; &#160; 02&#160; &#160; 01&#160; &#160; 41.12&#160; &#160; 45.04&#160; &#160; 54.85&#160; &#160; 2.72&#160; &#160; 0.51&#160; &#160; 7.27&#160; &#160; 0.22&#160; &#160; 0&#160; &#160; 1&#160; &#160; 678&#160; &#160; 672&#160; &#160; 1329&#160; &#160; 0<br />00:05&#160; &#160; 02&#160; &#160; 01&#160; &#160; 40.81&#160; &#160; 49.18&#160; &#160; 53.99&#160; &#160; 3.07&#160; &#160; 0.51&#160; &#160; 7.25&#160; &#160; 0.2&#160; &#160; 0&#160; &#160; 1&#160; &#160; 678&#160; &#160; 672&#160; &#160; 1329&#160; &#160; 0<br />00:06&#160; &#160; 02&#160; &#160; 01&#160; &#160; 40.54&#160; &#160; 50.24&#160; &#160; 53.83&#160; &#160; 3.26&#160; &#160; 0.51&#160; &#160; 7.23&#160; &#160; 0.22&#160; &#160; 0&#160; &#160; 1&#160; &#160; 678&#160; &#160; 672&#160; &#160; 1329&#160; &#160; 0<br />00:07&#160; &#160; 02&#160; &#160; 01&#160; &#160; 40.43&#160; &#160; 49.39&#160; &#160; 53.47&#160; &#160; 3.43&#160; &#160; 0.51&#160; &#160; 7.25&#160; &#160; 0.22&#160; &#160; 0&#160; &#160; 1&#160; &#160; 678&#160; &#160; 672&#160; &#160; 1329&#160; &#160; 0<br />00:08&#160; &#160; 02&#160; &#160; 01&#160; &#160; 40.41&#160; &#160; 48.81&#160; &#160; 53.61&#160; &#160; 3.14&#160; &#160; 0.51&#160; &#160; 7.27&#160; &#160; 0.22&#160; &#160; 0&#160; &#160; 1&#160; &#160; 678&#160; &#160; 672&#160; &#160; 1329&#160; &#160; 0<br />00:09&#160; &#160; 02&#160; &#160; 01&#160; &#160; 40.35&#160; &#160; 48.12&#160; &#160; 53.29&#160; &#160; 1.99&#160; &#160; 0.51&#160; &#160; 7.26&#160; &#160; 0.22&#160; &#160; 0&#160; &#160; 1&#160; &#160; 678&#160; &#160; 672&#160; &#160; 1329&#160; &#160; 0<br />00:10&#160; &#160; 02&#160; &#160; 01&#160; &#160; 40.28&#160; &#160; 49.02&#160; &#160; 53.38&#160; &#160; 2.7&#160; &#160; 0.51&#160; &#160; 7.24&#160; &#160; 0.23&#160; &#160; 0&#160; &#160; 1&#160; &#160; 678&#160; &#160; 672&#160; &#160; 1329&#160; &#160; 0<br />00:11&#160; &#160; 02&#160; &#160; 01&#160; &#160; 40.16&#160; &#160; 49.39&#160; &#160; 53.66&#160; &#160; 3.18&#160; &#160; 0.51&#160; &#160; 7.22&#160; &#160; 0.23&#160; &#160; 0&#160; &#160; 1&#160; &#160; 678&#160; &#160; 672&#160; &#160; 1329&#160; &#160; 0</p><p>Regards,<br />Peter</p>]]></content>
		<author>
			<name><![CDATA[rexpeter]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=100</uri>
		</author>
		<updated>2016-11-18T21:41:33Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1206#p1206</id>
	</entry>
</feed>
