DAQmx - Read AI digital values

Hi!
Simple question: Is it possible to read directly the discrete values from an analog input channel?
The result of a "normal" DAQ AI aquisition are DBL samples. In fact that the card converts the input voltage with an ADC into a digital value its waste of memory to use DBL for lets say a 12bit conversion. I use the following hardware, but this should be possible for every card:
- NI PCI-6110
- NI PCI-6711
Best regrads,
Michael
Solved!
Go to Solution.

Ok found it in the VI "DAQmx Read (Analog 2D U16 NChan NSamp).vi". Seems to be that nobody uses this... i never saw a LabVIEW example with such a simple way to read out the REAL AI data.
Best regards,
Michael

Similar Messages

  • How to run two DAQmx Read (Counter in + Digital in) simultaneously?

    Hello to all, i have following issue:
    I want to acquire a digital (UART like) bus signal. For this purpose i use a DAQmx Card (PXI 6070e). I need precise time information about time lenght of 0 and 1, so i use a counter. The counter is adjust to CI Semi Period(continuous samples) -> on the edge change i'll get a new measured time value. It works perfectly, but i newer know what kind of state (0 or 1) actually belongs to current value. Of course they changing with each edge, but i need to know that exactly. So i should take a digital input which watching the current state. Unfortunately i can not synchronise two DAQmx-reads.
    Finaly i should get two values:
    time value(counter) and his state(digital in
    ) to work with them. How can i do this?
    I use LabView 7.0

    [SRQ 211371]
    This is not a trivial taks but here is one way to do what you explained with a PXI-6070E and some external circuitry:
    1. Use buffered semi period measurement to measure the width of your pulses.(Meas Buffered Semi-Period-Continuous.vi)
    2. Use a buffered continuous analog data acquisition with external scanclock (e. g. Cont Acq&Graph Voltage-Ext Clk.vi). Maybe you should use a triggered example to start the acquisition at a defined time.
    Now you could connect your signal to the ScanClock input (PFI7) of the 6070E but then you only would acquire only a sample at either the rising or the falling edge. As you need a sample at both edges you need some external circuitry that generates a short positive TTL pulse at each edge (rising and fa
    lling).
    Sorry that I can't provide a solution for this circuitry but I'm pretty sure something like this should be available as a low cost IC.
    You may want to allow your signal some settling time after the scanclock pulse has occurred. In this case simply acquire data on two AI channels. The first channel is only a dummy channel. Connect your signal to the second channel. The delay can be adjusted with the interchannel delay.
    If anybody knows a good solution for the external circuitry or if anybody has a better approach please post it here.
    Best regards,
    Jochen Klier
    NI-Germany

  • Clearing daqmx read value

    Hello,
    When doing a single sample counter read using DAQmx in a while loop, is there any way to reset the data output on the DAQmx read task? For instance, say the value is 200, is there any way I can keep the task open and running and reset it to read zero?
    Thanks,
    David Joseph
    Message Edited by KY Wildcat on 11-16-2007 10:57 AM

    Hi KY
    There isn't a property or method in DAQmx for setting or resetting the count value when a task is running. You need to Stop and Start the task again. Otherwise, you can
    create your counter in software. If you wire the counter output to an indicator, you can then create a local variable and create the logic that will
    programmatically reset its value, e.g. when it exceeds 200.
    http://digital.ni.com/public.nsf/allkb/65E3DBC715998C3286256E900075B7F8
    I hope that helped,
    KostasB
    NI Applications Engineer

  • Is DAQmx Read limited to 9 digital channels?

    I'm trying to read multiple digital channels with DAQmx Read (Digital 1D Wfm NChan NSamp). The output the DAQmx Read vi is a 1D array of digital waveforms. If I put that output through Array to Cluster the resulting cluster seems to be limited to 9 elements, data[0] through data[8]. Is the DAQmx Read output limited to 9 digital waveforms? I'm using Labview 2009.
    Solved!
    Go to Solution.

    Converting an array to a cluster to use unbundle to break out the elements of the array is a hack.
    You should be using Index Array to get the elements.  You can resize that function so that you can have additional outputs.  You won't even have to wire up any constants for the indices usually.  The top element will be element 0, the next element 1, element 2, and so on down to the bottom of the function.

  • Daqmx read.vi timestamp incorrect problem (storing the timestamp from start task)

    Hello,
    I have a state machine with 1st state: configure DAQ where i have [daqmx create channel.vi --> daqmx timing sample clock--> DAQmx start trigger--> daqmx start trigger] connected in order
    sample clock in continuous mode, 10000 samples to read and sample rate 1000 Hz ,
    start trigger has rising edge selected with a dev1/PFI0 from a daq board.
    next state of SM is read channels which has daqmx read.vi set to 1d waveform  Nchan Nsamp.
    and the program first configures and goes to read channels state and is just waiting for the true value on PFI0,
    but the time stamp is not updated to current time/ when daqmx read starts instead it is getting the initial t0 from the time when it was in configure DAQ state of my SM in other words it stores the starting time when strart task.vi was run and then updates from then on.
    so in effect i am not getting the exact time stamp values while i am running the vi.
    i tried to build waveform by inputting the actual current time but the chart doesnot scroll and shows only few values each reading, when i tried to input the t0 from the waveform given out by read daqmx. vi, it then behaves normally..
    option #1 from this link says
    http://forums.ni.com/ni/board/message?board.id=250&thread.id=47648&view=by_date_ascending&page=2
    Try and do exactly what the driver does.  This
    will require you to do exactly what you are doing in the posted
    example.  Call the current system time immediately prior to calling the
    DAQmx Read and subtract dt * x where x is the number of samples already
    acquired.  This will require you to know exactly how many samples have
    been acquired.  This can be found by calling the Total Samples Per
    Channel Acquired property immediately prior to the DAQmx Read.  This
    introduces some points of innaccuracy.  For example, you're system time
    is already innaccurate to some amount.  In addition, it takes some time
    between calling system time, calling the total samples acquired, and
    calling the DAQmx read.  If 2 samples are acquired between calling the
    system time and total samples acquired, you could be off by a few
    samples.  For slower clock rates, you will have more accuracy. 
    but there are no samples that are acquired until the rising edge, so the number of samples is always zero before the read operation
    http://digital.ni.com/public.nsf/allkb/5D42CCB17A70A06686256DBA007C5EEA 
    this link says that
    and the number of samples in my waveform is constantly changing around 20-40, so i cannot really input the current time to build the waveform, thats what i can figure out for now..
    can somebody tell me why this is happening or is there any fix around this, how to get the current time into my daqmx read.viso it displays the currect time on my waveform chart
    Thanks,

    thanks,
    im using LV 8.6, daqmx driver 8.9.5.
    yes the program u posted get the currect time. but see attached program thats what i have in my program exactly
    if you took out the time to using the get waveform components using the waveform  from daqmx read. i still have the timestamp as the application start time. plz see attached code 8.2v and FP
    the waveform time x axis is not current, it is starting from the application start time.
    PS: samples to read = 10,000 and sample rate = 1000
    plz help..
    Attachments:
    daqmx read problemp.png ‏8 KB
    daqmx read problem.vi ‏36 KB

  • Analysing waveform for digital values stored in a file

    i have certain digitals values obtained in a file in .txt format.
    i have to obtain a waveform by giving the input as these digital values in that file.
    I have programmed for array input manually.
    But the waveform analysis should be made such that it do analyze automatically by taking the values stored in the file.
    The values are stored as like follows-
    0.00159
    0.01432
    0.01654
    0.15432
    etc
    Give me a module to do this task.

    Use the Read from Spreadsheet file and then just connect it to a waveform chart. This will do what you need. Post back.

  • DAQmx: Numerical indicators go blank intermittently using DAQmx Read

    Hello everyone,
    I was wondering if anyone else has ever fought this issue and won.  I have a loop (I will attempt to attach an image of the block diagram) which performs a DAQmx Read operation.  The loop employs a 200 millisecond wait.  The loop scales the data, sends all of the values to little indicators in an array, picks out a few critical values to display on duplicate large indicators, and optionally logs the data by streaming it to disk.  The task will usually (99.9% of the time) be run at 100Hz.  So, I was figuring I could do a "Read All", since at 200 ms of wait time due to the millisecond multiple wait function, I should always have around 20 points to read in the buffer the next time around.  This would allow me to have very current readings in my displays.  I could do a partial read, but then I figure I would have a lag between the displayed values and the reality of what's going on in the test.  Having current readings, as current as can be, is highly desirable for this application.
    I figured everything was good with what I was doing, especially when I tested it with a simulated device (I know a simulated device behaves much differently than a real device, especially at start up).  Everything seemed to work well.  When I go to the real hardware, though, I intermittently get blank indicators.  Actually, it is more like intermittent numbers in my indicators.  Most of the time, the DAQmx Read operation returns a null, empty array (no data available in the buffer).  I must be missing something, because I figured that a 200 ms wait would allow another 20 samples to be collected.
    If someone could please just ease my conscience and let me know that I haven't done something very fundamentally wrong in this code, even if you couldn't help me with a solution, I would very much appreciate it.  I feel that this code should work, keeping data in the indicators at all times, and don't know why it doesn't work.  If you could offer me the solution, even if it is to point out that I did something very wrong, I would much appreciate it.
    I am just writing this code, and still have some icons to make, so the sub VI's still have the default icons.  Sorry about that.  Basically all those do is get array subsets, or scale data, or write data to the data files.  If you need to ask questions about the code, I can understand.  I am not the greatest yet at writing self documenting code yet.  And if you need to know what that event structure does, it watches the two boolean button controls to determine what state in the state machine to go to next, and the time out case of the event structure highlights a data value if it goes out of bounds.
    Sorry if I am too wordy.  I have been accused of that before.  I just notice a lot of "Help!  DAQ doesn't work.  How do I fix?" posts, and I don't see how I or anyone else could help that person at all.
    I am using LV8.2, with DAQmx 8.3.1, on Windows XP, 1GB of RAM, and a fairly healthy Duo core processor.  I have a workaround where I throttle back the read operation, only reading 55% of the available samples, as reported by a DAQmx Read property node (the highest percentage I found that prevents the indicators from going blank).  This introduces a small lag between the real world and the data on display, however.  Also, it seems like a processor dependent solution.  I would have to tweak this percentage for every machine I run this on.
    If I have left anything important out, please let me know, and I will do my best to clarify, and thank to anyone who reads this, and a big thank you to anyone who takes the time to reply.  Again, I would be real happy with a "That code looks good to me, and your thinking is correct", if that indeed is the case.
    Thanks.
    Attachments:
    Log Monitor Block.JPG ‏292 KB

    Yeah, as you and Erik said, just specifying (Sample Rate / 5) as the '# to read' could do the trick.  Then you can ditch the 'Wait (msec multiple)' function.  I don't think I'd recommend the -1 = infinite timeout though.  I'm pretty leery of stuff that can lead to an infinite wait or an infinite loop.  Even a 1 sec timeout should easily be way more than enough.  Note however that this method depends on all your processing code executing in under 200 msec on average.  Otherwise, your reads will fall behind and you'll eventually get a DAQ buffer overflow error.  My earlier suggestion to first query for # available samples and then read the MAX of (# available, SampleRate/5) will prevent cumulative fall-behind effects.
    There's too many unknowns to speculate with any confidence on exactly why the software timing method didn't work.   I can point out some additional things that bear greater scrutiny though.
    1. You've got some sort of function dealing with file streaming that takes a path input and produces a path output.  This probably means that every loop iteration you're using the path to open a file, write data, and close the file again.  This actually may consume more than 200 msec, at least some of the time.  Because this runs in parallel with the msec wait function, something like the following could be happening:
    A. Iteration 1 proceeds as expected.  The DAQ read collects 20 samples, the file write consumes only 100 msec, and the wait msec function ends after 160 msec in order to end on a 200 msec multiple.  The wait function took longest, so your whole loop ends on a 200 msec multiple.
    B. On iteration 2, the wait msec function ends after 200 msec on the next 200 msec multiple.  The DAQ read collects another 20 samples (because it's been pretty much exactly 200 msec since the previous loop iteration started) right away.  However, Windows was busy messing with the file cache so this time your file write consumes 375 msec.  The file function took longest so your whole loop ends 175 msec into the next 200 msec multiple.
    C. On iteration 3, the wait msec function ends after 25 msec on the next 200 msec multiple.  The DAQ read collects 37 samples that have come in since the prior call 375 msec ago.  The file function consumes only 50 msec this time, ending the loop 25 msec into the next 200 msec multiple.
    D. On iteration 4, the wait msec function ends after 175 msec at the next 200 msec multiple.  The DAQ read collects the 5 samples that have come in since the prior call 50 msec ago.  Uh oh, not enough samples...
    One possible fix is to open the file outside the loop and leave it open until after the loop is done.  Opening and closing files has quite a lot of overhead.  Inside the loop, you'd be passing around the file refnum.  Doing this one thing alone might also be a way to fix your timing problem.  Along similar lines, you could write the data to a queue and then do your file writes in an independent loop that reads the data out of the queue.  You can search here for "producer consumer" for more info.
    -Kevin P.

  • Pantone Color Bridge - digital values vs book values?

    Hello,
    I've had to update our Pantone libraries for the CS3 suite to Color Bridge (for working with a 3rd party). I've downloaded Pantone's library update so I can access Color Bridge via the libraries in Illustrator and InDesign. When I convert from PMS to CMYK, the digital values match that of the book values, but when I do the same for RGB (sRGB) and web, the digital values DON'T match that of those in the book.
    Does anyone know why the RGB and web values differ digital to book?
    Thanks,
    Kristin.

    J,
    I understood from the other threads that the RGB value set was predetermined by the company, and not to be replaced by something from whomever (even Pantone).
    Apart from that, when you have the colour of a Pantone ink and need to substitute it by a CMYK and/or RGB value set, it will always be off in some way or another. And if you need to combine multiple substitute colours, they may very well be off in different ways with the conversions provided by Pantone, which means that they be more inferior to the Pantone inks than they need. Something similar may apply to cases with combinations of substituted Pantone ink colours and original CMYK/RGB colours.
    So at least in some cases there may be a better choice of CMYK/RGB values than a conversion provided by Pantone.
    In other words: who says that you agree, or should agree, with the (latest) conversion(s) provided by Pantone in each and every case?
    It may be worth noting that Pantone themselves have changed their mind about the best conversions more than once.

  • Compare two DAQmx Read modes

    For a continuous DAQmx acquisition, generally a start VI is put before a loop structure to request DAQ board to begin  continuously  reading data into buffer,  and  within loop  a DAQmx read VI is used to  continuously  retrieve data from buffer.
    My question is, for the DAQmx Read VI, is there any performance difference between  'Nchanel N Samples'  and 'NChannel  1 Sample'?  My understanding is, the former  read all data  available in  buffer,  so maybe we can use larger value for  waiting until ***ms function, and for the latter, since only one data is read in each loop, we need to use smaller waiting value, to catch up with the board acquisition speed, therefore meaning the loop structure need to be executed much faster.
    For my application, read only one data in each loop is easier for teatment, but I am concerning whether more frequent loop execution may cause decrease of performance. Any suggestion?
    Thanks.
    -Dejun

    I don't agree with you, Dennis, but maybe I am wrong
    Even though I use '1Sample' within a loop, there is still a hardware timing Vi before the loop, so the timestamp of each data point should still be determined from hardware timing, this is my understanding. The difference between '1Sample' and 'NSample' is just how many data are read from buffer in each loop execution. As to the timestamps of data in the buffer, they are already determined by the hardware timing, and therefore should be independent of how they are read in loop structure (1Sample or NSample).
    Message Edited by Dejun on 08-30-2007 05:16 PM

  • DAQmx Read changes DIO to output?

    wow, it's been a looong time - been doing PCB design (yuk!) but I'm glad to be doung some LabVIEW again... anyway, on to the question.
    Using a 6025 DAQ card, and an express vi (built from DAQ assistant), I'm sending a True to a specific Line of a Port. Next, I want to read that same Line on that Port. However, when I read it, the "bit" is reset - reads False. I think what is happening is, the direction of the DIO changes to an output when you read the Line / Port. Is that correct? So, how would I read that bit after setting it, without "resetting" it??? Seems like LabVIEW 101, but I'm stumped.
    Thanks,
    Richard
    LV 7.1
    Richard

    I think what is happening is, the direction of the DIO changes to an output when you read the Line / Port. Is that correct?
    You would have configured the Line as a Digital output, when you do a DAQ assistant 'write' to a digital line.
    When you try to read it, DAQ assistant will reconfigure it as a Digital Input and reset it to its default value.
    So, you cannot set a line and read its boolean value as you are trying to do.
    What you could do is make one line on port Digital Output ( write to it) and configure other Line as Digital input ( read on it)
    Hope this helps,
    Regards,
    Dev

  • Java API to read the Encrypted Values from Windows Registry settings

    Is there any Java API to read the Encrypted Values from Windows Registry settings ?
    My Java Application invokes a 3rd party Tool that writes the key/value to windows registry settings under : “HKLM\Software\<3rdparty>\dataValue”.
    This entry is in BINARY and encrypted with 3DES, using crypto API from Microsoft.
    3rd party software to encrypt the data stored in registry it
    either uses C++ code: and uses the call “CryptProtectData” and “CryptUnProtectData” or
    If it is a .NET (C#) it uses the call “Protect” or “UnProtect” from class “ProtectData” of WinCrypt.h from the library “Crypt32.lib.
    Note: The data is encrypted using auto-generated machinekey and there is no public key shared to decrypt the Encrypted data.
    Since the data is encrypted using auto-generated machinekey the same can be decrypted from a .Net / C++ application using CryptUnprotectData or UnProtect() API of WinCrypt.h from the library “Crypt32.lib.
    To know more about Auto-Generated MachineKey in Windows refer the links below
    http://aspnetresources.com/tools/machineKey
    http://msdn.microsoft.com/en-us/library/ms998288.aspx
    I need to find a way in Java to find the equivalent API to decrypt (CryptUnprotectData) and Microsoft will automatically use the correct key.
    But i couldn't find any informato related to Java APIs to enrypt or decrypt data using auto-generated machinekey.
    Is there a way to read the encrypted data from Windows regsitry settings that is encrypted using the Auto-Generated Machine Key ?
    Kindly let me know if Java provides any such API or mechanism for this.

    If the symmetric key is "auto-generated" and is not being stored anywhere on the machine, it implies that the key is being regenerated based on known values on the machine. This is the same principle in generating 3DES keys using PBE (password-based-encryption). I would review the documentation on the C# side, figure out the algorithm or "seed" values being used by the algorithm, and then attempt to use the JCE to derive the 3DES key using PBE; you will need to provide the known values as parameters to the PBE key-generation function in JCE. Once derived, it can be used to decrypt the ciphertext from the Regiistry in exactly the same way as the CAPI/CNG framework.
    An alternate way for Java to use this key, is to write a JNI library that will call the native Windows code to do the decryption; then the Java program does not need to know details about the key.
    That said, there is a risk that if your code can derive the key based on known seeds, then so can an attacker. I don't know what your applicatiion is doing, but if this is anything related to compliance for some data-security regulation like PCI-DSS, then you will fail the audit (for being unable to prove you have adequate controls on the symmetric key) if a knowledgable QSA probes this design.
    Arshad Noor
    StrongAuth, Inc.

  • How to run two DAQmx Read (Analog) at the same time?

    I would like to measure a voltage and a current,
    but the two cannot be conbined in one task.
    Therefore, I had to use two DAQmx Read in the same program. But it did not run.

    Multiple channel types can be combined in a single DAQmx Read. One way is to use multiple DAQ Create Channel fucntions. Look at the posting here and the second example at the link in the answer.

  • Unable to read the total value.

    Hi guys,
    I am able to get the total for alv table column.. but i want to display the total value  in some other text view field.
    In order to do that... first i have to read the total value, and have to set the same to text view field,
    total value is of type   ( DATA: LV_AGGR_RULE TYPE REF TO CL_SALV_WD_AGGR_RULE. )
    but my text view field attribute is of STRING TYPE.
    So am getting conversion error. Pleas help me in this.
    Regards
    Farooq
    Edited by: farooq basha on Jun 13, 2011 12:52 PM

    Hi ,
    Try to loop your internal table on the column "Amount" and make a sum for that particular column, u will get the required sum Amount..
    Thanks
    Aisurya

  • Frm-40502: oracle error: unable to read list of values

    Hi All,
    I am personalizing the assignment form, where we need to restrict the JOB LOV based on Organization value.
    In Forms Personalization we are creating the record group from query and attaching to Job field.
    The query is,
    SELECT DISTINCT j.NAME, DECODE (1, 2, 1, NULL) c_valid_job_flag,
    j.job_id job_id
    FROM per_jobs_v j
    WHERE j.business_group_id + 0 = :CTL_GLOBALS.BUSINESS_GROUP_ID
    AND j.date_from <= :CTL_GLOBALS.SESSION_DATE
    AND ( (j.date_to IS NULL)
    OR (j.date_to >= :CTL_GLOBALS.SESSION_DATE)
    ORDER BY j.NAME
    When we use this query, we are getting the error "frm-40502: oracle error: unable to read list of values"
    If i replace the bind variable with values we are not getting the error and its working fine.
    Replace query:
    SELECT DISTINCT j.NAME, DECODE (1, 2, 1, NULL) c_valid_job_flag,
    j.job_id job_id
    FROM per_jobs_v j
    WHERE j.business_group_id + 0 = 202
    AND j.date_from <= TRUNC(SYSDATE)
    AND ( (j.date_to IS NULL)
    OR (j.date_to >= TRUNC(SYSDATE))
    ORDER BY j.NAME
    how to use bind variables (Block.field) here? We are getting this error only when using the bind variable in the query.
    Please share your ideas.
    Thanks.

    Hi;
    What is your EBS version? There are 96 docs avaliable about similar error message. I suggest use metalink for your issue
    You can also check:
    FRM-40502: Oracle Error: Unable To Read List Of Values [ID 1161404.1]
    Frm-40502: Oracle Error: Unable To Read List Of Values. [ID 351931.1]
    FRM 40502: Oracle Error:Unable to Read List of Values [ID 179162.1]
    Regard
    Helios

  • How to read the selected value of a dropdown list box

    Hello,
    I have 2 custom fields which are of type dropdown list on Accounts(CRMM_ACCOUNT) PCUI application details tab.I need to read the selected value of first dropdown list item,based on that second dropdown list will be populated.
    I know where to populate the dropdown list box,it is in FILL_DROPDOWN_LISTBOX.
    I dont know how to trap the selection made on dropdown list.
    PLease guide me on how to trap the dropdown list field selection value.
    Thanks in advance.
    Thirumala.

    Hello,
    Check what is done in standard for the fielf REGION which is inked to the country.
    Otherwise, you can do the following :
    - in field group customizing, for field 1, flag the 'send request' flag. So, when you change the value in this field via the dropdown, the MAC methods are immediately called.
    - Put the new value in a global variable (GV).
    - in the fill_dropdown_listbox method, get the value from this GV and based on it, filter the values for the dropdown of field 2.
    Hope this will help you,
    Regards,
    Frederic

Maybe you are looking for

  • MacBook Pro will not boot up

    Hello, My three-month-old MacBook Pro refuses to boot up. The problem began about two days ago, and since then, the situation hasn't changed. When I press the power button, the Apple logo on the boot screen appears, but it quickly flashes on and off,

  • Custom Report For Vvendor Evaluation

    Hai All, My client requires custom report to show the vendor evaluation i.e., it has to show the working how it has arrived at the final score, to be clear systems works automatically and displays the final score based on certain main and sub criteri

  • Make VPRS Mandatory at billing, not at Sale Order

    Hi I want to make VPRS mandatory at Billling (VF01).... I know that as a std setting. it can be made mandatory from Pricing Procedure in SD.. But that will prevent creation of Sale Order What the user wants it it shud allow creation of sale order, bu

  • Dvd drive not playing discs?

    I have a first gen macbook pro with a matshita dvd-r. i never plays any burned dvd's and it has issues with regular dvd's has anyone else had any problems? the dvd player on my sony PS2 works better than this one.

  • Adjustment brush sliders missing in LR4 when trying to manipulate masks originally created in LR3

    I am trying to re-edit some of my birding photos (CR2 raw images).  I have difficult masks that were created in LR3 and took alot of time due to feathers on a complicated background.  I do not want to have to re-mask everything in LR4.  When I have i