Reading $dtTL (Tag list) from export

This is my script:
program (2).bas (1.9 KB)

I want to recreate the ftp file as the format i want, but in that form i have to have tagnames and units so i chose to use Tag list instead of Historical Log. Here are what i want to ask:

  1. Is it possible to change or create char/string horizontally, because as i understand right now im changing it vertically depend on the column of the table in Export Block
  2. Is Basic script able to create or detect /t (tab)
  3. If i got other csv files into Flexy through FTP, and they have the same format, is it possible to combine them into one file and send?
  4. By using the script above, i cannot read the TagValue or TimeStr columns in the TagList export, do you have any idea why this occurs? I still able to:
    + Read the whole string of $dtTL by GET
    + Read the whole string or split string of $dtHL normally

Thank you for reading

Hi guys
Have you got any idea about my problem?

Also another thing i want to ask
5. Is it possible to delete a selected row of historical log in a new created file? The customer want to only have 1 row for each tag on each sent file (thats why i used Tag list)

Thank you guys again

Hi Phi,

  1. I’m not really sure what you mean by this. Historical data is based off of an individual time, and will write all of the historical data for tags that are being logged to that time period and then create a new line for the next logging period.

  2. I haven’t tested this yet, but I know that the new line feature works with the chr$ 13 + chr$ 10 so I think that a chr$ 9 should work. Here’s an example of some code I used for the new line.

$EmailTo$ = “
$EmailCC$ = “
$EmailSubject$ = “Daily Report”

$EmailBody$ = “”
$EmailBody$ = $EmailBody$ + "Value of First Tag is " + STR$ test@ + CHR$(13) + CHR$(10) // the CHR$(13) + CHR$(10) is the same as newline
$EmailBody$ = $EmailBody$ + "Time: " + TIME$ + CHR$(13) + CHR$(10) // Gives the full date when this was sent

  1. You could potentially grab all of the data from either an already existing file, and write other data from another file to it. Or you could grab all the data from both files and write them to a new file, but that’s not something that we would e able to easily support. If we were to help on this, that would probably need to be a paid support project

  2. A tag list will not export historical data. I think you’re looking for a historical table dtHT instead of a tag list. I believe the dtTL is the equivalent of the var_lst file.

  3. You could not do this without writing a script that would create a new file and have that file parse the data for what you want. This is something that we could potentially do but with the amount of time it would time to implement it, We’d need to do this as a paid service.


1 Like

Hi Tim, thank for your reply
Last question
If i get data from from dtHT, how can i change tagid into tagname? any example?

Hi Phi,

Here’s an example on what each of these would look like. With a historical table, it sorts it based off of tagname and not tag id.

Historical Log.csv (66.3 KB) Historical Table.csv (56.6 KB) taglist.csv (5.6 KB)


Hi Tim
I know what is it’s format, my problem occurs when im using dtHL (historical log), in its format doesnt contain tagName, only tagID, so how can i translate each tagID of that list into tagName?
Thank you

Hi Phi,

You could create a dtHL that has the additional data like what’s seen here, and then write a function that will parse that newly created file and replace the tagID with the tag name, or you could use the dtHT that already includes the tag name. But by default we can’t modify how these files are generated.

Is there additional data that you want from the dtHL compared to the dtHT?



Hi Tim
I have solved my above problems
Btw: when i recreate a new file in csv type, how can i make them fit in each column ?

Thank you for your supporting

Hi Phi,

Generally when you’re using our csv files you can set it to use a semicolon delimination, but it looks like on yours you can use tab or spaces

Click on the a column and then go up to the data tab and select text to column. Then you can choose how you want the data to be delimited.