Selecting DAQ channels by arrays of strings for scxi 1102/4c

Hello,
I have an urgent matter - for my project I have to modify DAQ analog acquisition on several machines. The existent applications use definitions of virtual channels AnCh0-63, and they select them by DAQ constants which are connected to AI Acquire Waveforms. Now I need to make one program for all machines (different slot numbers of the cards) that will retrieve channel selection from a database (LV 7.1, MS SQL Server 2005).
Is there a way to directly use the DAQ constants by feeding them strings from the database? The catch is that the company wishes to keep the existent programs and use a database for storing and loading parameters. Otherwise I tried with global-channel definition strings (obx!scy!mdz!0,2,...,n) but there were problems with some combinations of channels.
Thanks in advance!
simon

Hello Simon,
If I am understanding the question, you want to use the same program
you have been using (which uses our "legacy" driver, Traditional DAQ)
and want to integrate that into a database system.  The trick seems to
be inputting the various inputs into the AI Aquire Waveforms directly
from strings you have aquired from your database.
If my understanding is correct, then we want to convert strings into
the data types required by the VI.  The channels input can be fed a
string directly (as long as it is in the format it expects), while the
other inputs require numeric values.  You can convert strings into
numerics with the Decimal String to Number VI (Functions
Palette»String»String/Number Conversion).  Using these, you can then
input the correct inputs:
You can also parse strings with the string manipulation VIs (Functions Palette»String) if you need to.  I hope this is the information you are looking for, your application sounds like it could save a lot of time in the long run.
Message Edited by Neal M on 11-28-2007 02:45 PM
Neal M.Applications Engineering       National Instruments        www.ni.com/support
Attachments:
TDAQString.JPG ‏10 KB

Similar Messages

  • Selected physical channels to array

    I would like that after select several channels of differents devices (with DAQmx Physical Channel component), this selected channels will be put in the array.
    I look for forum but I didn't find anything.
    If somebody already tried to do this, please send me suggestion.
    Thx for all
    Look in the attached picture.
    Leonardo de S. Cavadas
    Maintenance Engineer and Inspection - Bureau Veritas do Brasil
    Engineer Metallurgist with emphasis in Advanced Materials
    Technologist in Computer Science
    Attachments:
    physicalchannel.JPG ‏39 KB

    Chris,
    Now you will understand what I want. I didn't expressed well. Look for attached VI
    Leonardo de S. Cavadas
    Maintenance Engineer and Inspection - Bureau Veritas do Brasil
    Engineer Metallurgist with emphasis in Advanced Materials
    Technologist in Computer Science
    Attachments:
    physicaltoarray.vi ‏11 KB

  • Search Array of String for exact match words

    I need to create a search feature.
    There will be a textfield where the user will input a word or words.
    Then I need to check if the are any reference in the array of names.
    namesArray ["ocean in the sky", "cean on sky", "cean is white"];
    keywordsArray ["cean", "sky"];
    matchCounter = 0;
    If I input the word "cean" I dont want in my results "ocean in the sky", only "cean is sky".
    I have the following code:
    for (var j:int = 0; j < namesArray.length; ++j)
         var tempStr:String = namesArray[j];
         for (var k:int = 0; k < keywordsArray.length; ++k)
              if (tempStr.indexOf(arrayKeywords[k]) != -1)
                  matchCounter++;
         if(lengthKeywords == matchCounter)
              trace("yeahhh... there's a match!!");
         matchCounter = 0;
    Is there a better way? How can I do this?

    There are few things but the main problem is that "new RegExp()" needs double escapes ("\\")
                var namesArray:Array = ["ocean in the sky", "cean on sky", "cean is white"];
                var keywordsArray:Array = ["cean", "sky"];
                for (var j:int = 0; j < namesArray.length; j++){
                    var matchCounter:uint = 0;
                    var tempStr:String = namesArray[j];
                    for (var k:int = 0; k < keywordsArray.length; k++){     
                        var regExp:RegExp = new RegExp("(\\s+|^)" + keywordsArray[k] + "(\\s+|$)"); 
                        if (tempStr.search(regExp) > -1){
                            matchCounter++;
                    if(keywordsArray.length == matchCounter){
                        trace("\"" + namesArray[j] + "\" matched all the keywords");
    Traces:
    "cean on sky" matched all the keywords

  • String of letters to 1-D Array of strings for spreadsheet

    What I would like to do is be able to take this string as it is the A's and B's that are being generated as the program runs,
    I would like to take this string and get it into file in delimited tabs just as the numbers are. If there is a created 1-D array of
    strings that works, but that is controlled on the front panel, I would like to create this from data that is comming in. In other words
    I am stuck on how to create a 1-D array of Sting from the string value comming in. I want to do this so that I can get all the different
    values A's or B's into the different tab fields. As it is they are comming all up in the first column and not "tabbing" Please see the
    attached file in the rows 5 an
    d 7.
    Thanks,
    Brian
    Attachments:
    Array_of_strings_to_spreadsheet2.vi ‏28 KB
    Turn_data1.xls ‏1 KB

    Brian
    You need to convert your string to contain single tabs as separator. The problem is that your string is "dirty", i.e. it contains a variable amount of spaces to seperate the items. If you strictly had single space separators, you could just replace all spaces with tabs.
    "Scan string for tokens" by default does not allow empty tokens, thus takes care of the multiple spaces.
    The attached simplified code assumes a fixed number of items (12), if this is a variable, you need to use a while loop and sense the end of the input string. Let me know if this is clear.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    StringToArrayofstringsToSpreadsheetstring.vi ‏21 KB

  • Array of String for input paramter + dynamic invocation

    Does anybody know a place I can find an example of web service
    using the following methods:
    1. Array of String as input parameter
    2. Client uses dynamic invocation
    Specifically, 1. how do I define the parameter type in web-services.xml?
    2. how do I refer to the type in a client code?
    Thanks,
    Hong

    Hello,
    The doclitparam interop round 3 example does a echo string array.
    http://dev2dev.bea.com/managed_content/direct/webservice/r3server.zip
    Also there is a DII example in the WebService Wizard's archive:
    http://dev2dev.bea.com/managed_content/direct/webservice/wswa.html#qz29
    HTH,
    Bruce
    Hong wrote:
    Does anybody know a place I can find an example of web service
    using the following methods:
    1. Array of String as input parameter
    2. Client uses dynamic invocation
    Specifically, 1. how do I define the parameter type in web-services.xml?
    2. how do I refer to the type in a client code?
    Thanks,
    Hong

  • Scan order and empty channels for SCXI-1102

    Hello-
    Sorry for the cross-board re-post, but I really need to get this answered asap.
    I have two SCXI-1102 cards in my chassis, all measurements will be routed to ch0 of the PXI-6229 that is also in the chassis. For design reasons, I prefer to use about 2/3 of each 1102, and thus leaving about 1/3 of each 1102 empty.
    Should I populate the channels in any particular order? Eg should I start at ch0 or ch31, and which direction is the scan order? e.g. 1102a/ch0 -> 1102a/ch15 and then 1102b/ch0 -> 1102b/ch15 OR say 1102a/ch15 -> 1102/ch0 and then 1102b/ch15 -> 1102b/ch0
    Does this matter AT ALL with a PXI/SCXI system? I know with many DAQ devices (E-series for example) you must scan in descending order (eg. 7,6,5...0) so it makes more sense to start populating the last channel first and then leave the lower-numbers empty.
    thanks-
    brad

    Please see this post.
    Regards,
    Natasa

  • MV/psi input for SCXI-1102 using SCXI-1308?

    Is there a way to physically connect a mV/psi signal to an SCXI-1102 that is also using a SCXI-1308 terminal block? From what I have read, the terminal block can only use a 4-20 or 0-20mA signal, right? I don't see any pins that the terminal block doesn't plug in to to use for the pressure sensor's mV output.
    Thank you for the help!
    tq
    Solved!
    Go to Solution.

    Hi FMC_Pumptest,
    The 1308 terminal block is designed for current input. You are right that with that terminal block you will only have inputs for 0-20 mA and 4-20 mA signals.
    Regards, 
    James D.
    Applications Engineer
    National Instruments

  • What is the best way to convert a cluster into byte array or string

    I'm writing a program that sends UDP packets and I've defined the data I want to send via large clusters (with u8/u16/u32 numbers, u8/u16/u32 arrays, and nested clusters). Right before sending the data, I need to convert the clusters either into strings or byte arrays. The flatten to string function is almost perfect for this purpose. However, it's appending lengths to arrays and strings which renders this method useless, as far as I can tell. 
    As I have many of these clusters, I would rather not hard code the unbundle by names and converting/typecasting to byte arrays or strings for each one. 
    Is there a feature or tool I am overlooking? 
    Thank you! 

    deceased wrote:
    Flatten to string has a boolean input of "Prepend string or array size" ... The default value is true.
    That only specifies if a string or array size should be prepended if the outermost data element is a string or array. For embedded strings or arrays it has no influence. This is needed for the Unflatten to be able to reconstruct the size of the embedded strings and arrays.
    The choice to represent the "Strings" (and Arrays) in the external protocol to LabVIEW strings (and arrays) is actually a pretty bad one unless there is some other element in the cluster that does define the length of the string. An external protocol always needs some means to determine how long the embedded string or array would be in order to decode the subsequent elements that follow correctly.
    Possible choices here are therefore:
    1) some explicit length in the protocol (usually prepended to the actual string or array)
    2) a terminating NULL character for strings, (not very friendly for reliable protocol parsing)
    3) A fixed size array or string
    For number 1) and 2) you would always need to do some special processing unless the protocol happens to use explicitedly 32 bit integer length indicators directly prepended before the variable sized that.
    For number 3) the best representation in LabVIEW is actually a cluster with as many elements inside as the fixed size.
     

  • Select multiple channels for one task - control and shift keys don't work

    Hi,
    Following advice from several other posts, I'm trying to select multiple physical channels  from the dropdown list so that I can then use the "unflatten channel string" function later on. It looks like if I hold down either shift or cntrl I should be able to select multiple channels from the list, however, this doesn't work for me. I tried going into the "key navigations" property for the task channel control but it doesn't have any associations listed. Has anyone else come across this and found a fix?  I have previously got around this by stating multiple channels with a colon (eg. ai1:3) but this doesn't work for the unflatten function.
    Thanks, 
    Claire.
    Solved!
    Go to Solution.

    Thanks for your reply Dennis, I see what you mean, unfortunately that doesn't solve my problem so I'm missing something else. I've attached my VIs. I expected that the output from the unflattenstring block would be an array of either the channel references or the names I had given them, and that therefore the "array size" in the 4th pane would be "9" (equal to the number of channels).  Instead the output is a an "unnamed task#(some number)" when I look at it with a probe. Perhaps I'm misunderstanding how the task naming works?
    THanks, 
    Claire.
    Attachments:
    Analog SW Trigger_v3.vi ‏33 KB
    Cont Acq&Graph Voltage-Analog SW Trigger_cfjv3.vi ‏64 KB

  • Using a menu ring to select DAQ device channel and indicator

    Hi,
    New user here. I am using the DAQ assistant with multiple analog inputs. I would like the front panel to have a menu ring where the user can select which channels are to be active. Also, this corresponds to a single graphical indicator. 
    Currently I have a VI that displays all channels each with its own indicator. I want to simplify the front panel so that a user can simply use a menu ring to select and focus on what he/she is interested in. Is it possible to use the Select Signals Express VI to implement this?
    Thank you!

    Drop the DAQ Assistant or convert it to regular DAQmx functions. The physical channel control does all that. Just look at the shipping examples.

  • 1D Array Of String To For-Loop

    Hi fellow engineers,
    I'm new to LabVIEW.
    I got a question,
    If I got a 1D array of string and I want to loop my program to the same number of times (Iteration) in conjunction with the numbers of sub-folders generated by the "list folder" function. How can I do it?
    Any help is greatly appreciated.
    Solved!
    Go to Solution.
    Attachments:
    Capture.PNG ‏7 KB

    Wire the string array to the border of the for loop. LabVIEW will automatically iterate through each element of the array; you should not wire anything to the N terminal of the for loop. This is the default behavior for arrays entering a loop; if you do not want auto-indexing, right-click on the tunnel (where the array enters the loop) to change the behavior.

  • DAQ output to "Array to spreadhseet string"

    Please see attached and advice what I am doing wrong.  Cannot connect DAQ output to Array and write a file.  Thanks for any help you can provide.  This is in LabView 8.0.
    Attachments:
    Battery Test 2.vi ‏81 KB

    You guys have been so helpful and I am amazed at your knowledge level.  I have revised my program using your inputs.  I have moved to one while loop and moved the report writing function outside the loop assuming that the report will be written once per Dennis' inputs, reduced the sampling size significantly per Ravens Fan's inputs and RTSLVU's inputs on getting rid of the connection errors. 
    One question I have is shouldn't this not be a 2-D output i.e. Voltage vs. Time?  Please see attached and kindly offer any inputs you may have.  I will appreciate anything you can comment on in programming or dressing up the front panel.  My experience level with this is one month.  Thank you so much.
    Attachments:
    Battery Test 3.vi ‏80 KB

  • Enabling disabling several DAQ channels

    Hello. I'm just about to start my first 'biggish' project with labview using a Compact DAQ system. :-)
    I am using a 16 channel thermocouple module. On the front panel, I want the user to be able to select which channels on the TC module
    they want to aquire data from.
    Once the channel selection is complete I need to be able to send the channels which are to be aquired to the create channel VI to start the aquisition from the required channels.
    I know how to use the create channel VI to aquire multiple channels but i need to work out this selection method somehow?
    I want the channels to be selected on the front panel by using a checkbox.
    I know that i will have to use a DAQmx Global Channel to input the channels.
    Thank you in advance,
    Rhys

    Below is a way to create a channel list that you can send to the Create Channel vi.
    1) Create a string array constant and enter the channel names
    2) Create array with your checkbox booleans
    3) Use a for loop with a shift register to build channel string
    Note that if no channel is selected the string would be empty which will give an error if you wire it to the Create Channel vi.
    So you have to check for this and prompt the user to select at least one channel.
    But ... I probably would not do it this way. 
    Instead of selecting the channels to be acquired as you have proposed, I would acquire all of the channels all of the time.
    Once you get the "all" channel data - you can then choose which channel data to use based on your checkboxes.
    Benefits:
    1) Your acquisition code never changes
    2) The array of data returned from the DAQ will always have the channels in the same place - making life easier for you
    steve 
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.

  • How can I select a channel on the RT target with a VI on the host?

    Maybe I'm trying to pound a square peg into a round hole, so please let me know if I'm abusing LV, but ...
    I'm trying to parameterize our RT VI app that deals with digital output channels.  We use the same basic VI for multiple configurations.  The only thing that changes is the channel allocations.  So for instance, actuator 1 is on port0/line5 for one configuration and port1/line2 in another.  I really don't like the idea of modifying the VI every time we have a new configuration because it makes configuration management insane.  If I make a change to the basic VI, now I have to upate N copies of the VI and hope I catch everything.
    So I'm making the main app VI read an XML configuration file that specifies all the allocations.  Sounds great at first, but how do I create the XML file?  I created a VI that manages the data in the VI, allowing the user to add/remove channels and edit the name and channel and then save it to an XML file.  The configuration is comopsed of an array of clusters, with the cluster containing the name and DAQmx channel.  My intent was to let the user select the channel from the list of valid channels by using the DAQmx Global Channel control.  But the problem is, the configure VI runs on the host, which doesn't see any of the channels because they are on the RT target.  But if I try to run the configure VI on the target, it refuses to deploy because I have GUI widgets.
    Is my approach fundamentally flawed?  Is there a better way of parameterizing our VI?  Or is there a trick to getting access to the valid channels on the host VI?  The information MUST be available because after all, when I modify a target VI and select a global channel constant, I'm doing this on the host.
    Thanks,
    Keith.

    Hi Keith,
    you can handle the channels like "normal" strings. See the attached picture.
    Hope it helps.
    Mike
    Message Edited by MikeS81 on 07-25-2008 06:46 AM
    Attachments:
    Unbenannt1.PNG ‏6 KB

  • Configuring DAQ channels through LabView program

    Hi,
    I want to scan one analog input of PCI 6025E every 250 msec and I scan 8 such channels. I am using AI Sample Channel VI to do this and for its channel input I am feeding a string (with channel name) that is typecasted using a Traditional DAQ channel constant. All the required channels are configured using this constant. However this VI doesn't seem to be portable. When I use it on a different machine, the constant shows no channels defined.
    Is there a way to configure DAQ channels through my program such as to make the program portable? I came across notes that mentioned DAQ global channel but I don't know how to use it.
    Thank you in advance,
    Sharmila

    One of the great things about DAQmx is that there are only 4 basic VI's to learn to use. The Configure, Read, Write and Stop. The same Configure VI that was used to setup the analog input channels can be used to setup analog output, digital in/out and counter in/out.
    The small menu on the bottom of the VI is actually a listing of all the different operations that this single polymorphic VI can do. Click on the down arrow and you'll see what I mean.
    I've modified the example to read DIO lines 0-3 and write to lines 4-7 on Port 0. Again it programatically builds the channel list so it will always refer to the correct device. To create individual channels for a digital line, you first specify the device, then the port, then the line or lines. Example, to create a task for lines 4-7 on port 0, you would use "Dev1/port0/line4:7".
    Notice that the "DAQmx Create Channel.vi" is the same one used in the analog input configuration, but with different polymorphic selections. Also note the "DAQmx Read.vi" is the same except for the selector.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    Build Task and Scan Channels with DIO.vi ‏127 KB

Maybe you are looking for

  • On this iphone activated limit the number of free accounts that do?

    on this iphone activated limit the number of free accounts that do?

  • Problem after upgrade to version 2.0

    HTMLDB does not work after upgrade to v2.0 all scripts executed without error but i see error on htmldb LOGIN page after Oracle HTTP server restarted IE show error : Line : 55 Char : 1 Error : Object expected And line 55 is <div style="float:right;">

  • Illustrator CS 6 upgrade

    Hi, I have bought an upgrade,  Illustrator 6 from Dustin. I have got a confirmation mail  from Adobe with the serial number, but how do I do to be able to download the upgrade? Kind regards Annie B

  • Make a JButton look like it is pressed

    I am setting up a JButton so that it operates like normal when you left click but if you right click it should act like it is being pressed until the next time you right click it. My problem is that when it is right click activated I want it to paint

  • How can I get the name of the operating system?

    I need to know it for my application cause I wanna run an exec command which is different on win9X and on xp.. 10x