Serial ADC Read

    Greetings. I am endevouring to read from an Analog Devices serial ADC (AD7872) using LabView and a PCI 6534 card.
Data out of the ADC is valid on the falling edge of the SCLK output of the ADC. What I would like to do is trigger a single read of SDATA on the falling edge of SCLK. Unfortunately, I get an error stating something to the effect that the start trigger type is not supported due to requested timing type. I am having trouble finding examples that are similar to what I am trying to do, so any help with this would be greatly appreciated.
Thank you.

Hello Awar99,
From my understanding you are using LabVIEW, PCI 6534 to do a single digital read with a start trigger.  I am assuming that you are using DAQmx. 
According to the page 3 of the 6534 Specifications guide, your device does support start triggers.  I checked the device routes in MAX (Measurement and Automation Explorer) and the only signals you can use as a start trigger on your device are RTSI 1 - RTSI 6.  You can find the device routes in MAX.  Open MAX and select "My System">>"Devices and Interfaces">>"NI-DAQmx Devices">>NI PCI-6534.  Next select the "Device Routes" tab. 
A good DAQmx shipping example to start from is called Read Dig Chan-Int Clk-Dig Ref.vi.  You can find it in the DAQmx example finder.  In LabVIEW go to Help and select "Find Examples".  In the browse tab choose "Hardware Input and Output">>"DAQmx">>Digital Measurements>>Read Dig Chan-Int Clk-Dig Ref.vi.  You can modify this VI to do exactly what you want.  For example, you can change the reference trigger to be a start digital edge trigger. 
If this was not helpful then please answer the following questions and post your code. 
What is the error code/# and message you receive?
What version of LabVIEW are you using?
What version of DAQmx are you using?
Regards,
Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx

Similar Messages

  • How do I stop Serial "VISA Read" from giving me packets instead of available bytes.

    Dear Labvillians,
    Highlight:
    How do I stop serial "VISA read" from giving me packets instead of bytes?
    Background:
    I have a system that serially publishes 14 byte packets on a semi-regular interval.
    At busy times, the producer of these these packets queues the data, effectively producing super-packets in multiples of 14 bytes sometimes as large as 8 packets (112 bytes).
    My protocol handler has been designed to processes bytes, packets or super-packets.
    My application now has multiple devices and the order of message processing is critical to correct functionality.
    My observation is that the VISA read waits until the end of a packet/ super-packet before passing the data to the application code. (See Plot Below)
    My expectation is that VISA read should give me available bytes, and not get too smart for itself and wait for a packet.
    I have observed this on PXI, Embedded PC, cFP and most recently, cRIO
    I have experimented with the cRIO's Scan interface rate, which helps with reducing the packet backlog but doesn't resolve to sub-packet byte read.
    I understand that one solution is to Write FPGA code to handle it and pass the bytes through R/T-FIFO, and there are some great examples on this site.
    Unfortunately this doesn't help with non FPGA devices.
    I have also dabbled in event based serial reads but it is diabolical on vxWorks devices.
    Any Help is appreciated
    iTm - Senior Systems Engineer
    uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
    Solved!
    Go to Solution.

    Sometimes Talking to yourself is helpful.
    I hope this is a useful Nugget for someone in the future
    iTm - Senior Systems Engineer
    uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT

  • Problem --serial port reading one character at a time

    Hi Friend,
    I reading the serial port  one character at a time ,  i specified it in the "serial bytes to read" option in serial port read examples.
    The problem is ----------i can able to read  the data.
    but only the first character is reading again and again...and "reading string indicator" in the serial port example shows only the first character sent ..only for a single time.since i am reading continously ----aleast the first character should display as many times i running the program
    (i am running the vi by run continous option..........)..
    please help me ....how to read the character one by one.....
    regards
    rajasekar

    Hi jason...
    I can able to read the serial port by 1 byte or 2 byte or 4 byte as i can specify it in the serial port read bytes option..(in visa serial read)..
    I need to acquire 4 bytes of data and pass it to the Math-script node..and save these 4bytes of data in array (1 row and 4 column)..
    And split this array(just like array-indexing.vi) and processing it each each column separately....
    or suggest some method to achieve my task.....please.
    one more thing the math-script node is placed in a while loop.....in order to read sequence of bytes continously.......
    regards
    rajasekar

  • Merge a intensity graph to a Serial write/read

    Hey.
    I am doing my bachelor in Labview, and are using a arduino 2560 as a microcontroller for a thermal sensor.
    After many attempts on connecting the arduino to labview using LIFA.BASE I get connection sometimes, and sometimes not.
    I tried the Serial write and read program on the forum, and got much better reliability.
    I would like to use VISA, instead of Arduino int.vi
    I was hoping I could change the Serial write and read(removing the string) with putting an intensity graph in it?
    I have added the bachelor program along with the Serial write and read, can someone please help me??
    Attachments:
    bachelor_2013.vi ‏259 KB
    Modded Advanced Serial Write and Read_test.vi ‏40 KB

    There is the Simple Serial Write Read example.  That should get you started with talking over a serial port with VISA.
    It seems like you have an array of bytes that you need to send.  You just use the Byte Array To String to convert directly into a string and send it.  For reading, there is the String To Byte Array that you can use to start parsing your data.
    Show us what you have so far.  Be sure to include any sample data you may have and expected results.  Things get really confusing when stating ASCII and Hex since people can interpret that in 10 different ways.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to pass serial number read from a PCB.

    Hi,
    I have a question:
    How do I pass serial number read from a PCB so it will be embedded in Test Report file name for that test sequence. I am running Sequence in “New Execution" - Single Pass.
    My test report file after I run test does not have serial number: “TEST_Rev6_Report[NO_UUT_SERIAL_NUM0][2 32 24 PM][4 26 2013].xml” but my Report Header has serial number present.
    Thank you,
    Henry

    The attached screenshot shows how to set your report options, make sure you have the <TestSocket> and <UUTStatus> macros included in the Report File Path otherwise the serial will not be filled in the filename (Generate path is called a second time from the Single Pass -- Test Socket Entry Point sequence).
    I used the ParallelModel.seq to test it.
    The attached sequence file shows how to set the serial number.
    Search for "Specifying Report File Paths by Expression" in the help for more macros.
    Attachments:
    Sequence File 2.seq ‏5 KB
    Screenshot.png ‏57 KB

  • Using VI Example Basic Serial Write Read to send AT commands to Cell phone modem error 1073807360

    I am using the NI Example VI: Basic Serial Write and Read to send AT commands to a Cell phone acting as a Modem.  I can send AT commands to this phone using Hyperterm when I select the modem driver by name in the hypert port selection field but not as com 7 which it occupies according to device manager modem properties. The basic serial vi does not show the modem driver as a selection, only ports by comX are shown. I get error 1073807360.

    Have you tried to put the name you enter in Hyperterminal in the VISA resource control? If Com 7 doesn't show, you can simply type "COM 7" in the VISA resource control. Or use "ASRL::INSTR 7".
    Also, make sure the connection in hyperterminal is closed, before you open the port in LabVIEW.
    Hope it helps,
    Wiebe.

  • How do I use serial port read and show text, but not have it scroll off screen?

    I am new-ish/returning amateur user of Labview and I am trying to edit the example VI "Advanced serial write and read VI" that is part of dev suite 2012.  I need to use the string box to show ALL text received from serial port, always appending and only rolls off screen when more real data arrives at serial port. 
    What is actually happening is as more bytes (or no bytes AT ALL!) arrive during read time, current text rolls off the string box.  Even when 0 bytes are received, screen is blanked out.  I am not very familiar with functions locations and even worse at understanding obscure references to functions, so please keep replies very basic so I can follow.
    Just to be clear, I need the string window to behave like hyperterm does-always shows data and it is not pushed out of window arbitrarily.
    Thanks,
    Steve  
    Solved!
    Go to Solution.

    OK- lets start back at the beginning.  I have a few questions...
    WHy does incoming txt get placed at top of txt box and then scroll up?  why would it make more sense to input at the bottom and scroll toward the top.  I have created this huge txt box that appears to be impossible to use.
    I have attached example of txt boxes I have tried, and pic of VI I have edited.  Bad marks for uglyness....
    Attachments:
    Capture_VI.JPG ‏117 KB
    Capture_VI2.JPG ‏133 KB

  • Multiple serial ports reading from a shared USB port

    I have a program that reads from 4 flow controllers, which send data through RS232 serial ports. Because the computer is located pretty far away, the vendor suggested to use an Edgeport box to convert RS232 to USB, then convert to ethernet port using a SuperBooster converter. The signal travels long distance in ethernet cable to the computer and get converted back to USB, then to the computer. In MAX, I was able to see 8 com ports from the Edgeport box, and I was able to communicate with my flow controllers.
    The problem is, it will give me some error message occasionally. Sometime it's a VISA Read error, sometime it's a VISA framing error. Could this be caused by the way the signal is transmitted?
    In the program I have four parallel WHILE loops that constantly do READ and WRITE to the 4 flow controllers. Could this be causing the errors? If so, what is the best strategy to design this program?
    Thanks

    I agree with Mike, you will need an error handling strategy that accounts for these errors.  And retries the communications.  This can be a little tricky, but very doable.  I believe some sort of statemachine approach will work best for this. 
    As for your heated probe.  I would make some sort of hardware interlock that will shut it down in case of a coolant failure.  NEVER, EVER trust the computer to be running where safety is concerned, either for personal or hardware.  There are plenty of ICs that can monitor temperature, and have warning, and alarm outputs!  Another option is some sort of watchdog on the communications bus for the coolant control, but I think this is a bit more tricky. 
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?

  • Asynchronous serial message read

    Hi, everybody.
    I have the message based device. I don't know when the device will send the message, so I didn't know how should I create the VISA read function to read whole string from the device(because it reads only data, which are enabled at serial port buffer).May be it can be done by using VISA bytes at port in while loop, but I don't know exactly how.Can you explain it to me?Or do you have any other solution?Thank you for your help.
    Solved!
    Go to Solution.

    Hi
    I reworked the basic serial read and write example, just to give you some programming hint. Also remember that then reading from the serial buffer, you do not need to read all the content. Read the number of bytes you need. The serial buffer is FIFO type. So the oldest content will always be first in the queue to read. 
    My example is somewhat simple, and I did not test it but should work. Check out queues and notifiers (in example finder) for more advanced programming techniques.
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)
    Attachments:
    Basic Serial Write and Read async.vi ‏33 KB

  • Serial port reads unconventional characters

    Hi,
         I'm using the serial port to read 32 8bit numbers and have been getting some strange characters read back.
        I've tested the hardware with Matlab which works fine but with Labview I get the following string
        À Ð à Ð àÿÐÿÐÿÐÿÐÿÐÿÐÿÐÿÐÿÐÿÐ À
       Since these are not standard characters I can't seem to convert them to any other format. I've also used an ActiveX control (AComPort) in Matlab to do the same thing and I get the identical string above, so its something to do with the format rather than an error in the reading I think.  However if I use AComPort to read one byte at a time (rather than a string) I get the correct numbers, so could I do the same thing in Labview?
    Thanks for any help
    Emrys  

    hi there
    i bet there's something wrong with the serial port settings
    - Enable Termination Char (T)
    - Termination Char
    - data rate
    - data bits
    - polarity
    - stop bits
    you can adjust these settings with the "VISA Configure Serial Port.vi". please check if the settings are correct.
    you wrote "However if I use AComPort to read one byte at a time (rather than a string) I get the correct numbers", so try 8 databits, 1 stopbit, no parity and disabled termination character or see the documentation of AComPort .
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • Serial Port Read Issues

    I have an application that needs to read in a set-length string of 13 data readings seperated by a commas. I have a vi set up that will take the incoming string and seperate it out to its different data points. BUT, when I'm reading in the data over the serial port, I don't know how to wait until I have a complete set of 13 data points before displaying my data. I'm using a vi that extracts doubles from the string to display all 13 data points, and as each point is recieved from my test item, it scrolls through the 13 seperate data displays. All this is placed inside a while loop, so all of my data is coming in, but i'm having trouble seperating it out for display purposes. My test item will be generating the string of 13 floating point numbers seperated by commas at a rate of about 1 set every 1-2 seconds.
    Basically, I need advice on how to read in a full string of 13 data points and after the full string is read in, then display them using an extract_from_string vi.
    Thanks in advance
    jimmyMessage Edited by JMorgan on 03-02-2005 10:50 AM

    Jimmy,
    Is the last data point separated by a comma or by some other character from the beginning of the next data set? If it is a different character, like a carriage return, then all you need to do is to search for that character in the received data. If the stream is continuous and no framing character occurs, then you have to count and hope it never gets out of sync.
    Lynn

  • Serial-port read

    Hello,
    I´m using a digital multimeter to serial port (COM1) connection to get
    0-100 mV´s from a photomultiplier, but it doesn´t work. I used the
    LabView-Serial Port VI in the read-mode. The VI proceed´s but it doesn´t
    put out any data.
    Did I use the right VI?
    Can anybody help me?
    Thanks
    Oliver

    I found some info about the Multimeter:
    I´ve got two possible modes to get data from the DMM
    1. by using send-code:
    M: DMM sends stored data
    C: DMM resets stored data
    D: DMM sends display-data
    2. without send-code
    if the COMM-button off DMM is pressed, DTR has to be set to Lo by PC. DMM will
    send display every second
    transferrate is 1200 baud
    charakter code 7-bit ASCII
    no parity
    stop-bits 2
    length of string 14 byte
    I also found a short MS-Quickbasic-file:
    CLS
    OPEN "COM1:1200,N,7,2,RS,CD,DS,CD" for INPUT A$
    INPUT #2,A$
    PRINT A$
    CLOSE #2
    END
    I used the serial-communication VI this time in order to give the DMM
    commands ( M,C,D) but the DMM didn´t answer. I set the
    data-communication-parameters in the sub VI´s, maybe that was the fault. Have
    you got any idea
    what´s wrong??
    To what, in your opinion do the characters RS,CD,DS,CD in the "OPEN COM1
    command-line stand for ??
    Thanks, for your help,
    Oliver

  • Serial input read gives 10 samples but I only want 1

    I have my sensor connected to com1. Here is my code:
    Private Sub CWButton1_ValueChanged(ByVal Value As Boolean)
    Do While CWButton1.Value = True
    Data = CWSerial1.Read
    AllData = AllData + Data
    TextIn.Text = AllData
    CWGraph1.ChartY Val(Data)
    DoEvents
    Loop
    End Sub
    My problem is I just want one sample per loop, but I'm getting like 10. I don't know if I can change the output of the sensor. Is there a way to just get one sample at a time?
    BTW I'm new with measurement studio, but it is very cool!
    thanks,
    Brian

    Have you tried using the optional bufferSize parameter to CWSerial.Read? For more info, see the documentation for CWSerial.Read in the Measurement Studio reference.
    - Elton

  • Serial port 8 bit adc program

    I have some Pascal code writen for an 8bit Serial ADC circuit. I had a look at the Pascal code and I made an attemp at implementing it in labVIEW but obviously it didnt work. 
    The Pascal code writes/reads to the DTR, RTS and CTS lines which I was able to do with little success, I used the property node and chose 'DTR/RTS State' which gave me the options to write to the lines i mentioned above. But I am not able to read the CTS output. how can I do that in LabVIEW because LABVIEW VISA follows the RS232 protocol . I tried using the IN/Out port vi But it does not work for windows Vista & later .Can anyone help by telling me where to start from? Below is the Pascal code. I have attached my current vi which does not work.
    the circuit diagram for the 8bit adc can be found here... 
    http://www.epanorama.net/circuits/ad_serial.html
    Pascal Code........
    Program serial_adc;
    Uses Crt;
    Const
    combase=$3f8; { I/O address of the COM port you are using }
    MCR=combase+4;
    LCR=combase+3;
    MSR=combase+6;
    Procedure Initialize_converter;
    Begin
    Port[MCR]:=3; { make DTR line to supply power and set CS input of chip to 1 }
    Port[LCR]:=0; { set clock line of the chip to 0 }
    End;
    Function Read_value:byte;
    Var
    value:byte;
    count:byte;
    Begin
    value:=0;
    Port[MCR]:=1; { set CS down }
    For count:=0 to 7 Do Begin { do the bit value eading 7 times }
    value:=value SHL 1; { value=2*value }
    Port[LCR]:=64; { clock line up }
    If (port[MSR] and $10)=$10 Then Inc(value); { read the input data and update value }
    Port[LCR]:=0; { clock line down }
    End;
    Port[MCR]:=3; { set CS up again }
    Read_value:=value; { return the value }
    End;
    Begin
    Initialize_converter; { call initialization routine }
    Repeat
    Writeln(Read_value); { call reading routine and print the value }
    Delay(1200);
    Until KeyPressed; { repeat until any key is pressed }
    End.
    Attachments:
    read_In_Out_port.vi ‏24 KB
    read_from_com_port2.vi ‏40 KB

    It has been too many decades since I used Pascal to be sure what your code does.
    It seems that you are asserting DSR to provide power through the port to the external device and that you have that working.
    Are you using RTS/CTS as standard handshaking? If so, just select RTS/CTS as the value for the Flow Control input on the VISA Configure Serial Port.vi.  Then there is no need to deal with those line explicitly in the LV code.
    Note on your code: The 1 ms Wait in the sequence frame with the RTS Asserted may run before or after the property node. If you need the delay before asserting RTS, put the Wait in a frame which runs before the property node.
    If you are using USB to RS-232 adapters, verify whether the DTR line stays asserted. I have seen some adapters which think they are smarter than you are and turn off the control lines after a short idle time.
    Lynn

  • Problem in reading data from serial port continuously- application hangs after sometimes

    I need to read data from two COM port and order of data appearance from COM port is not fixed. 
    I have used small timeout and reading data in while loop continously . If my application is steady for sometime it gets hangs and afterwards it doesnt receive any data again. 
    Then I need to restart my application again to make it work.
    I am attaching VI. Let me know any issue.
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet
    Attachments:
    Scanning.vi ‏39 KB

    billko wrote:
    Ranjeet_Singh wrote:
    I need to read data from two COM port and order of data appearance from COM port is not fixed. 
    I have used small timeout and reading data in while loop continously . If my application is steady for sometime it gets hangs and afterwards it doesnt receive any data again. 
    Then I need to restart my application again to make it work.
    I am attaching VI. Let me know any issue.
    What do you mean, "not fixed?"  If there is no termination character, no start/stop character(s) or even a consistent data length, then how can you really be sure when the data starts and stops?
    I probably misunderstood you though.  Assuming the last case is not ture - there is a certain length to the data - then you should use the bytes at port, like in the otherwise disastrous serial port read example.  In this case, it's NOT disastrous.  You have to make sure that you read all the data that came through.  Right now you have no idea how much data you just read.  Also, if this is streaming data, you might want to break it out into a producer/consumer design pattern.
    Not fixed means order is not fixed, data from any com port can come anytime. lenght is fixed, one com port have 14 byte and other 8 byte fixed..
    Reading data is not an issue for me as it works nice but I have a query that why my application hangs after sometime and stops reading data from COM PORT.
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet

Maybe you are looking for

  • Vga output not working in lion

    I upgraded to Lion yesterday and noticed that I could not longer use my Macbook Pro with a projector.  I've tried several different projectors (classrooms at the university), and none of them work.  When I plug the VGA cable into my adapter, the Macb

  • Oracle XE service does not get installed

    Hi, 2 days ago downloaded Oracle 10 g Express Edition and installed on my computer. It installed succesfully and gave no erros. But when I tried to go to the homepage it failed to open. Then I check the services.msc and found that OracleXEService was

  • Performance of ImageIO.read with jpeg files

    Hi all... I'm pulling my hair out trying to get a seemingly trivial task to work fast in Java. I'm trying to read in a set of jpeg files, and all I really want out of the files (for now) is width and height. The code I'm testing is: for(int i = 0; i

  • Safari won't load pages with pictures after installing Maverick

    I have an older iMac (2008), but it runs great and I have no problems with it.  Except now that i installed Maverick, now Safari doesn't work properly.  For most things, it works fine, then It will quit in the middle of a page.  Or, I have uploaded p

  • MacPro2008 This system does not meet the minimum system requirements for graphics cards. FCP

    Running FCPX 10.0.8 not possible because the graphic card ATI Radeon HD 2600 doesn't support FCP. Which affordable and compatible graphic card does support FinalCutPro 10.0.8?