Table
Table
HI I need to create a table, this table must be completed (with eg Volts, Amps, Capacity, date, batch) and pressing enter at the end of compiling the data to be acquired in 5 numeric input.
This and other tables that are compiled will then be stored before being called up in time of need without having to retype everything.
Thank you for your attention.
This and other tables that are compiled will then be stored before being called up in time of need without having to retype everything.
Thank you for your attention.
Re: Table
Millman,
one of many possibilities is presented here.
It makes use of LUTs.
1. you could make use of PLs integral LUT-function block (KT), which is a table that must be preset before you can run the PL application
2. the presented project makes use of a DLL which reads an external text file.
You have the freedom to edit the textfiles on the fly.
Be aware that the LUT result does interpolate between specified X-intervals.
It extrapolates if the file does not specify enough span.
In the project, the X indices in the files match the selector value exactly, so no interpolation occurs.
At least two pairs of [X;Y] values must be specified to form an interval.
You can add or delete value pairs on the fly by editing and saving the text file.
The pairs must be delimited (in the project by ";")
The directory must point to the textfiles, the textfiles must be present of course, the filenames must match these in the application.
The DLL is not thoroughly tested but operational; use it at your own risk.
As shown, you can use many instances of the same DLL, the can all share the same directory, or you can use structure of your choice.
You can specify several textfiles by means of a selector for a single DLL (by string multiplexer or by selector list) which is exemplarily shown in the project for the flour component.
The evaluation of the out_Y vs. X_in values is done in the DLL during a negative read-slope only (press the button).
Thomas
one of many possibilities is presented here.
It makes use of LUTs.
1. you could make use of PLs integral LUT-function block (KT), which is a table that must be preset before you can run the PL application
2. the presented project makes use of a DLL which reads an external text file.
You have the freedom to edit the textfiles on the fly.
Be aware that the LUT result does interpolate between specified X-intervals.
It extrapolates if the file does not specify enough span.
In the project, the X indices in the files match the selector value exactly, so no interpolation occurs.
At least two pairs of [X;Y] values must be specified to form an interval.
You can add or delete value pairs on the fly by editing and saving the text file.
The pairs must be delimited (in the project by ";")
The directory must point to the textfiles, the textfiles must be present of course, the filenames must match these in the application.
The DLL is not thoroughly tested but operational; use it at your own risk.
As shown, you can use many instances of the same DLL, the can all share the same directory, or you can use structure of your choice.
You can specify several textfiles by means of a selector for a single DLL (by string multiplexer or by selector list) which is exemplarily shown in the project for the flour component.
The evaluation of the out_Y vs. X_in values is done in the DLL during a negative read-slope only (press the button).
Thomas
- Dateianhänge
-
- LUT_1.ZIP
- (3.04 KiB) 645-mal heruntergeladen
Curiousity makes us progress !
Re: Table
Tom, you have other ideas? I have to write on the tables of PL not in txt file and when I press send the data should fit in numeric input and saved to be recalled when we will need.
I hope you have other ideas
thanks so much
I hope you have other ideas
thanks so much
Re: Table
Hi,
I did this for my own use, but share it with you, 'cause it could suit needs for others, too.
As you might have noticed, PL lacks from a table entry functionality.
So line by line or as in this case, string by string must be merged into some storage space somehow.
Using a file has the advantage of nonvolatile storage.
kPaul has created a DLL some time ago, called Stringspeicher, which is a string line-by-line-to-file-storer with the capability to edit the file to some extent (erase last line, reset file).
This suits well to my need.
If it should be necessary, the file can be edited externally on the fly ! Changes are reflected in the running PL application if the file is stored from a text editor.
In order to show the flexibility of mixed string/value capability, I have provided numeric and string readout fields.
I simply use RDline to peek out one line out of this file.
As kPauls DLL provides kind of 4-line browser, I have added some logic to autopeek a line which was browsed to. This allows to recall a previewed line without pressing an enter key. The peek line is entered after a delay, this allows to quickly browse through the lines without entering data too early.
Other potential application:
Of course the peeker could be used directly (by directly pointing to a line).
If a sequence of pointers was used to adress the file lines in sequence (in the RAM or ROM), kind of real value or string RAM could be realized by this.
The functionality description of Stringspeicher is found elsewhere in this forum; I have added kPauls help file here too.
I have limited its function to fixed max. line capacity (30000) and fixed date/time stamp enabled.
The strings are delimited with <space>. The filepath for Stringspeicher must be set to suit your needs.
The number of string entry "cells" is not limited, I have implemented an index plus 4 entries by now.
The PART function must be adapted, if more cells should be used, or if date/time fileds are altered.
Have fun.
Thomas
I did this for my own use, but share it with you, 'cause it could suit needs for others, too.
As you might have noticed, PL lacks from a table entry functionality.
So line by line or as in this case, string by string must be merged into some storage space somehow.
Using a file has the advantage of nonvolatile storage.
kPaul has created a DLL some time ago, called Stringspeicher, which is a string line-by-line-to-file-storer with the capability to edit the file to some extent (erase last line, reset file).
This suits well to my need.
If it should be necessary, the file can be edited externally on the fly ! Changes are reflected in the running PL application if the file is stored from a text editor.
In order to show the flexibility of mixed string/value capability, I have provided numeric and string readout fields.
I simply use RDline to peek out one line out of this file.
As kPauls DLL provides kind of 4-line browser, I have added some logic to autopeek a line which was browsed to. This allows to recall a previewed line without pressing an enter key. The peek line is entered after a delay, this allows to quickly browse through the lines without entering data too early.
Other potential application:
Of course the peeker could be used directly (by directly pointing to a line).
If a sequence of pointers was used to adress the file lines in sequence (in the RAM or ROM), kind of real value or string RAM could be realized by this.
The functionality description of Stringspeicher is found elsewhere in this forum; I have added kPauls help file here too.
I have limited its function to fixed max. line capacity (30000) and fixed date/time stamp enabled.
The strings are delimited with <space>. The filepath for Stringspeicher must be set to suit your needs.
The number of string entry "cells" is not limited, I have implemented an index plus 4 entries by now.
The PART function must be adapted, if more cells should be used, or if date/time fileds are altered.
Have fun.
Thomas
- Dateianhänge
-
- LUT_2.ZIP
- (55.94 KiB) 609-mal heruntergeladen
Curiousity makes us progress !
Re: Table
WoB is almost perfect, I just need to save to disk what I write in the tables, and then call the table capacity saved files.
here is the example
thank you very much
here is the example
thank you very much
- Dateianhänge
-
- 2012-10-22_135439.jpg (25.18 KiB) 21719 mal betrachtet
Re: Table
What cha presented Tom would be fine because it adds strings to a txt file, but I can not fit my purpose.
When I add the lines in the browser and I select do not go as pour in the display.
I hope someone can help me out
thank you
When I add the lines in the browser and I select do not go as pour in the display.
I hope someone can help me out
thank you
Re: Table
Thanks WoB is perfect, can you give me the lines of code you've written?
WoB you know how to convert from C # to C?
Last little problem the text box "Line number" you can connect with the text box capacity? eg: line 1 = 220 capacity line 2 = 330 capacity ........
Thanks again
WoB you know how to convert from C # to C?
Last little problem the text box "Line number" you can connect with the text box capacity? eg: line 1 = 220 capacity line 2 = 330 capacity ........
Thanks again