List of unique channels in data portal

Hello,
I often have multiple groups in my data portal and many of the channels (though not all) in each group share the same name as channels in the other groups.  What would be the most quick/efficient way that I could retrieve a list of the unique channel names in the data portal? 
For example, my data set might look as follows:
Group 1: contains channels A, B, C and D
Group 2: contains channels A, B, C, D and E
Group 3: contains channels B, C, D and E
My desired result:  Unique channel names in portal = A, B, C, D and E
**note, my groups often have 500+ channels in them, and this is why I am looking for something very quick.
Thanks!
Julia

Hello Julia,
I dont have an idea if this is the fastest method but its working and not too difficult to implement.
I am using the VBS library object to create a list of the channels. The
add method is giving an error if a channel name is allready existing.
With the on error resume next statement I am suppressing these
errors, though. In this way I am creating a list with unique channel
names. Actually its a table with the channel names in the 1st column
(called key) and the channel number of the 1st channel with this name in the second column (called item).
on error resume next
  Set chn = CreateObject("Scripting.Dictionary")
  for x = 1 to globusedchn
    chn.add cn(x), x
  next
  list = "Channels:"&vbcrlf
  for each k in chn.keys
  list = list & k & vbcrlf
  next
  msgbox list
on error goto 0
Let me know if this is running sufficiently quickly for all of your channels.
Ingo Schumacher
Systems Engineer Sound&VibrationNational Instruments Germany

Similar Messages

  • Access Channels in Data Portal through Data Plugin

    Hi,
    I am supposed to write two plugins, one plugin creates the channel reads in the data values and from the other plugin I need to read in the channel custom properties.
    Is there a possibility to access the channels in the Data portal through the plugin though I know through plugin we will not be able to access any DIAdem native commands.
    I have an option of reading in these properties to a text file and then pull them into DIAdem but it is not recommendable.All that is required is read the file and create the cutom property for the existing channels.
    Can anyone give me a best suggestion for the above at the earliest?
    Thanks,
    Priya

    Hello Priya,
    A dataplugin is not limited to read a single file only. There are quite a few cases where let's say there is a file "abc.bin" and another file "abc.hdr" which belong together. One contains the channel data, the other contains the descriptive information. We have developed plugins which allow the user to select one or the other and the DataPlugin then reads the information from both. As long as you can find the second file, e.g. through the name or some piece of information which is in the file, its not a problem. And yes, a plugin can read from a binary file and an ASCII file at the same time. We even developed DataPlugins for files which are both, ASCII and Binary, in a single file.
    If you like, you can send me some examples together with a description of the file format(s) and I can try something for you.
    Andreas

  • Programmatically Obtaining Channel Config data list

    Hi,
    How do I access the list of Communication channels in the system?
    I need a total list of ALL channels with data like this->
    Comm Channel Name,
    Communication Component,
    Party
    Cheers,
    Earlence

    hi,
    I said "programmatically".
    I found the answer
    XI_DIRKEYCHANNEL is a table in the BC_XIIB data source.
    It lists the reqd parameters.
    Cheers,
    Earlence

  • How do I check to see if a channel group exists in the data portal?

    I have a list of channel groups in the data portal but sometimes some channel groups  are not created all the time.  How do I check using a script if a channel group exists or was created.

    Hello jreynolds!
    With the command 'GroupIndexGet'. It returns 0 if the group does not exist.
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • How to get the list (vector) of selected channels from the portal

    Hi,
    I try to retrieve the selected channels from the portal to use them in my script. I use "DataCheckChnls". Is it possible to convert it to a vector, to use it after in in for next structure.
    I would like to do specific calculus for each selected channel. Must I use another method ?
    Thank's in advance.

    Hello!
    Sorry, I trusted the DIAdem help and did not testetd it. But I'm not completly wrong
    What you get is an array of strings containing the channel name. In standard use these names are unique and could be transfered to a channel numbers with the CNo command. Try this code to understand this:
    Option Explicit
    Dim aoChannels
    Dim oChannel
    aoChannels = ChnStrToChnList(DataCheckChnls)
    For Each oChannel In aoChannels
    MsgBox CNo(oChannel)
    Next
    If you realy need the numbers as array you can build a function to do this based on this code:
    Option Explicit
    Dim i
    Dim aoChannels
    Dim anChannels
    aoChannels = ChnStrToChnList(DataCheckChnls)
    ReDim anChannels(UBound(aoChannels))
    For i=0 To UBound(aoChannels)
    anChannels = CNo(aoChannels(i))
    Next
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • Creating a time channel in the data portal and filling it with data - Is there a more efficient way than this?

    I currently have a requirement to create a time channel in the data portal and subsequently fill it with data. I've shown below how I am currently doing it:
    Time_Ch = ChnAlloc("Time channel", 271214           , 1      ,           , "Time"         ,1                  ,1)              'Allocate time channel
    For intLoop = 1 to 271214
      ChD(intLoop,Time_Ch(0)) = CurrDateTimeReal          'Create time value
    Next
    I understand that the function to create and allocate memory for the time channel is extremely quick. However the time to store data in the channel afterwards is going to be highly dependent on the length I have assigned to the Time_Ch. In my application the length of Time_Ch is variable but could easily be in the order of 271214 or higher. Under such circumstances the time taken to fill Time_Ch is quite considerable. I am wondering whether this is the most appropriate way of doing things or whether there is a more efficient way of creating a time channel and filling it.
    Thanks very much for any help.
    Regards
    Matthew

    Hi Matthew,
    You are correct that there is a more efficient way to do this.  I'm a little confused about your "CurrDateTimeReal" assignment-- is this a constant?  Most people want a Time channel that counts up linearly in seconds or fractions of a second over the duration of the measurement.  But that looks like you would assign the same time value to all the rows of the new Time channel.
    If you want to create a "normal" Time channel that increases at a constant rate, you can use the ChnGenTime() function:
    ReturnValue = ChnGenTime(TimeChannel, GenTimeUnit, GenTimeXBeg, GenTimeXEnd, GenTimeStep, GenTimeMode, GenTimeNo)
    If you really do want a Time channel filled with all the same values, you can use the ChnLinGen() function and simply set the GenXBegin and GenXEnd parameters to be the same value:
    ReturnValue = ChnLinGen(TimeChannel, GenXBegin, GenXEnd, XNo, [GenXUnitPreset])
     In both cases you can use the Time channel you've already created (which as you say executes quickly) and point the output of these functions to that Time channel by using the Group/Channel syntax of the Time channel you created for the first TimeChannel parameter in either of the above functions.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • How to display .lvm filename in data portal?

    When I drag a .lvm file to the data portal, it lists it as 'LabVIEW_Data' rather than the filename that I dragged there. When I drag another .lvm file it lists it as 'LabVIEW_Data2'. How can I get it to display the filenames that were dragged there instead of a generic 'LabVIEW_Data'?

    Hi Dewey,
    Unzip the below attached two VBScript files somewhere on your hard drive where you're willing to leave them.  Then run the "Custom LVM Load.VBS" in DIAdem SCRIPT.  Now drag a new LVM file into the Data Portal.  You should see the Group take on the name of the LVM file.  The custom load event only renames the Group if the channels in that last Group were loaded with the "LVM" DataPlugin.
    You can configure your DIAdem to always start with the "Custom LVM Load.VBS", declared as part of DIAdem's launch cycle, by editing the "Start Script" field in the "General Settings" dialog and then saving the settings prior to shutting down DIAdem.
    Ask if you have further questions,
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments
    Attachments:
    Custom LVM Load.zip ‏1 KB

  • 16 channels of data at 30kHz on the NI USB-6259 - is it possible?

    Hello -- I would like to use the NI USB-6259 for electrophysiology.  My application requires 16 channels of analog input digitized at 30kHz.  This should be possible, as the listed aggregate digitization rate is 1MS/s.  I've however run into several problems, all of which I believe may deal with how memory is handled in LabView (or maybe I'm just programming it wrong).
    First off, if I pull in continuous voltage input using the DAQ assistant (DAQA) from anywhere from 5k to 30k samples at a time -- without any visualization -- things run alright.  I record the data in binary format (TDMS) using the "Write to Measurement File (WTMF)" routine.  However, I notice that the RAM used by LabView creeps up at a steady pace, roughly a megabyte every several seconds.  This makes long-term recording unfeasible.  Is there any way to avoid this?  Basically I just have the DAQA and WTMF in a while loop that was automatically created when I set the acquisition mode to continuous.  
    Secondly, I would like to be able to visualize my data as I record it.  If I set up 16 graphs -- one for each signal -- I need to raise the "Samples to Read" (STR) to 30k to ensure that the "Attempted to read samples that are no longer available" error [-200279].  This is annoying, as it makes the display look jerky, but is probably livable. 
    Now if I choose to display data in 16 charts rather than graphs (charts, as defined in LabView, display a bit of cumulative data along with the real-time signal), the amount of RAM used by LabView increases by several megabytes a second, regardless of whether or not I'm saving the data.  After a short time, I get an "out of memory error".  
    Ideally I would like to be able to display 16 channels of 30kHz analog voltage data and save the data.  As you see I'm having some level of trouble doing either of these things.  Bare minimum requirements for my application would be to pull in the data with an STR of 30k, visualize the data in graphs, and save the data.  Should this be possible in LabView 8.6 or 2009 (I use 8.6, but have tried these steps on the trial version of 2009 as well)?  Even better, I would like to use an STR closer to 5k, and display the data in charts as it's saved.  Should this be possible?
    I'm using a reasonably powerful machine -- 32-bit Windows 7 with 3.24 gigs RAM,  2.4 GHz quad-core, etc.
    Thanks

    Hello!
    I will admit right now that I can't stand any of the "assistants" and never use them.  I don't like to have any part of my code invisible from me.  Therefore, looking at your code gave me a headache.  :-) 
    So, what I did is rewrite your code using the DAQ functions (basically what you'd see if you selected "Open Front Panel" on the DAQ assistant icon).  You can go in and put the DAQ assistant back in if you so desire.  This is just to give you an idea of the approach you should take.  I'm grabbing 15000 points per loop iteration, just because I happen to like 500msec loop rates.  You can tailor this number to your needs.
    I have two parallel loops -- one collects the data and the other displays it on the front panel and writes it to a file.  (I used the "Write waveform to file" function -- you can put your assistant back in there instead if you like.)  The data is passed from the DAQ loop to the display loop using a queue.  I use the "index array" function to select out the individual channels of data for display.  I show 3 channels here, but you can easily expand that to accommodate all 16.  You can also add your filtering, etc.
    I am using a notifier to stop the two loops with a single button, or in case of an error.  If "stop" is pressed, or an error occurs in the DAQ loop, a "T" value is sent to the notifier in the display loop (and that "T" value is used to stop the DAQ loop as well).  That will cause the display loop to receive a "T" value, which will cause it to stop.
    I don't have a 6259 on hand, so I simulated one in MAX.  I didn't have a problem with the processor running at 100% -- on my clunky old laptop here, the processor typically showed ~40-50% usage.
    I've added comments to the code to help you understand what I'm doing here.  I hope this helps!
    d
    P.S.  I have a question...how are you currently stopping your loop?  You have "continuous samples" selected, and no stop button.
    Message Edited by DianeS on 12-30-2009 07:28 PM
    Attachments:
    16 channel waveform display and write.vi ‏31 KB

  • How to delete only a portion of the data portal?

    This would be similar to DataDelAll() command, but allow only a limited set of data to be removed.
    For some background:
    - DIAdem 9.1 sp2
    - LabVIEW interface calling various DIAdem/VBS scripts
    Using DIAdem to format reports based on various scripts and TDM data
    results, I would like to be able to load and unload various data files
    (TDM) while maintaining the specific report layout (also TDM) data in
    the portal.  Two (ugly) options seem to be:
    a)  load entire data result set into the portal (including layout instructions) and process, or
    b)  keep track of layout state variables and clear portal/reload layout/load next data
    This would all be easy if there is a command to enable the right-click delete... behavior of the data portal UI.
    Thanks!
    James

    Hello James,
    there are diufferent commands you can use to delete only a portion of the data in the portal. You can delete single channels, a selection of channels, or entire groups with these three commands:
    Call ChnDel(ChnArg) - deletes one channel
    Call ChnDelete(ClpSource) - deletes a selection of channels
    Call ChnSDel(ChnArg1, ChnNo) - delets a number of channels
    Call GroupDel(TargetGroupIndex) - deletes a group including its channels
    To create a selection of channels as argument for the second command, have a look at the functions
    ChnSelAdd, ChnSelGet, ChnSelCount
    Regards
    Ingo Schumacher
    Systems Engineer Sound&VibrationNational Instruments Germany

  • Creating a list of unique values within a range.

    I have a huge data set I am working with and need to do two things.
    First I need to get rid of any repeat entires, which there are many.
    Second, and more importantly, I need to generate a list of unique values within a column for which I have no idea what the number or sort of values might be. For instance, say the column contained flavors of ice cream, I am looking for a formula that can return an array of the flavors listed.
    Can either of these two things be done in numbers?

    CJ Eder wrote:
    I have a huge data set I am working with and need to do two things.
    First I need to get rid of any repeat entires, which there are many.
    If entries are in column B starting from B2
    In C2 enter the formula:
    =IF(COUNTIF($B$1:$B1,B)=0,B,"")
    and apply fill down.
    You will get a single copy of existing entries.
    Select the column C
    Copy to Clipboard
    Paste in column C
    Sort on column C
    delete the rows whose cell of column C is blank.
    If I understand well, the same protocol apply to your second request.
    Yvan KOENIG (from FRANCE mercredi 15 juillet 2009 21:32:30)

  • From Mysql to Data Portal

    Dear All,
    I am new in DIAdem 12.0, I want to create a VBS script to create queries from a mysql server.
    Data is structured in different tables  and in its table data is structured in the way you see below ,
    I want to find the sensors with the same sensor_id and make channels with the respective date and value.
    For example I used the following commands:
    CallSQL_Select("sensor_id,measdate,measvalue","seal_pp_a_final","sensor_id=2 ORDER BY sensor_id","")
    Call SQL_BindChannel("date1","measdate","n")
    Call SQL_BindChannel("PP-A1","measvalue","n")
    It worked but the date values are not in this format 2013-06-19 00:00:00 do you know how I can solve this problem ?
    Since there are many sensors can I use a loop for example if I want to read from sensor_id (1-100)
    write something like
    For i=1 to 100
    CallSQL_Select("sensor_id,measdate,measvalue","seal_pp_a_final","sensor_id=i ORDER BY sensor_id","")
    Call SQL_BindChannel("date(i)","measdate","n")
    Call SQL_BindChannel("PP-A(i)","measvalue","n")
    i=i+1
    End
    Looking forward to your Comments .
    Thank you in advance,
    Ioannis
    Sensor_id
    Datetime
    Value
    1
    2013-06-19 00:00:00
    1.2
    1
    2013-06-19 01:00:00
    1.3
    2
    2013-06-19 00:00:00
    5.6
    2
    2013-06-19 01:00:00
    5.7
    3
    2013-06-19 00:00:00
    310.2

    Hi Engineer,
    I would strongly advise you to switch to the ADO method of querying the data base columns.  ADO will return the query results as variants, which allows you to handle all the different column data types with no effort.  There are additional advantages to ADO as well.  I adapted a standard example script I use with your column and table names and query and order conditions:
    ' needs to be set to a valid ADO connection string for data base
    ConnectionStr = "Dsn=ABCDEFG;Uid=;Pwd=;"
    ' construct the SQL query to execute
    Table = "seal_pp_a_final"
    ColStr = "sensor_id,measdate,measvalue"
    CondStr = " WHERE sensor_id=2"
    SortStr = " ORDER BY sensor_id"
    QueryStr = "SELECT " & ColStr & " FROM " & Table & CondStr & SortStr
    MsgBox QueryStr
    ' Connect to the data base
    Set ADO = CreateObject("ADODB.Connection")
    ADO.Open ConnectionStr
    ' Execute the query and import the resulting data records into a VBScript variable
    Set RecordSet = ADO.Execute(QueryStr)
    RowVals = RecordSet.GetRows()
    ChanNames = Split(ColStr, ",")
    ' Send the resulting data records from the query to new channels in the Data Portal
    Call DataDelAll
    Call GroupCreate(Table)
    Call GroupDefaultSet(GroupCount)
    Channels = ArrayToChannels(RowVals, ChanNames, 1)
    ' Disconnect from the database and output the query used and any errors
    ADO.Close
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Howto efficiently Copy array into data portal

    I have an array in VBS memory and would like to create an channel in the data-portal based on that data-set, I currently use this code construct to copy the data:
    ' intChannelCount is the number of samples
    'MaxHold is the data array to be copied
    'oFFTMaxHold is the data channel that is the target of the data
    for counter = 1 to intChannelCount
          oFFTMaxHold.Values(counter)=MaxHold(counter)
    next
     It is rather slow (and if the data preview is open in the data portal) even much slower.
    Is there a method to copy the whole array in one operation to a channel?
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Solved!
    Go to Solution.

    Hi Ton,
    If you have DIAdem 10.2 or later you can use the following command to do this with one command-- passing the array of values as one of the command's parameters-- this is a common situation when querying records from a data base that you want to load into the Data Portal as channels.
    ChanRefsArray = ArrayToChannels(ValuesArray, ChanNamesArray)
    In the case of your example below, that would be:
    Call ArrayToChannels(MaxHold, Array(oFFTMaxHold.Name))
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Filter a list and unique selection will be used to filter another list

    Good afternoon,
    I need help using a label (CRP-MFR), to filter a list that I can display in a scorecard.
    The list will have all my data from the worksheet, first column being my unique id.
    I would like to detect the label and use that label to filter my list to a sublist that will be displayed
    in a scorecard. It seems simple but I'm having issues.
    Please help!
    Thanks
    The basic flow is Markets -> unique items ->
    I already filter the markets to select a unique market that gets populated into a label
    I wish to use that label to go to a products list to select the unique products for that market

    Hi,
    Can you send me the source file.i can check it once.you can view my id in business card.
    Thanks,
    Ramana.

  • DIAdem GPI: import groups in Data Portal

    Hello,
    I've developed a GPI-DLL to import my XML file, with the GPI extension toolkit (10.2).
    So now, from my GPI, I can read the XML file (C++ function), but I don't know how to create a group in the data portal, (then the channel).
    Which function can i use?
    My configurationis DIAdem 10.2.0
    Best regards,
    Fred

    Hi,
    The best way to import data in DIAdem is to
    develop a DataPlugin. Have you taken a look at the DataPlugins API? You should
    prefer the DataPlugin technique over the GPI file filter technique.
    To your question: There is no GPI-API
    function for creating groups, but you can use the DIAdem ToCommand interface
    for doing this. The attached example DLL shows how.
    Register the DLL within DIAdem and run the
    command “PropTest” in the module SCRIPT.
    “PropTest” creates new root attributes
    (“RPInt16”, “RPInt32”, …) and groups (“G1”, 
    …)in the data portal.
    Under the hood: The C++ function “PropTest“
    in „PropTestCmd.CPP“ creates for example new groups with help of the class
    “CDIAdemLayer”. “CDIAdemLayer” instances the DIAdem ToCommand interface and
    provides a lot of methods for the handling of attributes and groups.
    How does for example the method “RootPropertyCreate”
    work? It is really simple. DIAdem provides the script command “RootPropCreate“.
    Within “RootPropertyCreate” a string like “RootPropCreate("RPInt16", "DataTypeInt16")”
    will be assembled and with help of the ToCommand method “CmdExecuteSync”
    executed.
    Thomas
    Attachments:
    PropTest.zip ‏426 KB

  • Data Portal Group Collapsing

    Hello! I would like to know if there is a way to programatically collapse each group in the Data Portal. I am creating many new groups programatically and also have many groups in the portal. After each is complete, I must either manually collapse each group or scroll down. This isn't a big problem, but it would be great if my script could collapse the groups before finishing.
    Thank you!
    Julia

    Hi Beri,
    As of DIAdem 11.0 and later there is a new "Portal" object with which you can remote-control what is shown in the Data Portal.  The following command will close all the the Channel Groups:
    Call Portal.Structure.Collapse(Data.Root) 
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

Maybe you are looking for

  • Ad hoc connection doesn't work with my 3gs but works with my touch

    I setup an ad hoc connection on my laptop following a guide on the internet. I did this on windows 7 32bit, it worked for my ipod touch but for some reason it won't work with my iphone 3gs (upgraded with the latest updates) I connect to the wireless

  • What's wrong with this code (in recursion there may be a problem )

    // ELEMENTS OF TWO VECTORS ARE COMPARED HERE // CHECK WHAT IS WRONG WITH THIS PGM // there may be a problem in recursion import java.util.*; class Test Vector phy,db; public static void main(String adf[])      Vector pp1=new Vector();      Vector dp1

  • Special Character in Filename script - how do I escape it.

    Hello All. I'm attempting to call a file in sqlplus on a linux box. The file name has a special character. ex: i$_my_script.sql I've attempted to use @i$_my_script.sql @i\$_my_script.sql @i\\$_my_script.sql @"i$_my_script.sql" @'i$_my_script.sql' @'i

  • Issue withRAW files from Canon 5DMKIII in camera RAW 7.0

    Hello,  I use Adobe Photoshop CS6 with Camera Raw 7. Photoshop  Bridge CS6 do not recognize the RAW files from the Canon 5D Mark III, any idea? Thanks in advance.

  • Unicode

    Hi All,            I am working on ABAP-HR..I have some programs to be made Unicode enabled, however after doing the program UC enabled, I get a Type incompatible error in a DO Varying Loop. Please provide the alternate for DO n TIMES VARYING F FROM