Creating a new database

Hi again,

I am trying to create a new database and fill it in a C# dll. Essentially I am reading in some data from one database (thanks for the help from my last post by the way, it was very useful!), doing some processing on it, and now I am attempting to write it out to a new database. I have created the new database, but I am unsure how to set the names of the channels so that I can access them (and thereby write to them). Currently I am doing:

CDB.Create(Globals.outputFile, lengthX, 3, iBlobs, 10, iErase, "SUPER", "");
outDB = CDB.Open(Globals.outputFile, "SUPER", "");

// --- Set channel names ---
outDB.SetChanName(xChano, "x");
outDB.SetChanName(yChano, "y");
outDB.SetChanName(vChano, "data");

// --- Lock channel for read-writer ---
outDB.LockSymb(xChano, CoreConstant.DB_LOCK_READWRITE, CoreConstant.DB_WAIT_NONE);
outDB.LockSymb(yChano, CoreConstant.DB_LOCK_READWRITE, CoreConstant.DB_WAIT_NONE);
outDB.LockSymb(vChano, CoreConstant.DB_LOCK_READWRITE, CoreConstant.DB_WAIT_NONE);

etc.

However I get an error at the set channel names section, not surprisingly, as I do not know what values to set for the "xChano", "yChano", and "vChano" variables (x, y, and data/value channels respectively). Is this the way I should be going about doing this process? Or should I be using something else like the CDBREAD Class?

Thank you,

Tomas Naprstek
Tagged:

Comments

  • Hi Tomas,

    You can locate an existing channel using FindSymb.

    ex. int xChano = outDB.FindSymb("X", DB_SYMB_TYPEConstant.DB_SYMB_CHAN);

    Hope this helps.

    Regards,
    Joseph
This discussion has been closed.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!