Comedi read command and acquire waveforms VIs

I am wondering about the implementation of the comedi read command in the VIs I got from the NI site.
One of the VIs is called "acquire waveforms" which calls "comedi read". everything seems to be working fine, but I am very curious about a small part of the comedi read VI.
If you look closely at it, you will see that after reading in the samples using the CIN that just calls read() , there is a formula node that basically asks the VI to save only the first half of the array. I am wondering why this would be so? Does it have to do with the way read() works?
I tried changing the VI so that the all bytes from the read() call are entered into the "data" array. But when I do this, labview gets stuck.
any ideas?

Hello:
This question belongs in the Measurement Hardware Driver Delvelopment Kit (DDK) Forum located here:
http://exchange.ni.com/servlet/ProcessRequest?RHIV​EID=101&RPAGEID=8&RFORMNUMBER=3&RHIDETAG=TRUE&UCAT​EGORY_0=_321&UCATEGORY_S=0
The Comedi driver set is supported by www.comedi.org but you might get some answers from the DDK Forum as well.
Sincerely,
Brooks B
Applications Engineer

Similar Messages

  • VISA Read Timeout and VISA Write not working

    I'm writing a program that sets a triangle wave pattern voltage (using Triangle Wave VI) to a DC power source (GWInstek PST-3202) through a RS-232 connection.  I know my instrument parameters are set up correctly because I've been able to control this power source using a different VI with the same parameters.  I also know I am connected to the power source because I can talk to it using MAX.  I have a string indicator before my VISA Write statement that shows me the command being sent to VISA Write.  It shows the correct syntax for setting a voltage on this instrument.  However, when I run the VI, the voltage is not changed on my instrument, even though the correct command is sent to the instrument.  After the VISA Write operation I have inserted a VISA Read function in order to read the newly set voltage from both a numeric and a waveform indicator.  Using the Error Out cluster I am able to see that there is a timeout error from VISA Read.  I thought perhaps I needed to clear or flush the buffer after each Read statement, but that didn't work either.  I'm stumped as to why VISA Write isn't writing to the device.  I have included my VI below, as well as the initialization subVI for the power supply.  
    Attachments:
    Triangle Volt Mod.vi ‏27 KB
    GW Instek initialization.vi ‏18 KB

    Yep, you need to append the End of Line character to the end of your command.  And for your read to work properly, you need to request the data.  That requires a querry command to be sent.  Look closely at the differences in command and communication structures between your working VI and your mod.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • AI Acquire Waveforms High and Low Limit

    Hey everybody,
    I am currently working with Labview 7.1 and a daq card. I am collecting 4 channels and using ai acquire waveforms to do this. I want to have different high and low voltage limits for each channel though. Is there a way to do this with ai acquire waveforms or would can I use something else.
    Thanks for the help!
    Devon

    Hey Devon,
    In addition to what David said, there is a great knowledgebase article here with more information about setting multiple ranges for Analog Input.  The Traditional DAQ vi, AI Acquire Waveforms, doesn't expose the ability to set multle input ranges per channel, but there is a quick fix that you can do to be able to add it to the vi.  See below:
    The block diagram of the AI Acquire waveforms is as follows:
    As you can see, the inputs of the vi that are exposed are simply the first element in a array of clusters including the high and low limits per channel.  To set the high and low limits for other channels, you need to simply add another element to the array for channels 1, 2, and 3.  See below:
    Here you can see I simply added one element, you need to add 2 more for your 4 channels.  If it turns out that you are using DAQmx and this doesn't apply, please refer to the knowledgebase above for details and an examples on how to set different ranges.
    Regards,
    Paul C.

  • Sending commands and reading data - RS232

    Hello guys !
    I have a special problem communicatin through RS232 with a PIC microcontroller.
    The problem :
    On push of a button i want to read a value from the microcontroller.
    On another push of a button, i want to write a value to the microcontroller.
    However, i get an error : "VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed."
    I've tried to search the forum for similar problem, but i haven't found a suitable answer.
    I also post my current code for reference. I'm using LabView 8.5.1.
    The RS232 communication is working fine (i can read and write from the PIC).
    I tested the connection extensively so i think that te problem is not there.
    Can u help me ?
    Thank you !
    Attachments:
    Serial-1.vi ‏53 KB

    Are you waiting for a response from the device after you send it a command? Are you getting any data back? A simple delay is not a very good solution since your program may work for one given situation but the hard delay may not in others. You can use a VISA event to wait for data at the serial port. How much data are you expecting? If it is a larg eamount of data you may want to calculate the timeout for the read based on the amount of data and your given BAUD rate. If you expect a large amount of data you may not have your timeout set long enough for all the data to arrive, especially if you are using slower BAUD rates.
    I noticed in your code that you have enabled the read to look for a termination character. Does your device send one? If not, you may be getting the error because you have not received the 1000 bytes you indicating you want to receive. If you will not be getting a termination character and you don't know how much data you will be receiving you need to create some type of algorithm to read data and decide when to stop. Th eapproach I use is to read a single byte. This read will contain the maximum timeout to wait for the data to arrive. Once a single byte has been read I continue reading chunks of data using a small timeout value. This value should be long enough to allow any small delay that occurs in the data as it is being sent from the device but short enough to indicate the data is complete once a timeout does occur. This timeout error is discarded since it is not a true communication error.
    NOTE: You should avoid using controls as variables. You have your Byte to Read controls set as default values and hidden. Therefore they are nothing more then a constant. Hiding controls simple to hide "variables" is not a good coding practice. Either expose the controls to teh user or use a constant.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • [svn] 1978: Bug: vendors. properties file which is used in vendor specific login commands was not being read properly and as a result some login related error messages were not being displayed correctly .

    Revision: 1978
    Author: [email protected]
    Date: 2008-06-06 08:05:34 -0700 (Fri, 06 Jun 2008)
    Log Message:
    Bug: vendors.properties file which is used in vendor specific login commands was not being read properly and as a result some login related error messages were not being displayed correctly.
    QA: Yes - we need automated tests to make sure that errors.properties and vendors.properties in BlazeDS/LCDS are loaded properly.
    Doc: No
    Modified Paths:
    blazeds/branches/3.0.x/modules/common/src/java/flex/messaging/util/PropertyStringResource Loader.java
    blazeds/branches/3.0.x/modules/opt/src/jrun/flex/messaging/security/JRunLoginCommand.java
    blazeds/branches/3.0.x/modules/opt/src/tomcat/flex/messaging/security/TomcatLoginCommand. java

    I have a lot of grief with this version of Windows Media Player.
    It is very buggy and frustrating to use.
    I have my Music library on a QNAP NAS, which is as reliable as they come.
    System notifications make it not save changes.  It also does not do a good job of interpreting albums and artists from folders.  Changes to track names are not saved, nor are tracks moved to other albums, renamed albums, changes to genre, artist
    or date.  It separates and merges albums/tracks without sense or reason.  Some changes I've made up to 4 times, then closed WMP and re-started my machine to check if it has/hasn't saved the changes.  Often it has not.
    This is the first time I've used WMP in this capacity, and I do not recommend it.
    New service pack please.

  • VISA READ STRING and GRAPH

    I have some basic questions:
    1. I have Serial communication from PXI to device. When I read the string of 26characters, continously, on Hypertermianl. It is fast enough. But when I read in the VI program, simple VISA read.
    The reading is very slow. The VISA read one character at a time and take time to make a string of 26characters. Visa read is very slow, Why?
    The baud rate is 1152K and rate is 32 updates per second, which is super fast in hyperterminal but very slow in Labview VI.
    2. Second I  need the extract the some data from my string at different positions on a string of 26 characters. I already made the subVI for reading it but since the VISA read is slow to read it gives wrong values from the string.
    So I thought I can make an array and ask the subvi to read the the second (i.e n-1 value) 26 characters which are ready rather than first one which is being formed. But there is no arrays for string.How can I do that? also my concern is if I read n-1 value, it is not real time value.
    :8 -0582                                n value Visa read slowly
    :000000 -0076U 0008 -0582   n-1 value
    :000000 -0074U 0008 -0582  n-2 value
    :000000 -0075U 0008 -0582  n-3 value
    3. I will extract the 74, 76, 77 etc say the value as AA. I want to plot the graph of value AA versus Seconds? How can generate Seconds on my X-axis?
    Attachments:
    TSS1-porem-final4.vi ‏16 KB

    Thank you for suggestion!
    Now I am receiving data continuosly.
    1. As mentioned previously, I wish to plot the heave value on real time basis, I saw the shipping example, modified my VI.
    The plot is not correct, as the heave value increases and decreases linearly but there is strange graph.
    2. Also I have one more question, actually if I want to find out the heave value, device once moved up 10cm and brought back to 0 level again. Its not instant as the design of the device says it takes 2 secs to get back to the zero state again. The heave is read from 10, 9, 8,7 6, 5, etc. It takes 10 steps to come back to normal value, zero value.
    I just need to plot the 0 and 10cm or may be  next might be -5cm, I need to capture the final data. How can i do that?
    Attachments:
    TSS1-porem-final4-1.vi ‏16 KB
    MRU-TEST3-1.vi ‏20 KB

  • Difference between VISA READ buffer and string

    Hello I am just starting to use the VISA read and write function in labVIEW
    anybody knows what are the differene between VISA Read buffer and string? and comparison of VISA Write buffer and string
    thanks 
    Solved!
    Go to Solution.

    Hi Ein,
    "read buffer" is the label of the string given by VISARead, "write buffer" is the label of the string expected by VISAWrite!
    So there is no difference...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Error in acquiring waveform from the agilent 54621A oscillosco​pe .

    error  1074003951 occurs when  acquiring waveform from  the agilent 54621A oscilloscope.
    I have installed
    agilent 546xx series instrument driver
    NI VISA 14.0

    The *IDN command is sent and i have chequed the VISA read it returns the correct string .The error still exists i have attached the block program
    Attachments:
    AGILENT 54621A Acquire Waveform.vi ‏16 KB

  • AI acquire waveform. vi update rate

    Hello,
    I would like to increase the update rate ( which governs how many samples are acquired per second) for the attached vi- AI Acquire Waveform(waveform).vi.
    This vi is a built in vi obtainable from Analog Input palette under Measurement I/O.
    The update rate preset is 1000 samples per second, i want it to be 10,000 per second.
    If i type it manually, it doesnt stay and reverts back to 1000.
     I am using LABVIEW 8.6 on Windows XP machine
    Thank you very much and Regards
    poli
    Solved!
    Go to Solution.
    Attachments:
    AI Acquire Waveform (waveform).vi ‏14 KB

    Hi Poli
    Have you looked at the the daq examples. Labview is shipped with a lot of examples. Also are you running this by using the continuous run button? That button is for debugging only, and it is a no-no to use it for other purposes
    If you are new to Labview perhaps some of the online basic lessons will do you good.
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • How to read a seriell port with VISA correctly?

    Hello
    I have the following system: A Nanovoltmeter from Agilent, modell 34420A, LabVIEW 7.1 and XP as operative system on the computer. The voltmeter reads 1024 readings and store them in the internal memory. By using a command I can collect the readings via the GPIB or seriell port. I use the seriell port. Therefore I use the VISA routines in LabVIEW. I configure the seriell port, read the number of bytes at the port and finally read the data from the voltmeter. Everything works, except that I found out it doesn't collect all the readings. I tried using Waits between sending the command and reading the data. It doesn't help much. I tried then the VISA session in the NI-Measurement & Automation program. I couldn't collect all the data by just one Read command. I had to use at least two or three Read commands to collect all the data. I wonder, if I use the routine to get the number of bytes at the seriell port of the instrument shouldn't I get the whole number of readings stored in the instrument? I tried using a high fixed number, reading more data than available. I got more data but still not all 1024 readings.
    Normally I use GPIB communication but I start wondering if there might be a similar problem.
    Regards

    Hi Maddin,
    You can place your read vi into a while loop that monitors (after a brief delay) if there is still data in the serial buffer. The loop would be wired to the vi which checks for serial data. Unfortunately, I do not have LV installed on this machine, so I cannot tell you the names of the vi's to use. But I'm sure you get the picture.
    - JLV-

  • How to use AI acquire waveform.vi for continuous acquisition

    Hello all,
    I am using LabVIEW 5.1 and PCI-6023E to acquire a voltage signal continuously, display the acquired data on a chart(display one minute of data at a time)then save all the acquired data to a spreadsheet file.
    When I used the random number as a signal to develop my program; everything has worked as expected. However,it is not working now as I replace the random number with a real voltage signal using the AI Acquire Waveform.vi. I have encounterd several problems:
    1/ Only display one second of data at a time.
    2/ The elapse time that I have calculated does not match with the time display on the chart.
    3/ The program runs very very slow when I increase the number of scans
    to acquire to 1000, but my program need to acquire the signal for 15 minutes at a rate of 50Hz(50sample/second); it is about 50,000.00 samples.
    Do you have any idea how should I do to make it works? I am a novice in LabVIEW; any help would be greatly appriciate.
    Hao
    P.S: I've attached my program if you want to take a look at them.
    Attachments:
    Acquire_Using_Random_Number.vi ‏89 KB
    Continuous_Acquire.vi ‏96 KB

    Helleo Labviewguru,
    Yes, I did tried to see those examples but I could not display on a chart nor store to an array and save to a spreadsheet file when I used the AI Config.vi, AI Start.vi and the AI Read.vi(in a while loop). Can you please help me with this.
    Thank you in advance.
    Hao

  • Ai acquire waveform.v​i

    Hi, 
    Recently I receive a code from my senior to read data from DAQ bnc-2090. I have installed DAQmx 9.3 but I cannot run the code due to "cannot load ai acquire waveform.vi." I have find the answers that an old version of DAQ driver is needed. However, TDAQ driver is only suitable for Windows XP/2000, and I use Windows 7. What should I do to solve this problem?  Thank you.

    The only driver for that card is traditional DAQ and you've already found out that it is not supported on Windows 7 so why this question?

  • USB Camera and Low level VIs

    Hello all,
    I am beginner in LabView and I am seeking help for the following:
    I need to adapt a vi using a regular (analog) camera so to start using a USB camera instead. When I viewed the block diagram (which is really complicated for me) I noticed that the original programmer used the low level IMAQ VI's (e.g. IMAQ intil.vi and IMAQ configure Buffer.vi) to communicate, control and acquire images from the camera. Now, I am really confused, does these VIs work with all cameras? If not can I replace them with the IMAQ USB VIs'? How would this affect the other VIs that depends on the out come of the replaced ones? Finally, I would be glad if anyone can point out things to read so to acquire more knowledge about this subject?
    I know I asked much but really I want to learn these things as fast as possible
    Best Regards
    Mohammed

    Hello TomBaum,
    First, thanks for responding, really appreciate it.
    Sorry that I cant send the Vi itself yet I have attached a picture of the part
    that I want to modify (red rectangle).
    All I want to do is using USB camera instead of the one used now! so does
    these  low level VIs work with the USB camera
    or I should use the USB camera VIs which will mean that i will end up with many
    broken wires since low-level VIs has
    different number on inputs that the USB camera VIs
    Hope this can give you an idea.
    P.S. in case you will wonder about the sequence structure; it is  only the
    camera setting that I am interested and it is the one shown in the
    structure
    All the broken wires in the picture are going into a very larg while loop with
    many other VIs.
    Regards
    Attachments:
    pic1.PNG ‏48 KB

  • How to record and playback waveform?

    Hi,
    I would like to record the waveform of my signal and then playback again for analysis purposes.
    My current VI can read the signals from 2 channels of my oscilloscope (as shown in the picture) using the waveform chart. How and what should I include in my VI so that I can playback the signal waveform so that I can trace back the place where I previously could not stop the signal in time to obtain the result i want?
    Also, is my cross correlation connected properly in the VI? Because while running the signal, this is the waveform I got from the above 2channels waveform (which I think its wrong).
    Thanks for much! Your help is greatly appreciated! =)
    Attachments:
    Acquire Multiple Waveforms(crosscorrelation).vi ‏77 KB

    To record (or to save) the acquired data on to disk use the TDMS vi's placed in Files I/O-> TDM streaming..
     There will be some example shipped along with the LV on how to use this files.
    So once all the data have been stored to the disk read them back (u have to create another vi for reading them) and populate the same to the w/f chart (read small chunks of data = the sampling rate , so that you can exactly play back the data when u were acquiring. This also will not hog your CPU if the data stored is huge)
    Guru
    Regards
    Guru (CLA)

  • How can I find an example about acquiring waveform data by software trigger using PXI 4070 DMM?

    Anybody could proivde an example or simliar about acquiring waveform data by software trigger using PXI 4070 DMM?
    Thanks!

    hi there
    from the NI main page go to the developer zone http://www.ni.com/devzone/dev_exchange/ex_search.h​tm. select "LabVIEW" and "Digital Multimeter (DMM)" and search for "4070". then you'll find some examples.
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

Maybe you are looking for

  • HP Officejet Pro 8100 Everything fine; Just won't print

    HP  Officejet Pro 8100 working on a Windows 8 PC I like this printer, had it for a few months, worked fine at the start. For more than a week now, it just won't print. Troubleshooting reveals no problems with set-up or anyhing. No error messages. Fil

  • Creation of individual object in crm

    Hi All, Can anyone help me how to create an Individual Object in CRM. I have created Equipment in R/3,replicated to CRM. Now when i am trying to create Installed Base i dont find any Individual Objects on the Individual Object tab in the Installed Ba

  • Problem in loading the long text in bdc.

    Hai Friends,               I am uploading the material master using bdc, Here i need to upload the long text field. so am using the separate report for upload the long text field using the create_text function module. but the problem is the long text

  • Multimedia Player Error

    I installed the 6.86.9.3 version of Nokia PC Suite on my computer running windows XP pro. I have many videos that I took using my N80 Internet Edition phone. When I try to play the videos with the Nokia Multimedia Player on my computer I see a Green

  • Group link issue with JHS 11.1.1.3.35

    Hi guys, I've just upgraded our current project to JHeadstart 11.1.1.3.35. Well done on the release ! Each time I find myself needing less and less custom coding in templates :) My 2 favourite features are calling an AM method from a JHeadstart comma