New Features


tlemar

Recommended Posts

I would like to have the ability to get the name of the channel with in the channel event.  My understanding is requires the scope of the event to be changed from global.  

 

I would like to have the ability to copy an entire channel (ie, include event code in the code) 

 

I would like to have the ability to copy channel groups between separate instances of Daqfactory.  Would like this feature to copy event code also.  Would be great if you could have a replace function that would rename the channel on insertion.  Would be similar to the way the duplicate button on the channel page works (LS1  -> duplicate -> LS2)

Link to comment
Share on other sites

Export your channels, then open and edit the exported file in Excel (It's tab delimited, I think.  Whatever it is, it opens fine as a table in Excel).  There you have search and replace, drag and fill, and more editing power than in DAQ Factory (plus documentation of your channels).  Then import from within DAQ Factory (same or different application).

Link to comment
Share on other sites

  • 1 month later...

Thanks for the advice Steve.  I have used this method in the past but I does not include any of the event code, which in my case is significant.  I use the same devices in most of the files, if there was some way to copy everything or to add a device template (which might be more powerful and easier to implement in code) it would save me a significant amount of time. 

Link to comment
Share on other sites

  • 7 months later...

I've been working on custom tables of channel names and properties and there is a way to do what you want, though it takes a little more effort than exporting the channel table.

 

Channel.ListAll() returns a list of strings with all the channel names.  Since you can access any channel information using the name along with the field name, like ?MyChannel.strEvent, you can build a table containing whatever channel information you want just by stepping through the list returned by Channel.ListAll(), using execute() or evaluate().  I needed to create sucn a table as part of creating a custom protocol.

 

Once you have that table (and since some values are strings, to do it in one table, you'll either have to use classes or make the whole table strings, including the numeric values), you can export it to a disk file using File.WriteDelim() or To.Json().  You could then write an inverse function, to import that table and create the channels thus encoded, including events, and whatever else you had decided to include in the file.

 

Starting with DAQ Factory v5.90, there is also a script dump feature (under the File menu), and I believe, though I haven't checked, that it exports event code in channels.  That would be a little more labor intensive on the back end, copying the event code into your new channels, but it would provide an archive copy external to any given CTL file, which might be a benefit.

Link to comment
Share on other sites

Archived

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