Adding Quick Notes By Code


Recommended Posts

Hi.

I know it is possible to invoke the Quick Notes dialog by code using System.NoteDialog(). However, what I would like to do is adding some string annotations to the Note channel directly from code. In my case, I have a button which the user clicks to log the amount of a substance added to a vessel. This number gets into a V-channel and to the log file, but I also need to record the name of the substance for reference. This name is stored in a global variable so the user just selects the substance from a drop down list. So when clicking the button, I want the amount get logged into a numeric channel AND a string added to the Note channel without prompting the user with the NoteDialog. Is this possible? Doing Note.AddValue("foo") does not work, neither does Note[0]="foo".

Right now, I have solved this by adding my own String channel called "Notes" and doing Notes.AddValue("foo"), but this seems to me as inventing the wheel again. So maybe there is a more elegant way?

Link to comment
Share on other sites

Using a string channel is the way to go.  The "notes" feature was something we added in the very first versions of DAQFactory, before scripting was even an option, and has hung on.  Its handy, but not terribly flexible, and, as you did, is easy to replicate and customize in script.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.