Visa series parallel read with arduinos, data are delayed

Hello

Currently I use two arduinos asynchronous data read from sensors of temperature and humidity. Each arduino send back 4 floats, separated by commas, with a stop of "\n" character In labview, data gets broken upward and then pushed to live plots. In addition, the data gets written to a file - arduino #1 and #2 Arduino have their data sent to different files. It is important to note that the arduinos have different rates by which they send data on the comms series. Ideally, we would like that the data of every arduino to enter and update locations independent real-time each other.

I'm having a problem where data do not seem to be displayed in real time. I can touch a thermocouple and then ten seconds later, the temperature will change. This delay seems to grow over the short program, which is a problem since we use a direct result of the plots to determine when to start various processes of cooling.

I wonder if due to different data rates the thrust arudiunos, if there is some kind of buffer somewhere that has a "backlog" of the fastest arrduino data and must wait for the slower arduino data until it does nothing. It is obviously a problem of data flow, but I'm pretty green with LabView and was looking for some advice or pointers. I want to mention that the arduinos send data quickly; they send every two seconds or more.

Hello MrScientist,

can you please try to use two separate while loops, one for each COM port, because if they're in the same loop, it can happen that they block each other.

A second option is always read all the information on the COM port and made a ring buffer and filter information of these buffers.

Tags: NI Software

Similar Questions

  • Data not read with custom data Plugin

    Hello

    I am trying to install a plug-in to read our data format custom at the request of the binary data.  Following the instructions of the software plugin SDK, I wrote the code to read the header and data to our format and it works using the test/debugging included screws withn the SDK.

    Unfortunately, when I compile and install the plugin and try to access my data in tiara, while individual channels are created successfully, they contain all the data.

    I've attached a zip file with all of the relevant files, would be grateful if someone could take a look and see if they can find something wrong.

    Thank you

    Shahrukh Alavi

    National Research Council of Canada

    Hi Shahrukh,

    The status bar and the error message often suggest a failure in loading the last parts of the string values.

    We can use create use exit File.vi to debug our code.

    The data file seems to have 7 channels, each has 40282 data points. So I value Offset 40280 and number of Points by the error buffer 2 and got 4 "end of file encountered." in PB_Data.vi. Would it be one of the following reasons?

    1. number of data points (wavelength) is not correct.

    2. the calculation of offset in file is not correct.

    Mavis

  • How can I create a chart that creates new series each year when the data are not collected on a daily basis?

    I collect numbers "occasionally" of my solar system and to create a standardized chart that shows that the generation on an annual basis, so I can compare fall in the fall of each year, etc..

    Because the information is not strictly 'daily' (just whenever I get to it), I don't know how it normalize for several years.

    For example, if I had

    Date - Kw/day

    15/01/10 - 14

    03/04/10 - 18

    18/04/10 - 17

    01/06/10 - 19

    21/09/10 - 15

    03/12/10 - 9

    07/02/11 - 13

    02/05/11 - 16

    17/08/11 - 18

    01/11/11 - 12

    02/11/11 - 12

    05/01/12 - 9

    04/06/12 - 12

    and so on.

    What I'd like to see is a line graph for each year from January to December with these datapoints on it. I have much more "incremental data" that I presented above, but it's on "random dates" during the last 8 years, and I'm just trying to see how each year compared to other years.

    To be at the front, I tried to understand how this in Excel as well, but he could not understand where the other.

    DRM for any tips/tricks/tips!

    Steve

    This might work for you...

    I placed your data in a table named "Data."

    Create a second (in this example, titled 'Table 1')

    In the table 'Table 1' months are in the first column and the first row (which is a header row) contains the years - add columns to add new year:

    B2 = if (SUMIFS (data: $B, data: $A, "> =" & (B$ 1, $A2, 1), DATE data: $A, "<" & EOMONTH(A1,0) will GET (DATE B$ 1, $A2, 1, 0) "" "") > 0, SUMIFS (data: $B, given: $A, "> =" & (B$ 1, $A2, 1), DATE data: $A, "<" & EOMONTH(A1,0) will GET (DATE B$ 1, $A2, 1, 0) "" ""), "")

    It's abbreviation dethrone select cell B2 and type (or copy and paste it here) the formula:

    = IF (SUMIFS (data: $B, data: $A, "> =" & (B$ 1, $A2, 1), DATE data: $A, "<" & EOMONTH(A1,0) will GET (DATE B$ 1, $A2, 1, 0) "" "") > 0, SUMIFS (data: $B, given: $A, "> =" & (B$ 1, $A2, 1), DATE data: $A, "<" & EOMONTH(A1,0) will GET (DATE B$ 1, $A2, 1, 0) "" ""), "")

    Select copy of cell B2

    Select the cells B2 at the end of F13, dough

    now select cells A2 through F13 and add a graphic (the XY scatter diagram)

    Add new year add one (or more) new columns for "table 1", then add the year to the top:

    Now alone, click the chart to activate the chart.  then click on the button 'change data references '.

    now, drag the data reference control handle to the right to add the new year to the table:

    You can add several years to the time, so you don't have to it very often

  • Strange question: Hyperion Planning Forms becomes read-only and data are destroyed: 11.1.2.2

    Hello

    Let me start by saying that I am not new to Hyperion Planning. We encounter a weird problem in our Test System. We notice that some (NOT ALL) of our tour of webforms in readonly webforms. all the cells in the gray form. It comes to despite the fact that the read-only checkbox is not checked in the form as well as the security is fine on all dimensions; Basically, all the cells of the form are valid combinations.

    The form becomes readonly, and all the data on this form is always Wiped. This has happened only for two web forms so far. We took a lot of Calc (none of the Calc have cleardata command). We do not know why this is happening. Maybe it's a bug in the product... not sure. has anyone seen this behavior before?

    Please let me know.

    -

    PK

    Please skip this question. It happened because someone on my team had added a member under umbrella of level 0.

  • After installing the runtime Visa my mouse moves with COM data

    I'm sorry, I don't know anything about Labview I use prepared GUIs.

    After installing the runtime Visa540 my mouse moves whenever I get the COM1 data. How can I turn that off?

    You use a USB-serial adapter?  Has been sending peripheral data when you start the computer to the top?  The device sending the data while the USB adapter has been being connected?

    It's probably a Windows problem.  If you connect a serial device (adapter USB-serial anytime or a build/PCI serial port at startup) and the device sends data, then Windows think that standard equipment is a mouse.

  • Problems with the VISA series connection (missed the ticks in the data)

    Hello

    I designed a DAQ card with USB connection. The USB connection works in virtual Com Port mode.

    The main vi a while loop. The sampling time is defined by the user and the hand while loop iterates of this time of the sample (for example, 5ms, 10ms or...). Communication of the data is made in the present while loop using VISA read or write tools. Data are stored in global variables so the other could read or change.

    There are screws separate for each part of the DAQ card input analog, digital output and... Each vi has its own time while in a loop which iteration step may be different from the large loop.

    The program works correctly, but there are a lot of ticks of "rate" in the communication of data. I've attached a screenshot of input analog vi. A sine wave is produced with output analog vi and this output is connected to an analog input. As you can see the data transmission has problems.

    This caused several loops work simultaneously? Or communication VISA has problems?

    Thanks in advance.

    The main problem I see with your VI is that you use bytes to the Port which is the wrong thing to use about 99% of the time.  It seems that you are trying to break around 31 bytes and turn them into numbers.  Suppose that at the moment, you check the bytes, a port, you have received only 28 of these bytes.  Some of the variables will find 0 because you have all the data.  But on the next play, you will have the remaining 3 bytes so everything from the.  Now your data package is misaligned.

    I suggest that if you want 31 pieces of information, you just put a constant 31 reading VISA and get rid of bytes to node Port.

    Other advice.  Index table is EXPANDABLE!  You don't need to create 31 copies of the index table and wire a constant to each of them.  Remove a node, and expand the bottom border down that you need.  You don't even have to add all the constants, because by default it will give you index 0, index 1, index 2...

  • VISA series Loopback speed and precision with double loops and a queue

    I'm working on a test of communication between 2 PCs. I test communication series RS-422 ports by using a simple loop. PC2 wrote continuous data at 38400 baud to PC1 (LabVIEW test code is here). PC1 reads the data and writes the data to the same port as soon as possible. PC2, reads the data and compares to what should be returned. I can get the highest speed is a speed of about 37300. Because it is continuous, finally that I get an error because the buffer overruns (read and write buffers are 65KO).

    It seems that VISA writing takes a lot longer than the VISA read. I do read/write asynchronous operations. I've read a fixed amount of data (1024 bytes) and then queued data to write in another loop. My timeout is set to 0.5 seconds, which is much time opf at 38400 baud (4800 bytes/second). I played a bit with these numbers, and they are the best I can get. If I increase the data read to 2 KB, the queue members increase. If I'm going too low, I start getting the data in the input buffer overrun.

    Anyone had experience with this type of test? The code is attached. Please take a look and see if I'm doing things correctly.

    Michael

    I do not know if this explains a gap between what you expect and what you found in 0.8 seconds, but you have added another level of complication in using the digiboard.  You don't have a real serial port, but a simulated serial port which is hung at the end of a USB bus.  The digiboard software creates a virtual experiences, and so its driver software and firmware on the side of the Board of Directors of the USB bus must manage some translations to go a number of compote, transfer on the bus and decode the Compote number so that it knows which 8 physical ports that it must send the message to.  You can see delays in translation at each end so something in the USB itself Protocol where it needs group information.

    If you have another, a different brand of the serial ports, you can use, you might want to try one of these to see if you get similar or different results.  But I don't think it's a good idea to try to test the limits of a serial communication device using hardware that adds the other layers of the communication protocol and therefore complicated results.

  • VISA do not read serial data in the right order

    Hi all

    I'm working on a project, when I need sample data at point A, it passes these (zigbee) wireless data to point B and here rs232 connection to the laptop.

    I'm using labview 2011 to view sampled data, but I have a little problem, data are not entered into labview in the right order and this is quite crucial in my application. I have attached some photos and my vi to describe the problem in detail.

    Data are packaged in the following form: AS:number1:number2:...:number49:\r - where is the beginning, followed by the values of the sample character separated by: and the last is followed by a return at the end of the cart package.

    When I view the data in different terminals (PuTTY, tera term ect.) then the data is in the correct order.

    To make the most obvious problem, I place the sampling to count an integer of 16-bit instead of the real samling

    The png sample of teraterm is how it is supposed to look like. The vi_sample.png is the string of labview, which is false, I've highlighted a few errors in the visample. When using the VI, I noticed that all the data is collected, but not in the right order.

    The missing Subvi is a few small VI that reads the input rs232 string and control the various indicators of this.

    I hope that you are able to help me with my problem.

    Concerning

    Tommy

    In the structure of case where read you the serial port you are adding at the beginning of the string rather than allow the addition. In other words, you build the answer backwards.

    Your method of reading is contradictory. You have configured the VISA session to stop playing when he sees a carriage return, but you do not actually. You have configured it so tell some bytes are on the serial port. Maybe it's not the set of bytes, since you have no delay between writing and reading, so you can be is only half of the message. If you use the method of termination, then reading VISA should have great value wired to the bytes to be read. Then, when VISA Read see the stop character, it will stop automatically. If you use the bytes available, then you need a mini loop to keep reading until you see the end of the response. Choose one or the other - don't try to play both ways.

  • Visa series read write

    Hello..

    I have no problem with reading series. I want to playback multiple visa series... Fist read I want to read the data of 5x8bit uC then if visa data read isnot "NOT" I'm going to send data to the CPU as the character ' end then read data from uC to new but is leght data 2x8bit data...

    Please, help me...

    This is the number of bytes you want to read. You already said you first want to read 5 bytes. If you use VISA set up the Serial Port and the stop character allow to true, you can set a number of high bytes and playback will end when the stop character is detected. The character of default endpoint is a line break. If you set it to false, you can use the bytes VISA to the Serial Port to determine the number of bytes in the buffer is and read this number. This makes the basic example.

    Did you do any debugging serial communication base? I suggest that you use a program like Hyperterminal/Procomm/Putty/.etc before trying to write your own program. It is also difficult to give detailed advice without knowing how you have set the serial communication of the microphone.

  • global variable functional to read and write data from and to the parallel loops

    Hello!

    Here is the following situation: I have 3 parallel while loops. I have the fire at the same time. The first loop reads the data from GPIB instruments. Second readers PID powered analog output card (software waveform static timed, cc. Update 3 seconds interval) with DAQmx features. The third argument stores the data in the case of certain conditions to the PDM file.

    I create a functional global variable (FGV) with write and read options containing the measured data (30 double CC in cluster). So when I get a new reading of the GPIB loop, I put the new values in the FGV.

    In parallel loops, I read the FGV when necessary. I know that, I just create a race condition, because when one of the loops reads or writes data in the FGV, no other loops can access, while they hold their race until the loop of winner completed his reading or writing on it.

    In my case, it is not a problem of losing data measured, and also a few short drapes in some loops are okey. (data measured, including the temperature values, used in the loop of PID and the loop to save file, the system also has constants for a significant period, is not a problem if the PID loop reads sometimes on values previous to the FGV in case if he won the race)

    What is a "barbarian way" to make such a code? (later, I want to give a good GUI to my code, so probably I would have to use some sort of event management,...)

    If you recommend something more elegant, please give me some links where I can learn more.

    I started to read and learn to try to expand my little knowledge in LabView, but to me, it seems I can find examples really pro and documents (http://expressionflow.com/2007/10/01/labview-queued-state-machine-architecture/ , http://forums.ni.com/t5/LabVIEW/Community-Nugget-2009-03-13-An-Event-based-messageing-framework/m-p/... ) and really simple, but not in the "middle range". This forum and other sources of NEITHER are really good, but I want to swim in a huge "info-ocean", without guidance...

    I'm after course 1 Core and Core 2, do you know that some free educational material that is based on these? (to say something 'intermediary'...)

    Thank you very much!

    I would use queues instead of a FGV in this particular case.

    A driving force that would provide a signal saying that the data is ready, you can change your FGV readme...  And maybe have an array of clusters to hold values more waiting to be read, etc...  Things get complicated...

    A queue however will do nicely.  You may have an understanding of producer/consumer.  You will need to do maybe not this 3rd loop.  If install you a state machine, which has (among other States): wait for the data (that is where the queue is read), writing to a file, disk PID.

    Your state of inactivity would be the "waiting for data".

    The PID is dependent on the data?  Otherwise it must operate its own, and Yes, you may have a loop for it.  Should run at a different rate from the loop reading data, you may have a different queue or other means for transmitting data to this loop.

    Another tip would be to define the State of PID as the default state and check for new data at regular intervals, thus reducing to 2 loops (producer / consumer).  The new data would be shared on the wires using a shift register.

    There are many tricks.  However, I would not recommend using a basic FGV as your solution.  An Action Engine, would be okay if it includes a mechanism to flag what data has been read (ie index, etc) or once the data has been read, it is deleted from the AE. 

    There are many ways to implement a solution, you just have to pick the right one that will avoid loosing data.

  • Timed signal generation TTL with the NI USB-6501 to be read by Arduino Uno

    First of all, I want to apologize - I am very, very new to LabVIEW and brand new to the development of the software of control equipment in general. I tried to find an answer to this question already, but I'm not entirely sure what I'm looking for.

    I have currently a work program LabVIEW which operates a gun card NI USB-6501. Due to the nature of having a machine that springs from a powerful beam of electrons, we want to assure you that if the computer controlling stalls or fails for any reason, we have built-in security that can stop the gun. Our current idea is to connect an Arduino Uno on a PIN on the USB-6501 and LabVIEW to generate a timed signal, which may read the Arduino. If the signal fails (indicating that the control computer has queued or off), the Arduino triggers a power relay that is independent of the control computer and turns off the gun.

    I understand that the USB-6501 operates on TTL signals, so the signal that I should be something in the sense of "output TTL high, wait 1 second, output low expectations, a second, repeat TTL ', but I have no idea how to go about programming in LabVIEW. My first thought was that it is a square wave by using the function "simulate the signal" output, or to have trigger an iterative Boolean signal, by using the function 'DAQmx write', but I don't really understand how do to implement or another idea, or if an idea would even work.

    Any advice would be greatly appreciated.

    Hi Elizabeth,.

    THINK THE STREAM!

    When do you DATAFLOW think everything falls in places!

    Several problems:

    -You have to put that MAKE impulse VI in his own loop parallel to your main VI!

    -When you place this generation of impulses in the effects loop ("TTL arduino low-high") you should put the CreateTask and StopTask outside the loop: no need to create/stop the task in each iteration.

    -Why are there points of constraint to waiting functions?

    -Why is there bent wires? You know Ctrl-U?

    -LabVIEW comes with an extensive library of example screws: you looked at all these examples DAQmx?

    -Suggestion: Learn more about the "structures of producer-consumer"!

  • VISA LABVIEW WITH ARDUINO ERRORS

    ANY1 CAN HELP ME? AND ANSWER ME?

    I have attached my DAC08 program linked with arduino.when, I command you to serial arduino DAC monitor responds means arduino prog is ok. but when I have LabVIEW command it's not working. I don't want to use LIFA. I just wnt to use VISA to make the animals to my arduino on selection and my arduino to be programmed for each time a hexadecimal string of particular comes from visa what corresponding hexadecimal code must be routed to the device.labview interface is not reached.

    I could not attach the file of arduino prog .ino. So I copy the same here pastin

    #include
    #include "htoi.h".
    void setup()
    {
    Serial.begin(9600) (9600);
    DDRC = 0XFF;
    }

    void loop()
    {
    char a = Serial.read ();
    Switch (a)
    {
    case "164":
    PORTC = 0XFF; THESE VALUES MAY VARY AS YOU WANT
    break;
    case "B":
    PORTC = 0 X 00;
    break;
    case 'C ':
    PORTC = 0XC0;
    break;
    case would ": //MORE CASES CAN BE ADDED for the purpose of TESTING IF NECESSARY"
    PORTC = 0XD0;
    break;
    by default:
    PORTC = 0 X 00;
    }
    }

    and print screens to block dia LabVIEW

    Please answer quickly m really in need

    concerning

    rich


  • I'm waiting times tries to access a parallel port with VISA

    I get VISA time-out errors when you try to write to the parallel port. MAX said that the port works and I should be able to communicate with him. Device Manager Windows 2000 also said that the device works. I use writing to the parallel port with VISA example I found on the site of nor. To make it even more confusing (or), it runs on one computer but not another. All software and drivers are the same on both machines. On one who gives me the error of time-out, I am able to write to the parallel port using "accesshw".

    What a coincidence. The computer that I had problems with is also a Dell Optiplex. The pins of wiring together the way that you have specified has solved my problem of timeout. The cable I got with just bad has terminals 11 and 12 low attached as indicated on the page with a link to the code sample titled "with the help of VISA to access the Parallel Port in LabVIEW" I know why the original cable worked with a bridge but not a Dell Optiplex. Thanks for the quick fix!

  • Event ID: 7024 with error message: "the Windows Firewall service stopped with the error service specific data are invalid.

    Original title: cannot start Service Windows Firewall: Error Code 13

    Hello.

    Anyway, the Action Center has begun randomly telling me that the Windows Firewall is disabled. When I try to start or return to the default settings, it tells me that it is not able to do.

    I went to Services and Windows Firewall is set to automatic, but it is not started. I try to start it and it tells me that it is not able to do the same. The error code is 13.

    I am an administrator.

    MalwareBytes did find and delete a virus named "Disable.SecurityCenter", but after removing that I am still unable to start the Service.

    Can someone help with this problem?

    Edit: The journal ID is 7024 and description:

    "The Windows Firewall service stopped with the error service specific data are not valid... '. ».

    Hello, Connor

    You can try to perform a system restore to before that the problem started. For instructions on how to proceed, see the following ink: System Restore: frequently asked questions

    You can also try running a SFC scan to check (and repair) system corrupt/modified files. To do this, go to start, all programs, accessories, click with the right button on command prompt and choose Run as administrator. In the command prompt, type the following command and press ENTER: SFC/scannow

    David
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Z10 Z10 BlackBerry BlackBerry data are not compatible with the version of the software you are currently using

    Due to some problems with my BlackBerry Z10 I concerned with my service provider, after recommendation that I wiped my BlackBerry Z10, to update the OS security

    After all this. I am unable to restore completely, (Emails, Contacts, calendar and device settings cannot be restored)

    Link blackBerry screen: the data are not compatible with the version of the software that you are currently runnin

    Kindly guide me I'm too worried about my data, which is very important for me

    If you still get www.bberror.com//bb10-0015 and have not corrected:

    Read the troubleshooting tips for error Knowledge Base BB10-0015
    0015 - file unrecoverable system error has been detected.
    More information can be found here: http://support.blackberry.com/kb/articleDetail?ArticleNumber=000034545

    http://supportforums.BlackBerry.com/T5/BlackBerry-Z10/error-BB10-0015/m-p/2685103#M45693

    I recommend you use a charger automatic file to restore the operating system on your device:
    https://supportforums.BlackBerry.com/T5/BlackBerry-10-functions-and/upgrading-OS10-devices-using-aut...

Maybe you are looking for