I'm writing a data logger program that may be used to log up to nine or ten channels at a time. Because there is basically no way to remove channels from a task, my program requires that you get the setup right on the first try or you have to start over. I imagine that process would get old fast, particularly if the same test is being done over and over again.
So my question is, how could I save the control inputs, or the DAQmx task, or something to a file which could then be loaded instead of entering everything manually each time?
I have attached a VI from the standard examples which I have based my program on, and I have attached a picture of what I actually have.
Solved! Go to Solution.
Well I really like using XML files for this but they can be hard to work with specially for end users that are not technical minded.
The simplest way I have come up with is create a DETAILED template in Excel that instructs the user to save the file as a .CSV, like this:
Then using the "Read Delimited Spreadsheet" vi I read that file and pull out the values for my program.
In the past, I used a configuration file to read all of the channels and their settings and then used the DAQmx Create Virtual Channel to add each channel to the task. If I were to redo it now, I would use JSON or XML. There are plenty of libraries for each.
BTW: Here is how I read the CSV "test script" file and parse it to load the values into my "Test Cluster"...