Python and LabVIEW

Has anyone connected Python and LabVIEW?
I would like to use Python as a scripting language with LabVIEW for the task
that may be done simplier in Python.
I have some ideas about connecting via TCP/IP. But may be someone has
already done this?
Regards,
---Dmitry.

I have called Python scripts from LabVIEW using system exec. The attached VI has the ability to pass arguments. Data is returned from Python as print statements and then parsed.
-Jim
Attachments:
python.vi ‏36 KB

Similar Messages

  • Error involving Report Generation Toolkit and Labview Run Time Engine

    Developed an application using LabVIEW 6.1 and LabVIEW Report Generation Toolkit for Microsoft Office 1.0.1. From there, tried to build a shared application for use with the LabVIEW Run Time Engine. The Run Time version functions properly until "New Report.vi" is called and then an error is generated, code 7, calling out "Open VI Reference in New Report.vi" could not be found. When building the application, I did include the "NI Reports Support" in the advanced installer options. The machine used for original development and application build is running Windows XP Pro and Office XP. Any suggestions??

    I am having the exact same problem but with LV 6.1 and M/S WORD 2000. It appears that the "New Report.vi" is trying to open "C:\APP.DIR\Word_Open.vi" and "C:\APP.Dir\Word_Open_Document.vi" by reference. The "OFFICE 2000.TXT" says that "_exclsub.llb and _wordsub.llb must be added as support files when building an application or a dynamic link library with the application builder." I added them as Support Files and I copied them to the "C:\TESTER\" where the TESTER.EXE is and I still get ERROR 7 in "NEW REPORT.VI" at VI OPEN REFERENCE.
    Do I need to make a "C:\TESTER\DATA\" sub-dir and put the support files there?
    I am building on MY COMPUTER on F: Drive on a network and transporting files to the real Tester.
    I displayed my App.Property of APP.DI
    R at start up and it is C:\TESTER\ ! How would my application know that "Word_Open.vi" and "Word_Open_Document.vi" are actually inside the _wordsub.llb?
    Any ideas ?
    Greg Klocek

  • Communication problem with FP-2000 and Labview 7.1

    I am using the FP-2000, DO-403 and TC-120 modules with Labview 7.1, being run on a host computer via an ethernet connection.  The setup has operated flawlessly for ~2 years; recently, I have noticed that while a VI is running on my PC, connection to the FP module ceases.  There is no pop-up "connection error" in my VI, and the all the power and status LEDs on the FP modules are normal.  I can still interact with the VI on the front panel while it is running, but nothing is passed to the FP module.  I have tried communicating with MAX when this occurs and receive a "no connection" message.  Is there a simple solution here, such as rebooting the FP module?  Or is it time to invest in new hardware?
    Justin

    I am having a very similar problem with my cFP-1804 and Labview 7.0.  I have no problem initiating communication over ethernet, and the vi will run perfectly for hours or even days.  Inevitably, however, at some point there is no longer communication with the cFP-1804.  Data is no longer being passed either to or from the cFP-1804, and MAX will show that the device is not connected.  I also will not see any pop-up error message that says the connection has been lost, either from Windows or from Labview.  The vi will just continue to run as if nothing has happened.  Turning the power to the cFP-1804 off and then on will always resolve this problem.  Since I am using the cFP-1804 primarily for data logging, however, this behavior is particularly problematic as the system will record nothing but zeroes until I discover that the communication has been severed and perform the manual power cycling.
    I have been unable thus far to determine the cause of this problem.  Any help would be greatly appreciated.
    Thanks,
    Derrick

  • I have a problem with simulation in Matlab 6.5 and LabVIEW for PID controllers

    I have a problem with simulation in Matlab 6.5 and LabVIEW. I have some methods for granting PID controllers in MATLAB to go but not LabVIEW. International Teams degree to transfer two but when I go past the fourth degree no longer work. We changed the formula for calculating the parameters for grade four and gave me some good values for Matlab award but when I put on LabVIEW have not settled. formulas are available in PDF and are. Please help me and me someone if possible. Thanks
    lim.4 generation parameters in MATLAB program and comparison methods are for second-degree transfer function.
    Solved!
    Go to Solution.
    Attachments:
    Pt net.zip ‏2183 KB

    This is the VIs what i try to make,but is not work. This pdf. document was used to create last VIs PID. thenk you for your colaboration.
    Attachments:
    PID create by me.vi ‏312 KB
    tut_3782.pdf ‏75 KB

  • Google Earth Plugin and LabVIEW: High CPU usage when adding placemarks

    Hi,
    I posted this question on stackoverflow earlier this week but feel it might be better suited to the LabVIEW community specifically so I'm reposting here:
    I'm writing an application which uses the Google Earth Plugin to display events on the globe. Each event is a single point kml placemark with an icon which is a 3kb png file. Placemarks are uploaded to the plugin as they are received by the software. I am experiencing increasing CPU usage with the number of placemarks that are added.
    I have tested displaying a new placemark every second and running until the software running the plugin completely froze (graph attached). The GEPlugin (green trace) stopped responding (i.e. the globe did not respond to the mouse) at around 1200 placemarks added and CPU usage was at ~30%. When the software itself (red trace) froze the plugin was using around 50% CPU and ~3700 placemarks had been added). After the freeze, no new placemarks were added which caused the software to respond (but not the plugin) so I could clear all the placemarks. After the placemarks were cleared from the globe, the CPU usage of the plugin returned to around 5% CPU.
    So what I've seen is that GEPlugin CPU usage increases linearly with each kml placemark added. Is this the expected behaviour/ a normal limitation of the plugin? If not is there a more efficient way of adding many placemarks to the globe?
    I am using GEPlugin version 7.1.1.1580 (API version 1.010) and LabVIEW 12.0f3
    Please see the test results attached. Any input greatly appreciated!
    Original stackoverflow post:
    http://stackoverflow.com/questions/20994323/google-earth-plugin-with-labview-high-cpu-usage-when-add...
    Attachments:
    Performance Log 020114_095115.png ‏82 KB

    Hello,
    I have had a look at your graphs and understood what you are trying to do. To me it seems that as the image gets more complex it gets harde to render which wold likely cause increase in CPU usage resulting in the freeze. I would suggest you try running the program on anoher computer to check on the RAM front of things. If this is a limitation of the GE Plugin then unfortunately I can not do much to help, but if you think this is a problem coming from your LabVIEW code then you can post your code here and I can take a look.

  • Launching programs from python and ncurses

    I've made a little menu launcher with python and ncurses. It works most of the time, but occationally it does nothing when I select a program to launch.
    This is how it works:
    1. A keyboard shortcut launches an xterm window that runs the program.
    2. I select some program, which is launched via this command:
    os.system("nohup " + "program_name" + "> /dev/null &")
    3. ncurses cleans up and python calls "sys.exit()"
    The whole idea with nohup is that the xterm window will close after I select an application, but the application will still start normally (this was a bit of a problem). This works most of the time, but sometimes nothing happens (it never works the first time I try launching a program after starting the computer, the other times are more random).
    So, has anyone got an idea of what's going on or a better solution than the nohup hack?
    The whole code for the menu launcher is below. It's quite hackish, but then again it was just meant for me. The file's called "curmenu.py", and I launch it with an xbindkeys shortcut that runs "xterm -e curmenu.py".
    #!/usr/bin/env python
    import os,sys
    import curses
    ## Variables one might like to configure
    programs = ["Sonata", "sonata", "Ncmpc", "xterm -e ncmpc", "Emacs", "emacs", "Firefox", "swiftfox",\
    "Pidgin", "pidgin", "Screen", "xterm -e screen", "Thunar", "thunar", \
    "Gimp", "gimp", "Vlc", "vlc", "Skype", "skype"]
    highlight = 3
    on_screen = 7
    ## Functions
    # Gets a list of strings, figures out the middle one
    # and highlights it. Draws strings on screen.
    def drawStrings(strings):
    length = len(strings)
    middle = (length - 1)/2
    for num in range(length):
    addString(strings[num], middle, num, length)
    stdscr.refresh()
    def addString(string, middle, iter_step, iter_max):
    if iter_step < iter_max:
    string = string + "\n"
    if iter_step == middle:
    stdscr.addstr(iter_step + 1, 1, string, curses.A_REVERSE)
    else:
    stdscr.addstr(iter_step + 1, 1, string)
    # Returns a list of strings to draw on screen. The
    # strings chosen are centered around position.
    def listStrings(strings, position, on_screen):
    length = len(strings)
    low = (on_screen - 1)/2
    start = position - low
    str = []
    for num in range(start, start + on_screen):
    str = str + [strings[num % length]]
    return str
    ## Start doing stuff
    names = programs[::2]
    longest = max(map(lambda x: len(x), names))
    # Start our screen
    stdscr=curses.initscr()
    # Enable noecho and keyboard input
    curses.curs_set(0)
    curses.noecho()
    curses.cbreak()
    stdscr.keypad(1)
    # Display strings
    drawStrings(listStrings(names, highlight, on_screen))
    # Wait for response
    num_progs = len(names)
    low = (on_screen - 1)/2
    while 1:
    c = stdscr.getch()
    if c == ord("q") or c == 27: # 27 = "Escape"
    break
    elif c == curses.KEY_DOWN:
    highlight = (highlight + 1)%num_progs
    elif c == curses.KEY_UP:
    highlight = (highlight - 1)%num_progs
    elif c == curses.KEY_NPAGE:
    highlight = (highlight + low)%num_progs
    elif c == curses.KEY_PPAGE:
    highlight = (highlight - low)%num_progs
    elif c == 10: # actually "Enter", but hey
    os.system("nohup " + programs[2*highlight + 1] + "> /dev/null &")
    break
    drawStrings(listStrings(names, highlight, on_screen))
    # Close the program
    curses.nocbreak()
    stdscr.keypad(0)
    curses.echo()
    curses.endwin()
    sys.exit()

    Try:
    http://docs.python.org/lib/module-subprocess.html
    Should let you fork programs off into the background.

  • Run-time engine problem in Labview 2009 and Labview 2010

    I have a problem with Labview 2009 and Labview 2010. I updated my Labview 2009 into 2010. But it turned out to be a trial one, because i did not have the serial number. So I uninstalled the Labview 2010. however, the funny stuff came over. I cannot use my Labview 2009. So i uninstalled Labview 2009 again. But eventually, I could not reinstall Labview 2009. Every time i had a runtime error and i could not proceed with the installation. in addition, any installation  related to Labview is not permitted and the same error came up every time. it is very annoying.
    So, What is the deal?
    I attached the error here. Any comments or advice are welcomed and appreciated.
    Attachments:
    error.docx ‏2305 KB

    By chance is this machine's language set to any non-English locale?  You would check the locale setting by:
    Opening Control Panel.
    Opening "Regional and Language Options".
    Looking Under "Regional Options" >> "Standards and Formats"
    If it is set to something besides English, trying setting it to English and please report back what locale it was set to (or if this even solves the problem).
    Regards,
    - WesW

  • Report Generation Toolkit and Labview 8 ?

    I currently have Labview 7.1 on my computer, and Labview 8.  I have installed the Report generation Toolkit 1.1.1, but when I try to open several of the excel and word vi's in labview 8, I get the error that "constants wired to case structures were changed to a hidden control to maintain compatibility with labview 7.1 and earlier".  And therefore the subvi's don't run.  Labview 7.1 doesn't have the toolkit installed, and I've even tried uninstalling 7.1 but nothing works.  How do I fix this?  Relinking to subvi hasn't work because it is not offered on any of the errored vi's or subvi's.  The broken wires are going into invoke node vi's, but I don't know how to fix them.  It doesn't allow me to rewire them.

    If you dont want to use it in LabView 7.1, Just make a mass compile with LabView8.0 on the directory of you package.
    It could solve a lots of that kind of problem.
    Be sure that you do net need it with your previous version.
    Benoit
    Benoit Séguin
    Software Designer

  • How to acquire data through multiple channels in parallel using PXI 6070 E, PXI 4071 and LabVIEW?

    Hi,
    I am using NI LabVIEW, NI PXI 4071, and NI PXI 6070E to measure current through a variable resistance. Now, I am using one channel from SCB-68, but I want to add another channel in parallel so that I can have two resistors instead of one that I cam measure current through them.
    I have attached a Pdf file showing the setup for hardware in use and LabVIEW code also.
    Can anyone look at these files and give me guide lines or ideas that can help me resolving this issue, please.
    Thanks in advance.
    Best Regards,
    Shaheen.
    Solved!
    Go to Solution.
    Attachments:
    IV copy for HS.vi ‏55 KB
    Layout of NI Cards.pdf ‏248 KB

    Your 4071 can only do one measurement at a time. Your DAQ cannot measure resistance either nor has it got any analogue inputs.
    However, you could use a multiplexer and multiplex your 4071 DMM. This wont give you simultaneous measurements but can acquire data one after the other, the speed is obviously dependent on the multiplexer you choose!
    Hope this helps.
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • MATLAB and LabVIEW Communication Optimal Performance

    I have tried my own code,  searched through forums and examples to try and figure out best method to communicate between LabVIEW and MATLAB.  Most of the information I found was over a year old and I was wondering if there was a better current solution.  My goal is to work in LabVIEW to collect the data, process in MATLAB and return the results to LabVIEW.  I have encountered some difficulty in my search and before I delve even further in to one in particular, I was wondering if anybody had an optimal solution with this communication protocol or solutions to my errors encountered thus far.
    I have looked at the following methods.
    1)TCP/IP and a very good example found here: http://www.mathworks.com/matlabcentral/fileexchange/11802-matlab-tcp-ip-code-example
    When I try to adjust even the example and communicate for my own purposes I get the following errors
    Error 63 if MATLAB server not running
    Error 66 occurs if the TCP/IP connection is closed by the peer. In this case, Windows notices that no data is returned within a reasonable time, and it closes the TCP/IP connection. When LabVIEW attempts to communicate after Windows closes the connection, error 66 is the result. 
    However, the example itself works perfectly and does not get these errors
    2)Math Script Node, works but the post below states that MATLAB Node is faster.
    "computing fft of a 1024x1024 matrix ten times (attached code). Result is that Matlab node version takes 0.5s versus 1.6s for Mathscript node version."
     http://forums.ni.com/t5/LabVIEW/Why-are-mathscript-performances-much-below-matlab-s/m-p/2369760/high...
    3) MATLAB Node, which states it uses ActiveX Technology seemingly works well, but loses time for data transfer.
    4) Trying to use the ActiveX functions or if there is other Automation potential.
    5)Other solutions that I have not found that might be better suited.
    Thank you for any help or suggestions in advance. 

    Barp and Mikeporter,
    Thank you for your assistance:
    The reason I need to do the processing in matlab is as you mentioned the processing script is coming from another person who has already developed it in matlab.  I almost have to treat it as a black box.
    The TCP/IP method was interesting is that none of the errors show up when I run the example but if I try to modify it in a new VI I get the errors.
    I have attached a simple program that just has a basic butterworth low pass filter I am trying to confirm if it works in the Matlab node.  I have done other simple codes which work, and this one does not seem the implement  the appropriate filter.  The LabVIEW signal and LabVIEW filter seem to work at the default values (but not if I change sampling rate) for the Simulation of signal, Matlab signal and Matlab filter work, but the Labview signal processed in Matlab is not working...
    Ideally it would be bandpass filtered (0.1-30) at sampling rate of 256 Hz and further processed from there, but I can't even seem to get low pass to work in the matlab to labview communication.
    Any help would be greatly appreciated.  Once I have that working I will have more of an idea of the constraints of the actual processing Matlab Code I will be using.
    Thank you again.
    -cj18
    Attachments:
    labview_matlab_filter.vi ‏70 KB

  • How to implement a dual booting PXI system using windows 7 and labview RT

    Good Day
    My name is Mariano Ocana from the University of Manitoba, and I want to implement a dual system using windows 7 and labview RT in a PXIe-1082 chassis with a PXIe-8102 embedded controlled (the chassis came with windows 7 installed). What are the steps to use both systems (windows and RT)  in the same chassis?, in the NI help comes an example implementing a dual system using windows xp and RT, it is the same procedure?.
    Thank you in advance for all your help.
    Regards
    M. Ocana

    Greetings, Mariano.
    The real issue you have to contend with is whether or not you have a LabVIEW RT license.  If the 8102 controller was purchased Windows-Only, you likely do not have a license to run LabVIEW RT on the controller - you can purchase one, I think it's about $500, and at that point you can request a LabVIEW RT Configuration CD (that's not what it's called, but the sales guy will know what I'm talking about).  The Config CD is a CD that will partition your controller correctly with both FAT32 and NTFS filesystems (in the appropriate way) to allow you to run Windows 7 and LabVIEW Real-Time on the controller correctly.  Once done, you can then switch within the BIOS between LabVIEW Real-Time and Windows in order to dual-boot.  
    Either way, you likely need to contact NI sales to either purchase an RT license (if one was not received at the time of purchase) or to request a Configuration CD (it might also be called a dual-boot install CD or similar).
    -Danny

  • Set up and control "counter" in S7-300 by OPC and LabVIEW

    Hi everyone,
    I am using a PLC S7-300 and OPC Server for my projects. I have a problem: S7-300 has a counter module which count digital signal. I only can set it up by using SIMATIC STEP 7. Can I set up counter module by only using OPC Server and LabVIEW
    does anyone have any solution or any idea for my problem?
    could you please help me...
    thank you
    Solved!
    Go to Solution.

    Hi Echion,
    NI-DAQ(mx) is used just for NI-Hardware: no you can't use it.
    To program the PLC you need to use the right programming environment. For Siemens S7 you need to use Simatic (or maybe some other 3rd party software supporting IEC61131). Point.
    The OPC server is used just for data exchange. It's no programming interface!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Communicate large number of parameters and variables between Verstand and Labview Model

    We have a dyno setup with a PXI-E chassis running Veristand 2014 and Inertia 2014. In order to enhance capabilities and timing of Veristand, I would like to use Labview models to perform tasks not possible by Veristand and Inertia. An example of this is to determine the maximum of a large number of thermocouples. Veristand has a compare funtion, but it compares only two values at a time. This makes for some lengthy and inflexible programming. Labview, on the other hand, has a function which aloows one to get the maximum of elements in an array in a single step. To use Labview I need to "send" the 50 or so thermocouples to the Labview model. In addition to the variables which need to be communicated between Veristand and Labview, I also need to present Labview with the threshold and confguration parameters. From the forums and user manuaIs understand that one has to use the connector pane in Labview and mapping in Veristand System Explorer to expose the inports and outports. The problem is that the Labview connector pane is limited to 27 I/O. How do I overcome that limitation?
    BTW. I am fairly new to Labview and Versitand.
    Thank you.
    Richard
    Solved!
    Go to Solution.

    @Jarrod:
    Thank you for the help. I created a simple test model and now understand how I can use clusters for a large number of variables. Regarding the mapping process: Can one map a folder of user channels to a cluster (one-step mapping)? Alternatively, I understand one can import a mapping (text) file in System Explorer. Is this import partial or does it replace all the mapping? The reason I am asking is that, if it is partial, then I can have separate mapping files for different configurations and my final mapping can be a combination of imported mapping files.
    @SteveK:
    Thank you for the hint on using a Custom Device. I understand that the Custom Device will be much more powerful and can be more generic. The problem at this stage is that my limitations in programming in Labview is far gretater than Labview models' limitations in Veristand. I'll definitely consider the Custom Device route once I am more provicient with LabView. Hopefully I'll be able to re-use some of the VI's I created for the LabView models.
    Thanks
    Richard

  • BasicTx and BasicRx daughter boards compatibility with USRP2920 and LabView

    I want to know that BasicTx and Basic Rx daughter boards from Ettus research are compatible with USRP2920 and Labview or not.
    Also do these boards supports variable gain or not? Please confirm 
    Thanks
    JK
    Solved!
    Go to Solution.

    They will work but you need to use property nodes to configure them. Ther is no LO so ther is no center frequency parameter. I and Q are separate channels so you will need to break them apart and treat them as such. There is no gain because the boards essentially provide access to the ADC.

  • Signal Processing and LabVIEW Expert Full Time Position – London, UK

    1x Signal Processing and LabVIEW Expert - Full Time Position – London, UK
    1.0      Description:
    As a Signal Processing/Software Engineer, you'll be part of a team that is responsible for developing applications based on large high speed data analysis for a large green energy project. Your skills must include a knowledge of Waveform analysis and understand the concepts of cross correlation, Fourier Analysis, Spectral analysis and other similar items.
    The position ideally requires someone of CLA level of LabVIEW program to act as the project lead on the programming and technical levels of the system.
    2.0      Duties and Responsibilities:
    The duties and responsibilities of this position include, but are not limited to, interacting directly with customers to program, train, inform, advise and consult in the design of their applications using the best test and measurement hardware and software by:
    ◦     Programming memory and speed efficient applications using LabVIEW and Object Oriented Programming and Event-based architectures.
    ◦     Understanding of the data acquisition side of the system and previous experience using National Instruments hardware and DAQmx
    ◦     Knowledge of Power engineering, Volts, Amps, current, Power Factor etc.
    ◦     Providing timely, accurate and effective solutions to technical problems.
    ◦     Providing guidance on the installation and working functionality of both software and hardware, including explanation of configuration settings.
    ◦     Reproducing and troubleshooting problems and incompatibilities.
    ◦     Delivering technical presentations and demonstrations to customers, colleagues and partners.
    ◦     Ability to project manage and understand how to keep on track with a Microsoft project based externally monitored project.
    3.0      Qualifications & Requirements:
    ◦     Minimum second class higher honours degree in engineering or science related field, such as electronic engineering, physics, mechatronics or computer science.
    ◦     Basic Knowledge of text based programming languages.
    ◦     Experience in either LabVIEW, minimum of three years full time and at CLA level, or capability to reach there in a short space of time with the relevant training.
    ◦     Experience in a second language such as JAVA, C and C++ is strongly preferred.
    ◦     Have a vast experience of signal processing, both digital and analog.
    ◦     Although not required, but must have skills to pass the Certified LabVIEW Developer exam and CLA within the year.
    ◦     Ability to learn new skills/languages/applications quickly (MATLAB, JavaScript, STK, etc.).
    ◦     Knowledge in instrumentation & control, and industrial automation, is strongly preferred.
    ◦     Must be able to handle multiple tasks and enjoy working with people.
    ◦     Strong problem solving skills to analyse the problem and think creatively to provide a solution.
    ◦     Excellent written, oral and presentation skills are key.
    ◦     Ability to deal effectively with customers to make them successful is essential.
    ◦     Ability to get along with others and function as a team player as well as work effectively alone.
    ◦     A proactive/can do attitude is vital and a positive outlook on problem solving.
    ◦     Legal right to live and work in the UK. Sponsorship is not available.
    ◦     Must hold a full valid UK driving license.
    4.0      Location:
    This role is located in London, UK
    5.0      Reporting:
    Signal Processing Engineers will report to the Technical Director.
    6.0      Salary:
    Competitive salary based on level of experience.
    7.0      Application:
    To apply for this position please send a copy of your CV to
    [email protected]
    Please state the job title of LabVIEW Signal Processing Engineer in the email subject.

    Hi,
    I am from india.I can able to complete the projects through the internet itself.
    Please let me know if any demos required to show my expertation. 

Maybe you are looking for

  • Midi auto-loops unwanted

    Lately when i record midi regions they are automatically looped over 8 or 9 times as soon as i finish recording the strikes. I'm wondering if I've accidentally turned on some sort of "auto-loop" feature. Any idea how to turn it off?

  • What is the best way of putting music onto another iphone?

    What is the best way of putting music onto another iphone for a different itunes account user and different phone carrier? multiple user accounts on my mac? or home sharing to put the music on? then they have their own itunes account for apps etc?

  • Help. How do you TAB from HTML component to applet (and back) ?

    How can one tab between applets in a browser, and from an applet to an HTML component? For example, I have the following in my page in decending order: an HTML text field, an applet containing two components, and another HTML text field. When focus i

  • LaCie electron 22 blue

    hi i would like to know if it possible to connect the LaCie electron 22 blue (4) to the newest mac mini. thanks

  • How do I customize my Discussions iViews?

    Hi all, I am using EP6.0 SP2 Patch2 HotFix2. I want to customize my KM Discussions iViews. In every such iView, there is a heading "Discussion" at the top and a short description of the discussion below that. This is standard for any Discussions iVie