Synchronise READ from Serial card when Counter on 6025 is incremented

Hi!
System description:
I am using PXI-8423 (2-port RS-422) and PXI-6025 to measure the signal coming from 2 laser sensors mounted onto a mechanical stage with linear encoder.
The laser sensors give RS-422 output (at 1KHz) and are connected to my serial card.
The encoder gives quadrature output that I plan to connect to counters on my 6025 daqcard.
Q:
I want to read the laser data everytime the encoder gives a pulse signifying the mechanical stage has moved. How can I achieve this?
We would be taking around 1000 serial reads (from each port) per second.
Environment:
We are using PXI-1031 chassis (4-slot) with PXI-8184 controller (850 MHz celeron). OS is Win2K prof. and LabVIEW 7.1
Thanks,
Gurdas
[email protected]
Gurdas Singh
PhD. Candidate | Civil Engineering | NCSU.edu

Hi Gurdas,
We have some simple serial communication examples included in LabVIEW. Those example programs transmit any string of characters over the serial port. All you have to do is set which port you want to use, baud rate, stop bits, parity, etc. in the VI; this setting wil remain for each serial transfer while the program is running. Again, you can read/write any character string with the serial communication VI's. How the information is put into the character strings is up to you and the device you are communicating with. The serial communication is LSB before MSB.
Regards,
Salvador Santolucito
Applications Engineering
National Instruments
Attachments:
Basic_Serial_Write_and_Read.vi ‏66 KB
Advanced_Serial_Write_and_Read.vi ‏105 KB

Similar Messages

  • FIX : Elements 11 photodownloader freezes Win7SP1 when reading from SD card

    I found a problem with Elements 11 and the photodownloader. (complete freeze, no blue screen, no possibility to shut down the application because the keyboard, mouse and screen are completely frozen, only shutdown the hard way possible)
    My machine is running Win7SP1 64 Bit
    SInce a couple of days my computer froze completely when I tried downloading photo's from an SD card.
    After an extensive diagnostic, reinstalling elements, testing via an USB key, I found the problem was when photodownloader reads from an SD card.
    With this I checked all Microsoft updates which had been installed and which might affect the SD card reader, when I found the MS update KB2800095.
    When I removed this update, and rebooted, the photodownloader worked fine again, even when reading from SD cards.
    Something in the patch from Microsoft makes photodownloader and Win7 to completely freeze up.

    I am running Windows 7 Home Premium.  The autoplay box automatically comes up with the Elements 12 box to select, but when I click on it, it gives that hateful noise and says "that there is no file associated with it and to go to default programs and associate it with one.  When I go to the Default programs, it gives this list of stupid stuff like "Paint" whatever that is, and stuff I never use and there is no way to add Elements 12 or any other thing.  Have right clicked, left clicked and everything else but nothing works. 
    How could I uninstall the entire program and not lose my organizer that has 40,000 photos and videos on there?  I don't understand it.
    And, also, I have to admit that I have no understanding whatsoever to understand the link that you so kindly gave me.  Sorry to be such an idiot, but I'm a nurse, not a computer expert and guess it is pretty clear that I just don't understand it.  My husband is an IT person but has no idea what to tell me because he has never worked with stuff like Elements or Photoshop, etc. 
    Any other suggestions that I could understand would be really appreciated.  Am just so frustrated.

  • Updated my iphone 3gs to the 5 ios and now my phone wont read my sim card when i reacticate it

    updated my iphone 3gs to the 5 ios and now my phone wont read my sim card when i reactivate it.
    Every time i connect it to itunes all it says is "There is no SIM card installed in the iphone you are attempting to activate." Even thought there is a sim card connected in my phone.

    Is the SIM from a supported carrier?
    Is the device carrier locked, officially unlocked, or hacked to be unlocked?
    Has the SIM been reseated?  If not, try that.
    Also, basic troubleshooting is reset, restart, restore.  Has any of that been tried?

  • HT1379 Summary: how to transfer files from SD card when the system (Mac OS X v 10.7.5) will NOT recognize SD cards.

    How to transfer files from SD card when the system (Mac OS X v 10.7.5) will NOT recognize SD cards?
    Insert the SD card.
    System opens iPhoto with SD contents.
    Want to transfer files from SD card to system drive.  iPhoto closes
    SD card directory removed from the Finder window and is not available again. 
    I don't want to have to reboot the system every time I want to perform this option.
    What's wrong here. 
    The support columns show this isn't an isolated incident with all sorts of solutions possible.
    This is a simple task - there should be a simple method for the system to recognize SD cards.
    What's the answer?
    I've reviewed a recommendation to reset the SMC.
    https://discussions.apple.com/message/18500187#18500187
    and
    http://support.apple.com/kb/HT3964
    and another thread that says, basically, you must buy extra hardware to perform this simple task,
    https://discussions.apple.com/message/16911326#16911326
    another one that has the same problem with OS Mountian Lion,
    https://discussions.apple.com/message/21919740#21919740
    another one with the problem that says SD cards can't be read by Apple unless the card is formatted specifically for Apple, ie. that Apple is not compatible with other cards, but the problem maybe something else that requires Apple service - (bad SD card reader?).
    https://discussions.apple.com/message/18711818#18711818
    there are probably more discussions, but I dont' want to spend my entire sunny in Seattle day working this.
    thanks for the help!

    Bucky Fullmeister wrote:
    When I plug in an SD card, the finder window shows it under the DEVICES section.  At this point, I can drag the contents to the hard drive.  However, when I screw up and click the character on the right side of the name - it apparently closes the SD card and I can't find any command to reload or re-recognize the card.  I have to remove and reinsert the card and then sometimes it recognizes the card.  Other times I reboot and it will recognize it.
    What does that character on the right side of the SD card name do?  Is it an eject function - with no way to subsequently reread the drive?
    It ejects or unmounts the card. When the SD card mounts click on it once to highlight it and then drag the files shown within it to the new folder.
    Pete

  • Does Apple deduct money from credit card when the package is prepared for shipment or when it ships?

    does Apple deduct money from credit card when the package is prepared for shipment or when it ships?

    Is there any practical difference between the two?  I suspect they charge your card when it ships.

  • TS1292 need a reading from gift card

    hello i had buy ,y son itunes gift card bt he scrath off half of the silver part so i cant read some of the letters off the card so can u please help finish the rest of the read from the card here a number thats on top of the barcode GCA**********170 / 26******446
    <Edited By Host>

    These are user-to-user forums (I've asked the hosts to remove the gift card number from your post) - see if this page helps : http://support.apple.com/kb/TS1292
    If it doesn't then try contacting iTunes support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • "No more data to read from socket" exception when testing connections

    Hi,
    I will appriciate your help with the following problem.
    We have the follwoing errors in the weblogic.log (We are using weblogic 8.1.0.2 and Oracle 9.2.0.3)
    ####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep> <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001128> <Connection for pool "oraclePool" closed.>
    ####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001067> <Connection for pool "oraclePool" refreshed.>
    ####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001112> <Test "select count(*) from DUAL" set up for pool "oraclePool" failed with exception: "java.sql.SQLException: No more data to read from socket".>
    ####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001131> <Received an exception when closing a cached statement for the pool "oraclePool": java.sql.SQLException: Io exception: Broken pipe.>
    These exception occures every hour after the connection pool is being closed and refreshed.
    Also there are a lot of the follwoing warnning in the log :
    <BEA-001074><A JDBC pool connection leak was detected.
    Does these two problems connected? What can we do in order to solve it?
    Thanks
    Edited by RF123 at 01/28/2007 3:41 AM

    R F wrote:
    Hi,
    I will appriciate your help with the following problem.
    We have the follwoing errors in the weblogic.log (We are using weblogic 8.1.0.2 and Oracle 9.2.0.3)
    ####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep> <mfserver> <Thread-14> <<WLS Kernel>
    <> <BEA-001128> <Connection for pool "oraclePool" closed.>
    ####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>
    <> <BEA-001067> <Connection for pool "oraclePool" refreshed.>
    ####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>
    <> <BEA-001112> <Test "select count(*) from DUAL" set up for pool "oraclePool" failed with exception:
    "java.sql.SQLException: No more data to read from socket".>
    ####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>
    <> <BEA-001131> <Received an exception when closing a cached statement for the pool "oraclePool":
    java.sql.SQLException: Io exception: Broken pipe.>
    These exception occures every hour after the connection pool is being closed and refreshed.
    Also there are a lot of the follwoing warnning in the log :
    <BEA-001074><A JDBC pool connection leak was detected.
    Does these two problems connected? What can we do in order to solve it?Hi. The problems are not directly related, but may have the same cause.
    Something is killing your DBMS connections out from under the driver.
    Do you have a firewall between WLS and the DBMS, or a flakey network?
    Contact BEA support to get the 8.1sp2 patch for getting meaningful
    connection leak traces (CR209251_81sp2.jar). When that patch is installed
    the leak messages should show a full stack trace of the application code
    where the connection was obtained. It is that application code that
    somehow failed to close the pool connection, causing a pool leak. I
    suspect that the application code got an unexpected exception, such as
    when/if the DBMS/network/firewall killed a connection. In this case I
    believe the application went through an exception-handling path that
    forgot to close the connection.
    Joe

  • Trouble reading from serial instrument and DAq simultaneously.

    Greetings,
    I am having some trouble getting my VI to read from my DAq and a serial instrument at the same time.  If I run the subVI's simultaneously (i.e. subANG is running in one window and subVEL is running in a second window) both return the proper values and behave as I would expect.  However, if I call the subVI's into a parent VI and try to run them both in the same loop structure subANG gets stuck and will not resond with a change in signal.
    I have also tried to use a stacked or flat sequence to separate out the execution of subVEL and subANG, but I still get the no response from subANG.
    The most confusing thing is that if I run Parent.VI in one window and then create a copy of subANG (call it '....-copy' or whatever) and run it in a second window, Parent.VI behaves properly and will refresh the readings as they appear in '...-copy'.
    I have attached 3 files.
    (1) subANG.VI     -This reads an RS232 signal from an inclinometer.  The signal is refreshed every 10ms or so.
    (2) subVEL.VI      -This reads raw voltage from one channel on the DAq, calculates the mean then converts that into a pressure differential and finally a velocity based on the pressure and temperature inputs. 
    (3) ParentVI.VI     -This simply calls and displays the subVI's
    My guess is that it is a buffer issue, but I am stumped.  Does anybody out there in Labview land know why this might be happening?  All suggestions welcom.
    Solved!
    Go to Solution.

    I am noticing it is not an NI DAQ card.  How are you communicating with the DAQ? If it is using a serial port, that could be your problem.
    I also highly recommend using the VISA drivers for serial communications instead of the serial.llb VIs.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Efficient optimized way to read from serial port and GPS data display using map

    Hi,
    I have a custom h/w which reads the data from GPS Rx and after parsing send it to PC over RS232.
    Each second it sends 201 bytes to PC. I have developed a VI to read the GPS data and display it. Project file is attached.
    Fulctionality of different loops are as following:
    1. LOOP 1: 1.1 Reads the serial data from com port.
                   1.2 Synclonize the frame using start bytes "a" and "z".
                   1.3 Reads next 4 bytes containg receiving error information.
                   1.4 Reads next 195 bytes. in which initial 80 byes are GPS data. rest are others.
    2. LOOP 2: 2.1 Extarcts the GPS information and put them in an array.
                      2.2 Extarcts the receive error infor and counts the total error by incrimenting the variable using shift reg.
    3. LOOP 3:3: 3.1 Displays the GPS data in chart and log the data in a file.
    4. FLOW : Uses the GMAP .NET based API to creat a MAP and display.
    Problem statement:
    1. Functionality acheived.
    2. However in between data set is being missed by the programm. 
    Quesitions:
    1. Is the developed VI is efficient in terms of using queue loacl variables etc.
    2. What are the improvments I can do to solve the problem.
    Any other suggestions|
    Thank you
    jayant
    jayant
    Attachments:
    Telemetry_Receiver_v2.zip ‏3075 KB

    One of the most common problems in serial communication is the need for an adequate timing: how much time is expected your device to spend before answering? Have you put and adequate pause in your code before reading from the serial port?
    Hope this helps
    Roberto
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • A problem about reading from serial port

    Hi,
       I just sent '0x03' from MCU to PC continuously, and then sent  '/n' as a stop character after every '0x03'. I use labview to read the data. The problem is when it get two '03' it get a '0', another two '03' and another a '0'. I don't know where is the '0' from?
      PS: Hyper terminal can display natrually.
       Thank you! 
    帖子被hengfo在08-08-2007 10:14 PM时编辑过了
    Attachments:
    serial read.vi ‏36 KB

    I think the problem may be the loop reading the serial port is running too fast.  There is no timing delay in the loop, so you are reading it as fast as you can, and probably faster than the device is sending data.  So sometimes the buffer is empty, and then the empty string gets converted to a numeric zero.  The way to know for sure is to put an indicator on the error wire coming out of the serial port read.  I bet you will see errors about the read buffer being empty.
    Put a wait timer in the loop to slow down the execution just slightly.  This is a good idea so that LV doesn't eat up all the CPU resources.  Look at the example for Basic Serial Write and Read.  You may want to have a loop ahead of the read that waits until there are a certain number of bytes at the port before it reads the serial port.  You may want to put a loop around the serial port that waits until a valid number is read in before it exits the loop and goes to the numeric conversion.
    Message Edited by Ravens Fan on 08-09-2007 08:50 AM

  • Computer freezes while reading from serial port

    My computer freezes when i tried to read from a serial port for a longer period of time such as 10 hours. I always close the serial port after reading. please, help me solve this problem

    I too experienced a similar problem twice on my machine and I have no idea how to stop it because it is so intermittent and I cannot replicate it.
    Perhaps I can offer some clues.
    The Labview screen cannot be stopped and some parts of Windows appears frozen. Oddly enough I can switch to the block diagram but thats about all I can do. The LV stop button will indicate a mouse click on it but the VI does not stop. iT also cannot be closed.
    Even the reset button and power button on the PC does not work. I am forced to power down the PC (pull the plug) to get back control.
    I believe it is related to a visa call to my serial Balance.
    ANyway no solution but hopefully some clues.
    Dell Optiplex GX260 w/ 500MB RAM
    Win2K 500.2195 w service pak 4,
    NI
    serial Hardware and NI serial ver1.45 (16 com ports)
    Labview 6.1 and 7

  • Read from sd card

    How do you get adobe to list the documents from the sd card when you push the "all documents" tab. I'm using a galaxy s4 with version 4.4.2

    On Android OS 4.4.x (KitKat), neither All PDFs view nor Folder View shows any files or folders on an external SD card.  Reader cannot save any changes to the files on an external SD card, either.  We are still working on fixing the problems.  In the meantime, please copy the files from your external SD card to your device's internal storage (e.g. /storage/emulated/0/Documents/...) using a File Manager/Browser app or use a cloud storage service (Acrobat.com, Dropbox, Google Drive, etc.) to store files.  Sorry for the inconvenience.

  • Read from serial-usb converter?

    I have an oxygen detector with serial out
    link to the owners manual with serial info 
    http://www.yokogawa.com/an/download/manual/IM11M10B01-01E.pdf
     and I want to hook it up to my laptop to record the data but i am having trouble as my laptop has no serial port. so i bought this:
    http://www.newegg.com/Product/Product.aspx?Item=N82E16812120901&nm_mc=OTC-Channel&cm_mmc=OTC-channel... 
    How do i read from the usb converter? I can program serial in with the visa on an old pc no problem, but this is giving me some trouble. Any advice would be appreciated thankyou.

    superomario wrote:
    I just ran the driver setup wizard in visa and got this error for the keyspan dongle.
    That might be bad news.  My company actually assigned an engineer to buy every USB to COM converter he could find and test them all with as many apps as possible.  There were many models that were problematic.  You might need to just try another brand (or two (dozen!)).
    Still, check the Device Manger or MAX just in case you get lucky...
    Using LabVIEW: 7.1.1, 8.5.1 & 2013

  • Plot more than one analog value to a waveform chart by reading from Serial Port

    I have 4 LDRs and I want to plot their values to a waveform chart by reading them from the serial port. I have looked around and found an example of a VI plotting one value to a waveform chart (attached below) but I am unsure about how to expand this for 4 different waveforms, mostly because I don't particularly understand the way is being read currently. If someone could either point me in the way of a relevant example or explain/show me a solution, or explain howthe current VI I have works, that would be greatly appreciated.
    Attachments:
    LDRread.vi ‏20 KB

    Since I assume each LDR (whatever that is) has its own serial connection, you will need to read from 4 different serial ports.  From there, just form an array of all the data and write to the chart.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions

  • Reading from serial , help needed

    Hello, I am a student trying to develop a Labview VI that talks with TDK blue2i module (with at style commands) via serial port, just like Hyperterminal.My VI consists of a while loop, inside of that I do VISA write, then VISA read using Bytes at serial port since answers are variable in lenght. When i run the program the first loop works ok ( i send message and get the right answer ) but in the second loop i still read the fisrt answer even if send a different command.
    Is there a way to make sure that buffer of the serial port is cleared after every reading?
    Sounds like a timing problem, Everything works well if I run the program Step by Step
    thanks

    "Francesco83" ha scritto nel messaggio
    news:[email protected]..
    > Hello, I am a student trying to develop a Labview VI that talks with
    > TDK blue2i module (with at style commands) via serial port, just like
    > Hyperterminal.My VI consists of a while loop, inside of that I do VISA
    > write, then VISA read using Bytes at serial port since answers are
    > variable in lenght. When i run the program the first loop works ok (
    > i send message and get the right answer ) but in the second loop i
    > still read the fisrt answer even if send a different command.
    > Is there a way to make sure that buffer of the serial port is cleared
    > after every reading?
    > Sounds like a timing problem, Everything works well if I run the
    > progra
    m Step by Step
    >
    > thanks
    Hi!
    I'm a student too, and I made a VI very similar to yours. My VI used the
    serial port to communicate with a modem, exchanging Hayes commands and
    answer from the modem.
    - Ma sei italiano anke tu! io non ho usato la VISA, ho usato solo le
    funzioni relative alla porta seriale messe in due o tre frame, non ricordo
    bene.. credo venga più complicato ma funziona! se vuoi vederlo scrivimi una
    mail! -
    Vicio

Maybe you are looking for

  • How to read the second line in a .txt file with bufferedReader?

    hi, i am not the best in speaking english and programming java :) so, just try to make sense of my question: Im using a BufferedReader to read a .txt file. the .txt file has 5+ different lines, and each line has 6 tokens (separated with ; ) My java f

  • Copy and paste issue

    While trying to create a simple copy and paste function ( from one open document / image into another open document in Photoshop CS5 ) like: PsApp.bringToFront(); PsApp.activeDocument.selection.selectAll(); PsApp.activeDocument.selection.copy(); PsAp

  • Heads-up - Don't Export ICC Profiles With Illustrator Files

    Hello everyone, I have a new Motion project (yea!) and I started out creating a 56-point star in Illustrator CS4 with a specific RGB color value and saved it as Illustrator CS4 with PDF compatibility. I brought it into Motion no problem but the RGB v

  • I am trying to download icloud onto my mac mac.

    I am trying to download my icloud onto my mac but step 2 is not on my mac. i have icloud on my iphone but can not transfer it over can someone..??

  • Scrolling of several ContainerController

    Hi, I have a TextFlow with several containerControllers. Is it possible to scroll several linked containers? It appears that the text placed in each containers can't "move" a controller to another ... Solutions exist, or I need to implement a custom