#VSCP HOWTO: DM write/append to file

The Level I logger and the Level II logger are great tools for logging events in a VSCP based system.  Useful also for debugging etc. Another method is to use the execute external program action and execute a script and write to a file there. We have seen this method being used in other howtos.  Also while running a JavaScript or a Lua script files can be written.


file writing is also available as an action.  It is documented here. This action allows writing or appending a string with output to a named file that is created if it does not exist. With the VSCP escapes a lot of dynamic information can go into this file.

Suppose that we want to  log events of a certain type to a file, here CLASS1.DATA, Type=2 A/D values form a specific device. We then write a decision matrix (DM) row

<row enable="true" groupid="" >

 Collect A/D values from node X

<mask priority="0"

<filter priority="0"
 GUID="00:01:02:03:04:05:06:07:08:09:0A:0B:0C:0D:0E:0F" />

 /tmp/addata;1;%isoboth: %measurement.string %lf 


will generate output content like this

With the other VSCP escapes and literals you have many options to generate meaningful output.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.