Beginner's guide to outputting data from Labview to MySQL

Hi
I am a student who has only recently started using Labview for a data logging project, so my knowledge of how to use it is rather lacking. My current aim is to be able to output the logged data directly into a MySQL server, so that the data can then be remotely accessed over the internet and processed using PHP scripts.
I have basic knowledge of MySQL, as I have previously used it to create dynamic web pages, but my knowledge of how it works is also somewhat lacking. The MySQL database I would be connecting to is remotely held on a university server that I will connect to.
I have seen that such connection is possible from previous posts, but I would really appreciate a more basic account of the steps that I would need to follow to make such a connection possible.
Thanks,
Rob
Solved!
Go to Solution.

One thing to bare in mind is that you do not HAVE to create a DSN connection in the 'Data Sources (ODBC)' section of the Administrative Tools.
You can actually just wire the appropriate connection string to the 'DB Connect' VI. I do this my self because it allows me to easily install applications without having to manually create a DSN in windows . It also means that if I load the connection string from a file, I can easily change the database to read by just editing the INI file..
My connection script is as follows (tested with LabSQL - and the NI connectivity toolkit) ......
DRIVER=MySQL ODBC 3.51 Driver; DB=<Schema Name>; server=<pc name or IP Address>; UID=<username>; PWD=<password>; OPTION=785

Similar Messages

  • Output data from LabVIEW, input to C++ code

    I currently have a LabVIEW VI which grabs data (range and angle measurements) from the RS232 serial port, and formats this data into two values - X and Y coordinates (double data types).  What I want to do is pass these individual numerical values (not an array of X/Y coordinates) to a C++ gesture recognition program that inputs X and Y coordinates and determines the gestures.
    What is the best way of passing a value from LabVIEW to C++ code?
    I apologize if this was answered in another thread - I searched through some, but couldn't find any information relevant to my question.  Thanks for the help!

    Hi delvec28,
    delvec28 wrote:
    I currently have a LabVIEW VI which grabs data (range and angle measurements) from the RS232 serial port, and formats this data into two values - X and Y coordinates (double data types).  What I want to do is pass these individual numerical values (not an array of X/Y coordinates) to a C++ gesture recognition program that inputs X and Y coordinates and determines the gestures.
    What is the best way of passing a value from LabVIEW to C++ code?
    I apologize if this was answered in another thread - I searched through some, but couldn't find any information relevant to my question.  Thanks for the help!
    You may want to build a DLL.  A DLL is like a collection of functions - compiled in a way to be used by other programs.
    If the C++ code calls a LabVIEW function which returns values to the C++ code, then the LabVIEW code will be compiled as a DLL.
    C++ code could also be compiled into a DLL usable by LabVIEW.
    There are also ways for separate applications to share data - LabVIEW can be an ActiveX server, LabVIEW also supports DDE (Dynamic Data Exchange)  - these are both Windows-OS-specific.  LabVIEW can be a .NET client, though (as far as I know) LabVIEW cannot yet implement a .NET server.
    TCPIP is yet another (OS independent) method of sharing data between LabVIEW and another application - it's really not too complicated (at least not on the LabVIEW side .)
    Are there two applications running (C++ + LabVIEW)?  If not, in which language is the main program written in?
    Cheers!
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • Writing data from labview to excel

    Hi, currently I'm trying to get an array of data from labview into a specific excel file everytime.
    The attachment i have is a program creating a new worksheet everytime it runs. I couldn't figure out how to make it work. Anyone can help me? 
    Attachments:
    Excel Copy Example.vi ‏19 KB

    So what is the specific problem? What is it doing that is incorrect? If the problem is that it is creating a new file every time its because the first subVI is opening a spreadsheet template file. Or at least I think it is since all of the subvis are missing...
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • ABAP program to output data from SAP table to an XML format file?

    hello ABAP experts,
    Does anyone know how to output data from SAP table to an XML format file?  Would be appreciated if someone show the detailed sample codes and we will give you reward points!
    Thanks!

    Edited by: Jose Hugo De la cruz on Aug 19, 2009 8:23 PM

  • I would like to build I data base in teststand which collect data from labview , if you have example (sequence) that give me some way to build sequence

    I would like to build a data base in teststand which collect data from labview program , if you have example (sequence) that give me some way to build sequence that have step of action for labview and step
    data base

    There is an example in the \TestStand\Examples\Database directory. Basically there are two ways to connect to your database.
    1. You can use the TestStand database step types. There are steps for opening/closing a database connection, opening/closing an SQL statement, and a step for performing a data operation.
    2. The other way is to use the TestStand database logging capability to write your results to the database. This is the way I would recommend. With database logging, you use the step results container to record all your results as the sequence runs. (This is done automatically by TestStand). When the sequence is complete, the process model calls a "Log to Database" sequence that will write the results to the database. You must define your datab
    ase schema using Configure->Database Options. There are some default (or example) schema definitions already defined. Refer to chapter 18 of your TestStand manual.
    Another way to log the data as the sequence is running is shown in the \TestStand\Examples\OnTheFlyReports. This has the advantage of recording data as it is obtained, but it is not as efficient in terms of using a database connection. I don't recommend using this method.
    Please post again if you have any more questions. If you are using stored procedures with your database, I can probably give you some tips.
    Mark

  • How to insert data from JTable to mysql Table....

    hello everybody
    i need help about how to insert data from JTable to mysql table... i know about how to create Table model...facing problem about how to insert data from JTable to mysql table....any helping link or code ... ill be thankfulll....for giving me solution...

    table1.getValueAt(table1.getSelectedRow(),0)you are getting the value of a selected row... or if you want you can just use a loop..
    for(.....){
    table1.getValueAt(x,y);
    }I think you know INSERT STATEMENT.. here on it just string concat
    sample e.g. (This not insert)
    "delete from accrule " +
                    "where ruleid= " + tblRA.getValueAt(tblRA.getSelectedRow(),0)+
                    " and accountname='"+tblRA.getValueAt(tblRA.getSelectedRow(),1)+"'"

  • Help combining output data from an HP4140B and a LakeShore 330

    Hi!
    First of all, I would like to apologize if this question has already been answered in the forums, but I haven't been able to find anything for this particular situation... I am using LabView v.8.6 so as to conduct TSC (thermally stimulated current) measurements, by controlling a Lake Shore Cryotronics 330 (Lake Shore Model 330 Autotuning Temperature Controller) and a HP4140B pA meter. I am taking as a starting point the VIs available in the driver libraries (http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=014FB74E7B0C1ED3E0440003BA7CCD... and http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=E3B19B3E92C3659CE034080020E748..., respectively), and I would like to merge both programs ("Lake Shore Cryotronics Controller Output.vi" and "HP4140B Example (current vs. voltage).vi") into a single program that can simultaneously record both the current values (at a fixed voltage) from the HP4140B and the temperature as it is changed in the 76K to 300K range (with the Lakeshore 330).
    The problem lies in the fact that I don't know how to make compatible the numeric output "Sample sensor data" of the Lakeshore with the numeric array (which does not have a defined size) named "current/cap" of the HP4140B in aforementioned programs. What I am trying to do is to: (1) save the data to a file (I have attempted using "Write to measurement file" Express block, which I am not sure of whether it's the best option or not); and (2) plot current vs. temperature (not current vs. time and temperature vs. time separately).
    Any help with these issues would be most appreciated, since I'm stuck on my research because I can't record any data! This really goes right over my head...
    PS: I enclose the file that I have been working on, but perhaps it's better to work from scratch (I'm still a newbie and I may have made errors!)
    Solved!
    Go to Solution.
    Attachments:
    Current_vs_Temp.vi ‏69 KB

    Kyle,
    Thank you for your response and sorry for having taken a while to reply, but the equipment is shared with other groups and I haven't had access to it in a while.
    I have managed to get the program running using LabVIEW 7.1 (I don't know why, but the HP4140B drivers don't seem to be compatible with LabVIEW 8.6) and using the "HP4140B Read Single Meas.vi" example (and not "HP4140B Read Wave Meas.vi", as I had tried before) so as to get a double instead of an array, avoiding synchronization problems when merging data from the HP4140B and the LakeSHore 330. Then I have used a do-while loop to get "continuous sampling" of the waveform. Nonetheless, because of having chosen this approach, now I can only use a fixed voltage, which would be of for a TSC measurement, except for the fact that I need to increase the voltage in small steps so as to avoid damaging the sample. I am using another do-while loop so as to keep increasing the voltage gradually (and also be able to update the LakeShore 330 parameters), and once the desired voltage is achieved, I press a "stop" button, allowing the program to flow into the next stage and take the measurements... I am aware that it's not an elegant solution, so if you can come up any ideas for an improved version, it would be most appreciated!
    Regards,
    Pablo
    Attachments:
    IvsTemp_LabVIEW7_final.vi ‏267 KB

  • How to simplify opening/closing Excel to grab data from LabView based software running outside the main VI

    Hi,
    Right now I have a program written to automate an AOP pilot with a few inputs and outputs (3 valves, ozone generator, UV lamp, TOC meter, ozone meter in liquid and gas phase, and a UV-VIS detector). The valves are controlled with digital outputs, the rest are analog in- an outputs going into a USB-6009. The one exception is the UV-VIS detector (S::CAN Spectro::lyser). We read in about 200 Abs/m values with their corresponding wavelengths. The software of this tool is ran on the same computer and it writes down these values in an Excel file (.fp). My VI needs to select this excel file while running, and grabs the corresponding data from the Excel file. I made a finetuner to select the latest data from the excel file. Now, even though this works, it's not practical for many reasons. It closes all other excel files while running for example, and opens and closes Excel twice in 30 seconds.
    I found out the software of the UV-VIS detector is written in LabView too, but the company doesn't seem to care much about sharing the original VI's or making it complementary with other LabView VI's. Now I was wondering if there's an easier solution than opening/closing Excel. Are global variables an option for this problem? I'm far from an expect in LabView, so I just want to know if I should put in the time to learn about global variables or not
    Thanks in advance.
    Dominic

    hello dominic;
    I have read your study about AOP recently and I wonder your Labview VI. Can you share the code you used with me?
    kind regards,
    Dr. Baris OZLUOYMAK
    Electrical and Electronics Engineer (MSc)
    University of Cukurova, Faculty of Agriculture,
    Department of Agricultural Machinery,
    01330 Adana / TURKEY
    Tel: 90 322 3386408
    Fax: 90 322 3387165
    E-mail: [email protected]

  • How to input data from labview to executable application and export the results back to labview

    I have a simple function written in m file under Matlab enviornment,
    function [c]=myadd2(a,b)
    c=a+b;
    I built it into a executable file (.exe), then I want to call it in labview and get the results.
    I followed this tutorial and some other information on line:
    http://digital.ni.com/public.nsf/allkb/5CF9526FF069EA8E862564C400579DBA
    But I didn't see any telling me how to get the Labview array data input to the EXE file and return the results data back to another indicator in labview.
    Any one have some idea?
    I appreciate the help very much.
    Arnold

    You probably need to include some command line arguments on your executable that would be the name of a file to get the data from. You could also include a command line argument telling that exe where to store the results.
    I am not familiar with Matllab to give you advice on how specifically to do that with your exe though.
    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

  • Pulling output data from .txt file

    Hello, I am trying to have a program that allows a user to input shopping items into the program andhave that input go to a .txt file called shoppinglist, then after the user is finished, he/she can type no to stop entering items to the list and the program will then pull all the info entered to the .txt file and output it to the screen, creating a shooping list for the user. My problem is that I am not quite sure how to output the data from the .txt file to the screen. Here is my code.
    import java.io.*; // uses the java io library for the
    import java.util.*; // BufferedReader class
    public class week5
    public static void main(String [] args)
    PrintWriter inputItems = null;
    try
    inputItems = new PrintWriter(new FileOutputStream("shoppinglist.txt"));
    BufferedReader outputItems = null;
    String line = null;
    outputItems = new BufferedReader(new FileReader("shoppinglist.txt"));
    line = outputItems.readLine();
    outputItems.close();
    catch(FileNotFoundException e)
    System.out.println("File file.txt not found");
    System.out.println("or could not be opened.");
    catch(IOException e)
         System.out.println("Error reading from file file.txt.");
    System.out.println("This program will create a shopping list:");
    String keepGoing = "yes";
    String item = null;
    Scanner keyboard = new Scanner(System.in);
    for (int count = 1; count < 999 && keepGoing.equalsIgnoreCase("yes");count++)
    //ask for input, write it to a file
    System.out.print("Please enter item # " + count + ": ");
    System.out.print("");
    item = keyboard.nextLine();
    inputItems.println(count + " " + item);
    //ask if you want to keep going
    System.out.print("Do you wish to enter more items (yes/no): ");
    System.out.print("");
    keepGoing = keyboard.nextLine();
    System.out.println("Your shopping list contains: " + item);
    System.out.print("");
    inputItems.close();
    } All the above does is output the last item entered by the user, not the whole shopping list. Any help is greatly appreciated.

    nim_ramesh wrote:
    outputItems = new BufferedReader(new FileReader("shoppinglist.txt"));
    /* I think u want to print the text here so */
    line = outputItems.readLine(); // Replace this line with that while loop
    outputItems.close();
    He hasn't even read the user input at that point.
    OP, you need to sit down and think about the exact order you want to do things in, and rewrite your code in a logical straightforward manner. It looks like you just threw some code in hoping it would work, instead of coding deliberately. I'm not insulting you or anything, I know you're new to Java. I'm just trying to give you some advice. Look at your code, and ask yourself why the following line of code appears before you've even written anything to your file:
    line = outputItems.readLine();

  • Unable to collect real and imaginary data from labview for hp8510C

    Hi,
    I have been trying to use LabView to collect data from hp8510C. I downloaded the drivers from NI website. I am able to sweep frequency (using vi called Agilent 8510C Frequency Sweep.vi) and see different S parameters on Network Analyzer screen but I am unable to collect any data (real and imaginary values). Please help.

    Howdy deepi,
    I'd like to know a little bit more about how you're connecting to your instrument (GPIB, serial, USB, Ethernet).  NI has a great program called Measurement and Automation Explorer that can check low level functionality (*IDN?) of your device to ensure hardware functionality.  For general help with LabVIEW, check out Instrument Control in LabVIEW.  For some more instrument specific help, try GPIB, USB, Serial, or Ethernet Instrument Control.  This should get you going. 
    Sincerely,
    Chris G in AE

  • Send Data from Labview-Pr​ogram to Twitterfee​d

    Hi,
    I would like do havbe a nice-to-handle way to look at some experimental data from home. As am a frequent "twitterer" I wondered whether I can send numerical values from Labview to a twitterfeed.  

    Hi Phil.
          This sounds like fun!  While I have no experience with twittefeed, it sounds like you [just] need to satisfy the rules/expectations of their API.
    Since LabVIEW 7.1 implements low-level TCP/IP functions, it should be possible to satisfy any interface requirements.
    On the other hand, is that really necessary?
    [From the API page] Notice the fourth bulleted item...
    The Easiest Way to Play Around with the Twitter API
    If your system has curl (and it should!), you’ve already got a great way to poke around the Twitter API. Here are some examples:
    Get the public timeline, unauthenticated: curl http://twitter.com/statuses/public_timeline.rss
    Get your friends timeline, authenticated: curl -u email:password http://twitter.com/statuses/friends_timeline.xml
    Just the headers, please: curl --head -u email:password http://twitter.com/statuses/friends_timeline.json
    Post a status update, authenticated: curl -u email:password -d status="your message here" http://twitter.com/statuses/update.xml 
    This seems to be using a utility ('curl') to post/update via a command-line interface(?)  This could certainly be automated with LabVIEW - does it look promising?
    Cheers.
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • Guided Procedures, retrieving data from services

    Hi,
    I'm making a Guided Procedure that starts from an Adobe Form, goes to a Visual Composer component and then to a final Web Dynpro component.
    VC will give two values, MATNR and KUNNR and use these two to retrieve information from the ERP to fill in the information for the Web Dynpro "Visual Approval" Callable Object.
    I've got two Actions that go to our ERP to retrieve data, but it doesn't seem to do anything ...
    In the block I've got the parameters set so that VC will give the two parameters. In result states, VC points to the Web Dynpro for the decision. If I let it point to a service the flow just stops ...
    Now when I run, and click the button, my Web Dynpro won't be filled with information ... (which is the problem).
    Cheers
    Frederik-Jan

    I tested both services and both return data. I've tried adding all the information as defaults, but still doesn't work. I think I'm missing something to connect the two actions that call the service. Are there extra settings I need to configure to make sure the fourth AC calls the former two (both are services).
    I'm not calling them anywhere now ... Here's a screenshot to clarify:
    [http://wow.telenet.be/delaware/GPprob.bmp]

  • Import data from a php5/mysql to office 365

    is there a way to import data from a deployed php5/mysql application to office 365 ??

    Hi  ,
    According to your description, my understanding is that you want to migrate your php application to SharePoint Online.
    For your issue, you can try to convert your php application to asp.net application, and 
    migrate asp.net application to Office 365.
    For more information, you can have a look at the blogs:
    http://www.asp.net/downloads/archived-v11/migration-assistants/php-to-aspnet
    http://msdn.microsoft.com/en-us/library/aa479002.aspx
    http://www.codeproject.com/Articles/21465/Converting-an-ASP-NET-site-into-a-SharePoint-site
    http://krishnamfs.blogspot.com/2013/09/steps-to-migrate-php-intranet-site-into.html
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Java app to move data from access to mysql??

    I have done very little java work...only tutorials. I am currently working on a php/mysql site. The client wants me to now write an app that will run on the customers machine and routinely (i.e. every hour) take data from an access database (this is part of a vb programmers the cutomers use) and upload it to our mysql db that is driving the webpage. What should be my first step to accomplish this? Please remember, I am VERY green with Java.
    Thanks,
    Eddie

    This can be done more easily from Perl or PHP than Java, I would think. I know this is a Java forum, so this is kind of offtopic, but why do you want to write it in Java? There's nothing wrong with that, it's just going to take you longer. (Especially since you already know PHP and you don't yet know Java.)

Maybe you are looking for

  • ISCSI connections for guests: how to set up?

    A couple of questions: 1. If we wanted to set up iSCSI connections for guests such as SQL servers, what is the best way to handle this? For example, if we had four 10-Gb NICs and wanted to use as few of them as possible, is it common to turn two of t

  • Opening SAP BPC report on server from Dashboard 4.0

    I would like to know if it is possible to open SAP BPC report/excel on server from dashboard. We should have it embeded in dashboard so that if we click on dashboard....then it should take to the underlying BPC report on server. If it is possible the

  • Install RMS 13.1 How to add data boundaries  in the ddl  files for UK?

    Hello Retail Gurus, I have installed RMS 13.1 without running the partition.ksh script while installing the Retail Database for RMS and it created some sample data too, I have seen the Install Guide and especially looked at the Partitioning Steps in

  • Flex Frameworks ?

    Hello ,   I am a Flex programmer ,  a pretty good one I would like to think.  Right now I am exploring the idea of using frameworks , Cairngorm , Mate , PureMVC.  I've seen some of their examples and "View Source Code" , however , I am a little put o

  • Photosmart C310a - photo print cut off

      I print 4x6 borderless pics from PC to the printer in the highest resoltion. The preview screen always cuts off some of the edges when in borderless mode, but none when previewing with border. Is there a way to directly fit the photo to the size of