When setting the file name of a Logger, you are not only choosing where the file is created but naming it as well. Firstly, you are declaring where in the directory of the JNIOR you are saving the log file you wish to create.
Which is why most of the directory in the example above is /flash/tasker/logging/. Secondly, you are then naming the file that will be created at the end of the directory address.
In the example above, the last part of the directory is ExampleLog{{date("MMDDYY")}}
.csv, because thats what we want the name and filetype of the log file to be.
Looking at the file name of the Logger above, you'll notice that it has {{date("MMDDYY")}}
in it. This part of the file name adds the current date to the filename when it gets logged.
Since the date is a dynamic value, once a new day occurs the name won't be the same when logging from a different day. So instead of constantly overwritting itself, you'll have a new log at the start of each day.
Here is how the {{date("MMDDYY")}}
value works. Starting with the {{}}
, those curly braces are for defining values that will be logged. Only values being logged need to be surrounded with curly braces.
Next is the date() which is used to call a function that will grab the current date. It then uses the "MMDDYY" inside the date() function as parameters to define how the date should be formatted, which in this case is month, day, year.
The "" around MMDDYY are to define those letters as a string, which is the required parameters for the date() function.
Now Looking at the schema of the Logger above, you'll see the values {{iout[1].scaled}}
,{{TEMP_SENSOR_FAR}}
,{{$$Variable1}}
. Each value is using a different way to be logged. To explain what these values do, lets start with {{iout[1].scaled}}
.
As you can see at the top of this section shows a way to set a value for 4-20ma I/O, which is iout[#].scaled
. Adding this value with {{}}
around it to the schema of the logger will log the values of the 4-20ma output,
replacing the # with either 1 for 4-20ma output 1 or 2 for 4-20ma output 2. The other value {{TEMP_SENSOR_FAR}}
isn't listed at the top like {{iout[1].scaled}}
.
This is because it is a signal created in the Signal tab that can be used as a value for logging. Similarly, {{$$Variable1}}
isn't listed either because it is set elsewhere like {{TEMP_SENSOR_FAR}}
.
{{$$Variable1}}
is prefixed with two $$ because it is a global variable. Global variables are defined in the Task Tab by adding a Set Variable action to a Task and naming the variable with $$ in front of it.
Whatever is defined in the Set Variable action for the global variable will be its value. It can be set to a value like iout[1].scaled or to a Signal like TEMP_SENSOR_FAR was.
So since {{iout[1].scaled}}
,{{TEMP_SENSOR_FAR}}
, and {{$$Variable1}}
are in the schema, the value of the output # on a 4-20ma module, the Signal that TEMP_SENSOR_FAR is, and the value of the global variable $$Variable1 will be logged for this logger.
Additionally, if you are logging through the Log Entry action in the Task Tab you can use these values as shown in the schema of a Logger to log the values as well.