Stream data from a subvi to the main vi - path refnum

hello everyone
sorry my english
http://forums.ni.com/t5/LabVIEW/stream-data-from-a-subvi-to-the-main-vi/m-p/2205150/highlight/true#M...
- refnum boolean worked
- refnum graph worked
- refnum numeric worked
how to create a  path refnum? stream data from a subvi to the main vi
where do I start?
thank
Solved!
Go to Solution.

Bom Dia Saille,
Eu acredito que o que você tenha hoje seja isso aqui (Desenho bem simplificado):
Hoje o que você tem é o Aplicativo do Medidor + USB Driver controlando o seu medidor. Basicamente, sua aplciação está dividida em três camadas:
Aplicação - Onde estão as funcionalidades principais do programa (interface com o usuário, apresentação de dados, geração de arquivos, etc.)
VISA - Uma arquitetura de Software para controle de instrumentos. Basicamente, ele se comunica com o Driver USB para poder enviar e receber pacotes de dados através do barramento USB.
Device Driver - Intruções de SW de baixo nível para controlar um periférico através de um barramento.
No desenho, eu aponto duas camadas onde você pode tentar atuar para automatizar suas medições:
Aplicação - Você pode usar o VI Server para controlar o Aplicativo do Medidor (Se este aplicativo tiver sido desenvolvido em LabVIEW, o que eu suponho ser verdade). No entanto é necessário saber se o desenvolvedor do produto permitiu isso (Veja Using VI Server to Pass Data Between a VI and a LabVIEW Executable). Outra alternativa é conversar com o fabricante para ver se ele desenvolveu alguma API (Application Programming Interface) para que você consiga controlar o instrumento diretamente.
VISA - O LabVIEW Fornece uma API chamada NI-VISA para poder enviar e receber informações através de diversos barramentos (Veja Serial Instrument Control Tutorial)
É possível acessar o Driver diretamente também, mas eu não recomendo. O resultado não compensa o esfroço!
Espero ter esclarecido suas dúvidas e espero que você tenha sucesso na sua aplicação!!
Atenciosamente.
Felipe Flores
Engenharia de Aplicações
National Instruments Brasil

Similar Messages

  • Stream data from a subvi to the main vi

    Hi
    I’m wondering if someone can help me. I’m trying to stream data from a sub vi to the main vi without opening and closing the sub vi continuously. The data also needs to be extracted from a while loop within the sub vi.  background info: The sub vi controls a photomultipler tube, which once it is on it is best kept on. The PMT signal is generated in while loop of the sub vi. Attached are some basic vis showing what I’m trying to do.
    Thanks
    Attachments:
    Main page.vi ‏11 KB
    test2.vi ‏13 KB

    If you are streaming measurements continously I would consider using a circular buffer instead of the queued producer/consumer approach.
    Check out this implementataion of such a buffer, use only this if your DAQ device does not have an internal circular buffer.
    https://decibel.ni.com/content/docs/DOC-20403
    Alternatively if you are using a DAQmx device, consider using the device buffer for sharing DAQ data between loops.
    Br,
    /Roger

  • Access data from a SubVi to the MainVi while the SubVi is still Running

    I want to pass some Boolean/String from a subvi to the main vi while the subvi is still running. 
    I understand that it could be done using queue/ notifier. I do not want to use global variables. I looked at different examples but failed to figure out how to do it.
    I was trying to make an example by looking at an example from Labview about notifier. 
    Can anyone please help me with this code and guide me to the correct way.
    Thanks.
    Attachments:
    mainVi.vi ‏9 KB
    SubVi.vi ‏11 KB

    Hi babu726,
    I have included a revised MainVi.vi and SubVi.vi for you. I had to modify the SubVi to get it to be called by the MainVi. I also included a disabled diagram structure with the code just copied and pasted in, since your code does not seem modular. Hopefully this helps!
    Regards,
    Michelle G
    Applications Engineering
    National Instruments
    Attachments:
    SubVi.vi ‏11 KB
    mainVi.vi ‏16 KB

  • Passing data from a subvi to the top level with continuously running loops

    Hi All,
    This is a very simple question, for some reason the data available at a subvi indicator is not making it to the top level vi. I think it might be something to do with the while loop I am using but I cant figure it out, any help will be appreciated. I don't think I fully understand how the data gets out of a continuously running loop.
    GPSdisplay runs a driver called GPS.vi (im not worried about my event structure just yet which might be wrong, but I am yet to test that bit yet) Probe 1 should have the values from GPSCluster
    Loop within GPS.vi. GPSCluster (Probe 2) is being updated correctly
    I cant work out why the data is not being passed to GPSCluster in the top vi
    Solved!
    Go to Solution.

    Hi bennymacca,
    I think you are on the right track with an FGV. You can do this fairly easily with the GPS vi that you have.
    Before I go any further, your GPS while loop will only return the last reading, and because the "Read" boolean output state is FALSE, it will not stop. Do you see it exit at all? From the logic I read, once entering this while loop it won't stop until told to.
    There are a 3 options you can try.
    1) Use an FGV, as you are looking into. To do this you will need to change the state boolean to TRUE and put shift registers in for the GPSCluster - to parse the information around, holding it each time the vi is called and exited. Outside the while loop you will wire up the Cluster to the indicator that you wish to collect (OR, you could have it inside the case statement where it is read - be careful here, though). 
    2) in the main code, above the sequence frame you can place the GPS vi while loop (the "Read" one), having the state boolean wired to a Stop button local variable. This while loop will start depending on how LV feels, so wire an error line to both the While loop and Frame start (indicating that both are to run in a parallel fashion), OR you can put it in a case statement and say 'go' when you want to start reading. With this while loop, you can then output the Read data directly into your Cluster variable as it is generated.
    But, with (2) you are moving yourself away from the purpose of the GPS vi, which would be to bring all functionality of the GPS functionality into one sub vi - which is a good idea.
    3) put a condition on the "Read" case statement boolean state - only make it TRUE when you wish to stop reading data (do you have a time or condition you can refer to here?). Even doing so, you would/may still need shift registers on your while loop to retain data for each iteration.
    I hope all of that helps. Cheers. David.

  • Use labview to collect AE streaming data from pacpci2

    Hello everyone,
    I'm using labview to collect AE streaming data from pacpci2.I have the dll from PAC,and I have  written some VIs for streaming data. Now I don't know how to read data to my program from the pci.Can the "getMessage" function do this?
    Hope somebody has this experience can help me.Thanks a lot.
    henry

    No idea because you are leaving all the details out of your message.
    What does "AE" mean in the way you use it?
    What is "pacpci2"?
    What PAC are you using?
    What "Get Message" function are you talking about?

  • How to send data from internal table to the shared folder in ABAP

    Hi experts,
             My requirement is to transfer data from a file to shared folder. i just did reading data from a file to a internal table. Now i want to send this internal table data into a shared folder which is  "
    xxx\y\z....".
    I do not have any idea on how to send data from internal table to the shared folder path.
    can anybody please help me out how to do this?
    Thanks & Regards
    Sireesha.

    Where that folder is located, its on presentation server i.e. desktop or application server.
    If its on presentation server, use FM GUI_UPLOAD.
    If its on application server, then use DATASET functions. Have a look at below link.
    [File Handling in ABAP|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm]
    I hope it helps.
    Thanks,
    Vibha
    Please mark all the useful answers

  • Data Passing from a Subreport to the Main Report

    <p>Hello,</p><p>I have been able to pass data from a subreport to a main report using shared variables. The Complete Reference: CR XI (p. 313) states that you should be able to now suppress the subreport to prevent it from showing on the main report, however this is not working. I want to get the data from the subreport and then further manipulate it in the main report, and I do not want the subreport shown on the main report. I tried suppressing/hiding the section where the subreport is placed as well as suppressing the subreport itself. The formula values on the main report become null when I do this though. Is it possible to keep the subreport off the main report?</p><p>Thanks.</p>

    Search forums, this has been answered multiple times.

  • Streaming data from disk to analog output (using the PCI-6713)

    I have a question about the PCI-6713. I want to stream data from the hard disk to all of the card's 8 outputs at its maximum update rate of 1 MS/s. Using single precision (32-bit) variables, this works out to a 32 MB/s transfer rate. That seems to be pushing the limits of most hard disks.
    However, the output card only has 12-bit resolution. Is there a way - using LabView or some other software - to store the data on the disk using only 12-bit numbers? This would drastically decrease the transfer rate required.
    Thanks for your help.

    You could use 8 or 16 bit integers in LabVIEW rather than using 32-bit single precision numbers. I'm sure integers don't have the precision you're wanting though. That is the only way to reduce the size of the numbers you are writing. I am fairly positive there is no way in LabVIEW to do what you are wanting.
    Regards,
    Todd D.

  • How do I get live data from a subvi while it is running ?

    Hi.
    I'm finishing up my little application, and one of the things I cant figure out to get to work is getting live data from a subvi and displaying it on my main vi's front panel.
    In my subvi I am sending about 10 commands to the serial port, each time updating a local variable that writes value to a progress indicator. I would like to get that indicator displayed on my main vi so I can see the progress of my subvi.
    Currently I have just linked the progress indicator on the sub to a terminal, and connected that to my main vi, but, that only updates when the sub finishes its mission. Is there a way to update the main while the sub is active ?
    Any ideas appreciated !
    /Brian

    In your VI Prg_all_sub, you are actually only writing out the progress bar once to the contol reference.  Once the code to the top has executed, it will never execute again although you continue to write values to the local variable PP throughout the program.
    The quickest fix would be to put that code at the top in a loop with a small time delay function.  That way it continues to execute every time a new value gets written to the local variable.  You would have to use a local variable stop button to stop hat loop wonce your string of VISA reads and writes executes.  Also make sure to reset that stop boolean to false once the loop ends so that the loop will execute properly the next time this sub VI is called.
    Other recommendations for cleaning up the programming is to use arrays or bundle values into clusters that you pass into and out of subVI's.  Prg_all_sub and MPS setup loader have numerous wires going into and out of the sub-VI's.  Bundling these together would simplify the wiring quite a bit.
    Note also that in a lot of places you send in a wire to an indicator and branch it off to a local variable of the same indicator.  That is redundant.  Sending the wire to the local variable does the same thing as sending the wire to the indicator.  Try to use wires instead of local variables as much as possible.  For instance, near the top you send the output of the VISA resource name control back into a local variable of itself, (not necessary) then use a local variable numerous times in the case structure below.  Just wire the name into the case structure border, and maintain the value through all of the loops using a shift register.  This will eliminate dozens of copies of the VISA resource name variable.
    In several places you concatenate a carriage return character to a string constant.  Just put a "\r" at the end of the string constant when it is shown in \ display.  Then you can eliminate the concatenation.
    I hope this helps you get your progress bar working and help simplify the code for you.
    Message Edited by Ravens Fan on 08-13-2007 09:34 AM

  • How do I get values into a vi from a subvi while the subvi is still running within the vi?

    Hello
    This is my problem. I have a subvi that runs an experiment. At different point in the experiment different instruments are on or off and I have a boolean array display this info. It is updated at various points of the experiment via a local variable. That works fine. Here is the problem though. I run that subvi from a main vi program (that runs it several times for several experiment cycles). I would like to pass the status of that array onto the mainvi to display there too. The problem is that the array in the main vi is not updated until the subvi is done running and thus displays only the array status at end of experiment (instead of changing
    as the status changes within the subvi). I tried using a global variable to write to it in the subvi every time there is an update, and read from it in the mainvi, but that doesn't work, it still displays just the status at the end of the subvi execution. Does anyone know how to make this work, or if there is a workaround this? Thanks.

    If you have LabVIEW 6i, you can update indicators of a calling VI from
    a SubVI, while the subVI is running.
    In your case you need
    1) an indicator on the main VI panel to display the boolean array
    2) to pass a reference to that indicator to the subvi when you call it
    3) to use this reference in the subVI, connect a property node to it and
    write the values to be displayed to the 'value' property of this node
    If you don't have version 6, you can write the values to be displayed to
    a global and display this global in the main VI from within a while loop
    which must run in the main VI in parallel to the running subVI.
    It's more complicated, since you need a mechanism to gracefully shut
    down the while loop after subVI finishes. You could do this with
    another global control boolean which is not displayed but just connected
    to the repeat terminal of the while loop. Don't forget to put a 'Wait' of,
    say, 50...100 msec in that while loop.
    -Franz
    zkajan schrieb:
    > Hello
    > This is my problem. I have a subvi that runs an experiment. At
    > different point in the experiment different instruments are on or off
    > and I have a boolean array display this info. It is updated at
    > various points of the experiment via a local variable. That works
    > fine. Here is the problem though. I run that subvi from a main vi
    > program (that runs it several times for several experiment cycles). I
    > would like to pass the status of that array onto the mainvi to display
    > there too. The problem is that the array in the main vi is not
    > updated until the subvi is done running and thus displays only the
    > array status at end of experiment (instead of changing as the status
    > changes within the subvi). I tried using a global variable to write
    > to it in the subvi every time there is an update, and read from it in
    > the mainvi, but that doesn't work, it still displays just the status
    > at the end of the subvi execution. Does anyone know how to make this
    > work, or if there is a workaround this? Thanks.
    Franz Josef Ahlers
    Section Semiconductor Devices
    Physikalisch-Technische Bundesanstalt
    Bundesallee 100
    D-38116 Braunschweig
    phone: (+49) 531 592 2410
    fax: (+49) 531 592 2405

  • Data from different databases in the same report.

    Hi Everyone,
    I am trying to build a reconciliation report in which I need to show the data from the source and target, side by side.
    Source and target are both different databases, although being oracle only
    Whenever a new data model is created, it gets attached to a data source and in the report we need to choose a specific data model.
    Can we have data from different databases in the same report ?

    Yes, it is possible.
    One way Is to use dataTemplates. There you can make queries from any number of different databases (The max I have done is 5).
    It looks something like that:
    <dataTemplate name="NameOfTemplate">
    <dataQuery>
         <sqlStatement name="Q1" dataSourceRef="Connection1">
              <![CDATA[     select * from table1]]>
         </sqlStatement>
         <sqlStatement name="Q2" dataSourceRef="Connection2">
              <![CDATA[     select * from table2]]>
         </sqlStatement>
      </dataQuery>
      <dataStructure>
         <group name="RESULT1" source="Q1">
              <element name="P_FIRST_NAME" value="P_FIRST_NAME"/>
         </group>
         <group name="RESULT2" source="Q2">
              <element name="P_DATE" value="P_DATE"/>     
         </group>
      </dataStructure>
    </dataTemplate>dataStructure is very important when you get data from different places, if you don't define those elements, then only the result from Q1 is shown.
    The second possible way is to make as two different data models, each containing their own query and then set Main Data Set as concatenated SQL Data Source.
    Best of luck,
    Evelyn

  • How to stream data from TDS3000?

    Hi there,
    I would like to stream data from my scope into Labview for further analysis.
    Hardware: Tektronix TDS3014C
    Software: Labview SignalExpress 2.5.1 + Tektronix Extensions
    I don't exactly know when the interesting transient signal appears, therefore I would like to save ~5-10 s of streamed data.
    Right now I'm getting just fractions of 2 us and the scope switches into waiting for trigger.
    Is there a way to deactivate trigger, or a keyword I could search for?
    Thanks for your help,
    nook
    Solved!
    Go to Solution.

    muks,
    I think you got this post confused with another.
    nook,
    You can rarely continuously stream data from a GPIB scope. You can check the manual but often the scope cannot transmit at the same time it is acquiring so you have a sequential operation of wait, trigger, acquire, transfer, repeat.
    Can't you set the trigger for the transient?

  • I would like to create a pop-up window appear from Labview Interface. In this window, I will have a slide control and an image taken from a camera. The main VI have to run while pop-up window is open. How can I do ?

    When I pushed a button, this pop-up window has to appear. There will be a slide control and a picture from a camera in this window. Is it possible to make appear this windows while main VI Interface continue to run ? How can I do this ? Thank you for your answers.
    Cyril.

    Here you go. This is simple example. Maybe not the best way, I am just
    beginner in LV and still not comfortable with data flow that much. I prefer
    events, so I would change this to use Event Structures.
    When you click on OK button on SliderMain, it opens Slider.vi. Now both
    windows are open and you can interact with both. Now if you click on OK
    again with Slider.vi open, you run into problems. Only thing I did was
    change VI properties of slider.vi, mainly window appearance.
    vishi
    "Cy" wrote in message
    news:[email protected]..
    > I would like to create a pop-up window appear from Labview Interface.
    > In this window, I will have a slide control and an image taken from a
    > camera. The main VI hav
    e to run while pop-up window is open. How can I
    > do ?
    >
    > When I pushed a button, this pop-up window has to appear. There will
    > be a slide control and a picture from a camera in this window. Is it
    > possible to make appear this windows while main VI Interface continue
    > to run ? How can I do this ? Thank you for your answers.
    > Cyril.
    [Attachment SliderMain.vi, see below]
    [Attachment Slider.vi, see below]
    Attachments:
    SliderMain.vi ‏16 KB
    Slider.vi ‏11 KB

  • Streaming data from cRIO

    Hi everybody,
    This is quite a general question and I am looking for some pointers\opinions\suggestions.
    I want to stream data from several channels at diffferent rates from my cRIO to the host PC. As far as I can see there are three options:
    1)  Use a network shared variable (NSV) for each channel and read them in a loop on the host PC.
    2)  Use one NSV which uses a cluster of an enum and variant. In this case the enum specifies which channel (and therefore data type) the packet contains and the variant contains the data.
    3)  Use STM to stream the data over the network using TCP/IP
    These are my questions/thoughts:
    1)  not very scaleable as each NSV has to be read individually also just seems messy!
    2)  Seems nice and clean and scaleable, multiplexes the data into one channel. I am aware NSVs are not quite as efficient as directly using STM TCP/IP  BUT... is there an additional (significant) overhead converting all the data to variant?
    3) According to the documentation on NSVs using TCP/IP is the fastest way to stream the data. This method seems to offer the same avantages as (2) - clean, multiplexes the data. BUT it does add complexity in developing the cod. Also the data is still flattened to string, is this much different than converting to a variant?
    THE QUESTION: is method (2) a reasonable compromise if the absolute highest data rates are not required?
    Many thanks,
    Steve.

    Hi Steve,
    I have been looking into this problem for you. It seems that each of the three options you highlighted could be used to achieve your goal though since you want to stream multiple channels method 1 would be highly inefficient and therefore should not be considered for this application. I would suggest that method 3 which uses TCP/IP to stream the data over the network is the optimal solution in this case though as you have alluded to, this does add a level of complexity. If you decide to pursue this option I have found a really useful link provides more details about this methodology and a LabVIEW example which should help you get started with the coding. I have also found this link to a forum which may be of interest to you (especially the final post by Kurt).
    I would also like to add that I completely agree with Brian K, in that I believe method 2 is a very acceptable compromise, especially if high data rates are not necessary. 
    I hope this helps.
    Best Regards,
    Christian Hartshorne
    Applications Engineering
    National Instruments

  • How to pass events from subpanel(s) to the main VI ?

    hi all,
    I found a lot of solutions to pass the events from the main VI to the subpanel(s) but none about passing the events from subpanel(s) to the main VI. In the attached VIs, I just want to generate an event in the main_VI.vi when I click on the button positionned in the subPanel1.vi. How can I do that ?
    thanks.
    Cedric
    Attachments:
    main_VI.vi ‏13 KB
    subPanel1.vi ‏6 KB

    Cedric,
    You could use a queue to transfer the button data to your main vi.
    See the attached files:
    subPanel1mod - Detects a button change and Enqueues the state.
    main_VI mod - uses the Timeout event to poll for data in the queue.
    main_VI mod1 - gets the queue data without having to poll.
    Like your orginals, these files are in LV2010.
    steve
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.
    Attachments:
    subPanel1mod.vi ‏10 KB
    main_VI mod.vi ‏16 KB
    main_VI mod1.vi ‏15 KB

Maybe you are looking for