Using LabVIEW to simulatenously control 256 Outputs on FPGA

Hello,
I am a first year graduate student classically thrown into learning LabVIEW, so I would much appreciate some help with the code I am trying to work out. To give you an idea I started watching the tutorials on creating loops in February. For reference I am on LabVIEW 2014 and using a CRio-9066 with 8 modules and 256 total digital outputs.
The goal of the code is to 1) generate on/off times for the state of the outputs on the FPGA VI and 2) to communicate this with the FPGA VI in real time. The reason the code is on a computer VI and not contained on the FPGA is because I need to use a normal distrbution function (which has inputs mean and standard deviation and outputs a value accordingly) to determine the timing. This is easily achieved on the computer, but not so easily achieved on the FPGA interface. It is essential that each output follows it's own unique timing function for my purposes.
The way the code works is that each output has it's own while loop containing a two-frame timed loop (see attached.) A sub-VI I made (with a sun icon, see attached) outputs a timing value each time it is called, and this value delays the next iteration and during this delay sets the value of the local variable as true or false (on or off.) The state of the local variable is continuously communicated with the FPGA VI using a read/write control elsewhere in the program. The FPGA VI itself is a very simple VI which has boolean switches attached to each desired output.
This code works very well for 128 outputs. However, when I try to use it for all 256 outputs it does not work. The VI does not report any errors, however about half of the loops are apparently not executing. My suspicion was that there is a limit to the number of processors that can be simultaneously utilized to execute loops in a VI, so I split the VI into two parts, each with 128 outputs communicating with the same FPGA VI. Again, I had the same issue. I am not sure if this is due to processor overuse or UI latency in labview (since the front panel is rather cumbersome.) Any suggestions would be greatly appreciated.
One thought I had to work around this is to create a VI which generates timing values and stores them in an array. Then I could create a simple VI on the FPGA which reads these values and assigns a true or false state to the output accordingly. However, when I pasted the array into the FPGA VI I was returned the following error: "The FPGA module does not support variable-sized array on the front panel of the top-level VI." Any suggestions for working around this would be greatly appreciated as well.
Any thoughts, comments or insight would be greatly appreciated. I am new to this so I realize my code is probably inefficient and such, so any tips would be awesome. Thank you.
Attachments:
Timing_Loop.PNG ‏15 KB
FPGA_error.PNG ‏116 KB

For the array error, check out: http://zone.ni.com/reference/en-XX/help/371599H-01/lvfpgahelp/creating_fixedsize_arrays/  Do you understand why a variable sized array causes problems with FPGA fabric?
You're right about loops on either the RT side of your cRIO or your computer requiring cores and that cores might have to share threads if you have too many loops.  Loops on the FPGA itself will be routed otherwise.
When you say computer, are you talking about the PC or the RT side of your cRIO?  Is there a reason you've got locals all over the place instead of shared variables?  Are the values meant to stay with the PC only or shared to the FPGA/RT?

Similar Messages

  • HELP!!! Using LabView to display/control Mitsubishi FX series PLCs

    Hello,
    I am a LabView novice and have some questions around using LabView to control and display information from several laboratory instrumentation with a Mitsubishi FX series PLC. The communication protocol for the PLC is Profibus. What LabView modules/products do I need? Will I be using the OPC server and client to communicate to the PLC? Will I be using the device drivers? Is the device drivers the same as the OPC server. Will I need a profibus network card in the PC for Labview to communicate to the PLCs. Once again, I am a novice so please be patience if I ask more questions to understand your response.

    Hi,
    The following thread seems to address a similar query:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=27248&requireLogin=False
    To answer some of your other questions:
    1. You'll be communicating with the Mitsubishi hardware using an OPC server.
    2. This isn't the same as the device drivers, though it could be included with the device drivers you got from Mitsubishi, you would have to check that with them.
    3. I don't know if you need a profibus network card in your machine, again, you'd have to check that with Mitsubishi
    NI do provide OPC software but I'm not sure if your device is supported. Check if it's listed in the following supported device list. If not you should be able to get an OPC server from Mitsubishi. According to the thread linked above they have one that's compatible with LabVIEW.
    The software NI provides that can communicate with OPC servers is called the Data Logging and Supervisory Control Module. What LabVIEW software do you currently have?
    I would advise that you contact Mitsubishi to make sure you have all the necessary hardware first. Also, ask them about the OPC server software. Then you can work on controlling the PLCs with LabVIEW.
    I hope this clarifies things but if not, post some more questions.
    Regards,
    Sarah
    Applications Engineer | National Instruments | UK & Ireland

  • Using LabVIEW for temperature control with AMREL SPS200-50-A022 power supply

    Hi, I hope someone can help me out. I'm an ME undergrad with pretty much no knowledge of LabVIEW. I am working a project which requires a temperature controller. Previously, we were using an SPS120-10 power supply from AMREL and a grad student wrote a LabVIEW VI which performed feedback temperature control. The VI would acquire temperature from a Benchlink which acquire the temperature from a thermocouple. The VI also monitor the output voltage & current and determine the power output and heater resistance from those values. When a desired temperature is set, the VI compares the actual temperature to the set temperature and adjust the voltage/current setting to achieve the desired temperature. The VI was designed to keep temperature deviation to within +/-0.5 deg C. I'm not sure of the data refresh rate, but it's on the order of seconds since the system has a small thermal mass and we're operating in the 800+ deg C range. When we were using the SPS120-10, the device used GPIB for communication with the PC. Due to higher power output demand for the heater, we switched to an SPS200-50, which only has an RS-232 port. First of all, I was wondering if someone could help me modify the VI so that it could communicate with the SPS200-50 through the serial port? In addition, the drivers for the SPS120-10 and SPS200-50 might be different. If modifying the VI to communicate through the serial port isn't enough, I would need to figure out where to modify the VI with the SPS200-50 drivers, which is provided by AMREL. If anyone would like, I can send you the VI files so that you can take a look at the block diagram and tell me where to modify it. I'm still not 100% certain I understand how to read LabVIEW block diagrams.
    Please let me know if you need any additional information. Any help would be appreciated. Thanks in advance!

    I have looked over your vi. First of all you have to do some changes in the "ARSPS Initialize.vi" See picture.
    The best way to check instrument communication is to send the *IDN? Command. The instrument will indentify itself in response to this command. The vi I have included is a labview example. Use this Vi to test your communication. Do not progress before this is working. The VI is also an excellent example on how to set up and close down RS232 communication.
    The VI "Tfeedbackpowercontroller-nolvdt-Dinh.vi" looks OK so I guess it will work then your RS232 communication with the SPS200-50-A022 is working
    good luck
    PS as mentioned before you will find all the RS232 details in the instrument manual
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)
    Attachments:
    sample.PNG ‏38 KB
    Basic Serial Write and Read.vi ‏29 KB

  • Feedback using analog input to control digital output

    Hi all,
    I've got a program that I intended to open and close two valves (and thus actuate two pneumatic cylinders) based on the readings from load cells mounted to each cylinder. The idea was that it would send a digital out to open the valve and extend a cylinder, then close the valve when the load reaches a pre-determined value (with frequency dictated by increasing or decreasing the inlet air pressure and thus the fill time of the cylinder). It would then do so for the other cylinder in a loop. The issue I have is that the response time of the loop actuating the valves was too slow-for a desired force of 1800 N I had to set the limit to 1100 Newtons. It was nice and consistent in this regard but then I started having instances where the valve would stay open long enough to apply a force of 3600+ N. The biggest need in this program is to maintain a consistent load and ensure that the max. load is not being exceeded. I've used local variables and a queue to pass the load values to the valve actuation loop but it did not seem to make a difference. I don't know if part of my problem is the mishmash of data types I'm using in passing the load cell values or if a notifier would be a better bet.
    Attached is my code (LV 8.2). Thanks in advance if anyone can offer some guidance.
    Attachments:
    Controlled_valves.vi ‏192 KB

    Here's a version in LV 8.0 and an image of the block diagram, for those running older versions of LabView.
    I'd greatly appreciate any help anyone might provide as I'm getting killed here. Thanks!
    Attachments:
    Controlled_valves.vi ‏207 KB
    Block diagram.JPG ‏177 KB

  • How to use LabView to control Primera Bravo II CD burner?

    I am trying to use LabView to control the Primera Bravo II CD burner and label printer. The software that controls the Bravo II is PTPublisher. How to use LabView to communicate/control the PTPublisher? Please help, Thanks

    Hi Qian,
    I installed PTPublisher on a virtual machine, and I was wondering what kind of tasks you wanted to control within LabVIEW.  From the program GUI, it appears like the only way to access functions is via mouse clicks.  Do you know of any other way to control the Bravo II CD burner besides the PTPublisher software?  If not, does the PTPublisher allow you to control it in some way other than clicking?
    Peter K.
    National Instruments

  • LabVIEW with version control

    Hi,
          I am using LabVIEW with version control and only want to check out the VI which I need to modify. If I changed a subVI all the VIs directly or indrectly called this VI got recompiled and in order to save them I need to check out all the VIs are affected. If I only check out the file I need to modify and ignore other recompiled VIs the problem is if I use typedef ENUM and I still want the automatically updated VI got saved. Does anybody run into this problem?
        Thanks for help!
        Regards,
        Tom
    Solved!
    Go to Solution.

    Yes, it can be a problem since LabVIEW stores the source and compiled code in the same file. There is an option to separate source from compiled code that addresses this problem. I have never used it and don't know if it causes any other problems.
    =====================
    LabVIEW 2012

  • Solar Tracker Panel using LabVIEW?

    Good Morning,
    I am required to build a simple circuit using LabVIEW that will control a single axis solar tracker in the following way;
    - The solar panel will operate on a single axis only
    - The solar panel will use 2 x Osram BPW34 photo diodes, one placed either side of the panel
    - The diodes will operate the panel until both photo diodes are conducting the saem amount of light
    - This will be monitored every (short period of time)
    - The LabVIEW model needs to be connected in some way to the model. I have use of ELVIS boards
    I have used time to meet with representatives from NI but I am still struggling to build the model.
    I could really use some help on this as I have a deadline to meet in 1 months time. I need to know the best way to interface the system and have a running prototype. I am building the prototype now and the circuitry is the final piece of the puzzle. Is there anyway somebody could help?
    Best Regards
    salisbm4

    I doubt I can help with specifics (since I've not worked with the equipment you've mentioned) but here are some general tips to consider.
    1) This type of tracking system is based around the idea that if both sensors are pointing directly at the sun, they will read the same value.  However, if they are both pointed away from the sun, they will both read a diminished amount (it's hard to say how the panel should move unless you can measure a distinct difference between the two).  I'd recommend using 3 photodiodes with the center diode mounted normal to the panel and the outer two angled away slightly (the diode reading the highest value is likely the one pointed closest towards the sun so you can infer which way to move -- center should read the highest).  All this may not really be necessary though since the path of the sun is rather predictable.  You could easily use a single photodiode if you are only concerned with maximizing the reading (since each movement through the day will be rather small)
    2) Beware Temporary Shading!! Parital cloudy conditions can  throw off your model if with your photodiodes are spaced apart (one is shaded and the other is not : be careful here).  Any nearby trees/power lines can also cast a shadow in different parts of the day.  You'll want to be careful about making hasty judgements or your panel will move away from the sun only to move back later when the shadow is gone.

  • Labview program to control keithley 2400 to output current using GPIB cable

    as topic suggests,i would like to have a VI program to let the 2400 sourcemeter output current using labview.sorry,but i'm still new to this stuff and i direly need it by today... so please help me out... thanks a LOT!also can u brief on the connection?
    Message Edited by SG_SP_OLED on 05-15-2006 12:16 PM

    Below is a link that describes what an instrument driver is.
    http://zone.ni.com/devzone/conceptd.nsf/webmain/119B3B705B84B041862567D90074F425?opendocument&node=D...
    The instrument driver found from the Instrument Driver Network for this instrument is not maintained by National Instruments. It can be downloaded from the Keithley website. If you search the Keithley site for software drivers, they do have a LabVIEW driver that should contain an example of programming with their VIs. Otherwise, you can search for examples on the Keithley site, and they do have example programs (however, it may or may not be the functionality you are looking for).
    Regards,
    Missy S.
    Calibration Engineer
    National Instruments

  • How do I use LabVIEW to control and vary the voltage on my Agilent Power Supply and simultaneously record temp from 1 DMM and voltage from another DMM?

    I am using an Agilent Power Supply  to apply a voltage to a
    thermistor to heat an Al chassis.  I want to use LabVIEW to tell
    the power supply to apply 5V for 10 minutes, then step to 7V for 10
    minutes, etc.  I am completely new to LabVIEW, so any help would be greatly appreciated!
    In addition to that, I want to place a type J thermocouple onto the Al
    surface and use a Keithley 2000 DMM to monitor the temperature (it has
    a built in conversion from V to Temp for type J).  I will also be
    using another Kelthley 2000 DMM to record the output voltage of a new
    uncalibrated thermocouple.  I would like to collect the output
    voltage for this uncalibrated thermocouple and the temperature reading
    from the type J simultaneously.  How should I go about doing this
    in LabVIEW?  I will be using version 6.1.  The power supply
    and DMMs will be connected to a PC using GPIB.
    Again any suggestions would be greatly appreciated- I have no idea
    where to begin on such a project.  I have taught myself how to
    make a basic VI- converting temp in oC to oF, but  that is as far
    as my knowledge goes.

    What you want to do should be fairly straightward and a good way to learn labview. 
    First off, if you haven't already, I would download the drivers for the Keithley and Agilent instruments.  I found the keithley drivers at the link below.  You will need to find the labview drivers for the Agilent PS at their website.  Drivers are the VI's you will use in your program to control the insturments.
    http://sine.ni.com/apps/we/niid_web_display.download_page?p_id_guid=E3B19B3E90B0659CE034080020E74861
    If you open Labview and go to the help menu and click on Labview bookshelf there is alot of information on getting you started coding labview.   This should get you started, if you have anymore questions just ask in this same thread and I am sure you will get all the help you need.
    Brian
    Message Edited by BrianPack on 09-14-2005 05:21 PM
    Message Edited by BrianPack on 09-14-2005 05:21 PM

  • DC to DC converter basics using Labview on FPGA Control with VHDL

    DC to DC converter basics using Labview 
    I am fairly a novice, that is why simplifications required, before I begin thanks in advancefor them who will response  
    I am designing a DC to DC (Intermediate Bus Converter, a step down BUCK converter, of 24 v input and output 9 v and 5 amp current output), using FPGA controller, I need to program this using VHDL, for which I take LabVIEW, but as I am new so do not have any idea as what are the steps that I need to take for implementation, what types of function that FPGA does in this so that it can generate 24 v and what other mechanisms that have to control inside or outside of FPGA programming and designing that it can give the desired output voltage, if you have any idea about this then I would be glad to receive the steps that are necessary to complete this

    NI supports two Spartan 3E products through either LabVIEW FPGA or MultiSIM, the Digital Electronics FPGA Board (http://sine.ni.com/nips/cds/view/p/lang/en/nid/207​010) and, if you are in academia, the Xilinx Spartan 3E XUP starter board (as linked by Dennis_Knutson).
    Also note that if you wanted to implement some logic in VHDL and have access to that logic in a LVFPGA diagram, you could utilize the Component-level IP (CLIP) fuctionality (http://zone.ni.com/reference/en-XX/help/371599G-01​/lvfpgaconcepts/using_component_ip/)

  • Using labview cosimulation, how to control PWM duty cycle in multisim

    I am new to using Multisim with LabVIEW using cosimulation. I want to ask if there is a PWM component in Multisim that can have its duty cycle be controlled using LabVIEW? I have an algorithm in LabVIEW that outputs duty cycle values from 0 to 1, representing duty cycle percentages.
    How do I control the PWM duty cycle in Multisim using LabVIEW cosimulation?
    Many thanks,
    SPECTRE
    Solved!
    Go to Solution.

    Hi Spectre,
    In Multisim, search for the parts base on functionality, there are some PWM models in the database.  Have a look at this knowledge base  if you don't know how to search for parts:
    http://digital.ni.com/public.nsf/allkb/7309A5CABC677296862577ED006EC99E
    Aslo, have a look at this knowledgebase:
    http://digital.ni.com/public.nsf/allkb/EF391C48CF71AE4F862571B900644F84
    This article shows how you can get Mutlisim and LabVIEW to co-simiualte:
    http://www.ni.com/white-paper/13663/en
    I hope this helps
    Tien P.
    National Instruments

  • How to use labjack U12 to control solenoid directiona​l valve with Labview in hydraulic system

    Hi,
    I need to control a solenoid operated direactional valve in hydraulic system with Labjack U12. I am using three relays but need some help on the vi. like which instrument drive I need to use etc....
    The coil voltage for the solenoid valve is :  AC120V, 60Hz; AC110V, 50Hz 
    My goal is to control this solenoid valve open/close at certin time, am using Labview 2011. Any advise would be helpful.
    Thank you!

    Have you got the relays working yet.  Do some initial testing with LJlogger to make sure hardware is controlling the relays as expected.  If you need further help with this step, provide a link to electrical details for the relays and describe how you have the relays connected to the U12.
    As for your programming in LabVIEW, I suspect you are using digital I/O, so the simplest thing to do is call EDigitalOut() to set a particular line to output-high or output-low, or if you need to set a line to input (for open-collector style control) use a call to EDigitalIn().  Perhaps look at "e function example.vi" to get started, and for general information about using the LabJack U12 with LabVIEW see topic #84 from the LabJack forums.

  • Use LabView to control light wires

    use LabView with a power point presentation to control light wires to turn on and off at specific times.
    Using windows XP and microsoft power point. As well as LabView 6i or better.

    That's fine. You have unlimited message space (at least it has been enough for all my needs so far) if you use the web interface to this forum from NI's website. Go to: http://www.ni.com/devzone/dev_exchange/
    Coming to your question, there are two parts to your application:
    1. hardware control -- obviously you will need some hardware that can output and regulate (software controlled) current. National Instruments has a wide selection of such hardware from plug-in cards to standalone modules. All this hardware integrates nicely with LabVIEW. Selecting the right one for your application can be tricky.
    The best would be to either use the DAQ Designer or call and talk to a NI Sales person. The DAQ Designer can be accessed onlin
    e here:
    http://www.ni.com/devzone/dev_exchange/
    2. I still do not understand how exactly you want to control this from PowerPoint. In any case, LabVIEW has an ActiveX Control container which can be used to display (and control) PowerPoint slides on a LabVIEW panel.
    Hope this helps.
    Khalid

  • LabVIEW controlled Arduino outputting self-clocking signal

    Hello All,
    I am trying to be able to control my LED light strip (http://www.adafruit.com/products/1376) using LabVIEW and Arduino. To do so I need to make Arduino output a digital self-clocking signal, specifically a combination of two square waves of fixed frequency with varying duty cyle. The two waves represent either a 0 or 1 to the LED strip.
    0   =   HIGH for 400 ns then LOW for 850 ns
    1   =   HIGH for 800 ns then LOW for 450 ns
    In the end, using either of those waves as a bit, I would like the full signal to have 3600 bits. After one full signal the pin would remain LOW until I want to change the color again, and would send another 3600 bit signal.
    (If you want more info on the data transmission protocol, there is more info here: http://learn.adafruit.com/adafruit-neopixel-uberguide/advanced-coding#writing-your-own-library)
    Is there a way of controlling the output of the Arduino at such high speeds through LabVIEW. If you can think of any way of doing this, please let me know.
    Thanks!

    AFAIK, the arduino LabVIEW interface module only reads and writes pin values, and it can't do this with the timing precision you need. The only way around this is to write some arduino code, which can't be done in LabVIEW.

  • I am working with a pneumatic actuator and I want to control the supply of compressed air according to the load required using labview

    Hello,
         I am working with a pneumatic actuator and this is coupled to a generator. According to the load requirement I want to control the supply of compressed air into the pneumatic actuator. 
    can someone give somehints to write a control program using labview.

    haneeshcb wrote:
    Hello,
         I am working with a pneumatic actuator and this is coupled to a generator. According to the load requirement I want to control the supply of compressed air into the pneumatic actuator. 
    can someone give somehints to write a control program using labview.
    Well....
    What are the inputs and outputs you want to acquisition(voltage, current, TTL signals, load sensing...) and control(analog voltages, TTL signals, drivers,ssr,relays, power fets...)
    Aquiring a Daq is a start or Arduino Uno to read and control your hardware interfaces to your device
    what are the specification requirements and operations...
    Have you done a forum search on key words? "pneumatic"....
    Being general, opens discussion to nebulous assumptions which members don't have the luxury of time to spend..Though they are willing to help, you must put forth more effort in describing your project, requirements, sensing and controlling, but above all..."what is the problem that you are experiencing?"

Maybe you are looking for

  • How can I retrieve my iPod Touch information after I restore it?

         A couple of months ago my computer crashed and on that computer was my itunes (which contained everything that I have on my iPod Touch, over 150 purchased songs, a couple of purchased apps aswell as purchased movies, tv shows and music videos).

  • Reader X cannot open dosument in Firefox 4

    Hi I lately installed Windwos 7 (32bit) professional from the scratch. I was also installing Abobe Reader X and afterwards Abode CS3 Design premium, which i updated after installation. Now, PDF files usually don't open in Firefox 4 (sometimes they do

  • Difference between Function and Stored Procedure

    Hi guys, i don't understand the exact difference between a function and a stored procedure. I did lot of google but still. Can somebody explain in simple words. Thanks.

  • What query can we use ...for over 30 days

    select PROPERTY,RELAVANTDATE , sum(NOTICES) over ( partition by property order by RELAVANTDATE range between interval '30' day preceding and current row ) "SUM" from Test_Data what query can we use ...for over 30 days can i use following or preceding

  • Packages cannot be nested

    I'm a newbie and have started a simple tabbed mobile project. I keep getting "packages cannot be nested". my main mxml file: <?xml version="1.0" encoding="utf-8"?> <s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"