From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-14-2014 11:57 AM
I have a sub VI thats continuously reads data from a PCIe-6363. In the main vi i have successfully displayed the data in a waveform graph that is continuously updated with a control reference and property node. however I need to access the data being displayed in the graph, do some analysis and manipulation then display the data in a second graph. Everything I have tried to get the data that the main graph is being fed results in the new data display (graph) not updating until exection is stopped. then as soon as execution is restarted the new graph shows the last data graph and does nothing until main is stoped an started again.
what am i doing wrong?
04-14-2014 12:00 PM
could you post your vi? to understand the problem better?
04-14-2014 12:53 PM
example code:
04-14-2014 01:01 PM - edited 04-14-2014 01:07 PM
In your main VI, the time signal local variable is being read, manipulated, and put into the intensity graph only once as soon as your VI runs. You don't have any while loop around that code so that it can do any more work with the TimeSignal Data as the Time Signal data is updated in your subVI.
Why do you have the second While Loop in your subVI? It only runs once because you have a False wired to the Continue terminal.
04-14-2014 01:16 PM
yes, that is my question. how do i get a continuously updated local variable of the data in the subvi instead of just the continuously updated graph data?
the second look does not need to be there. it works as intended... so far... that is not in question; unless it is causing the problem mentioned above. are you saying that is the problem? I tried deleting the second loop but nothing changes.
04-14-2014 01:55 PM
Put a while loop around that part in your main VI.
I really don't understand what you are trying to do here. You could send an reference for the intensity graph to the subVI and do the calculations for that there as well.
04-14-2014 03:58 PM
what i intended to do was create a subroutine that will continuously and as fast as possible acquare data from DAQ input. this data is to be samples and depending on some parameters and analoge output control, tasks will be performed on the input data.
but i can not do any of this because i can not manipulate data locally in the main vi. i can control the input, i can display the input data aquired, but i can not do anything with the data.
04-14-2014 05:43 PM - edited 04-14-2014 05:45 PM
Creating a subVI is fine, as long as it is helping your solve your problem rather than adding to it.
Since you are trying to run something as fast as possible, the subVI isn't necessarily helping you. What you need to do is start with the proper architecture such as Producer/Consumer. The producer is the loop that acquires the data. It passes it to the consumer processing loop by way of a queue. The consumer loop processes the data at its own rate and won't intefere with the acquistion of the data in the producer loop. Of course you want the consumer loop to run at a similar rate as the producer, otherwise if it can't keep up, it will eventually fill up the queue.
You can put the the two loops in different subVI's if you want, but you don't have to. If you do, you pass the queue reference into the subVI(s) so that you have direct access to the queue.
04-16-2014 02:12 PM
interesting. i understand what you mean by producer/consumer. well, I am learning labview in the process. i thought that for efficiency and asthetics i suppose, things would be divided subvi's for tasks that would be performed continuously or separatly in numerous instances. hence i first made a vi that performs a continuous data aquisition. also for output, and functions like filtering, etc. then all of these task would be brought together in a main vi. the challenge I am having is getting data from one vi into main then feeding it into the next task(vi).
but I suppose this producer/consumer architecture is exactly what i am trying to do. I have a subvi that produces data by reading from an input, then i want to perform some function on this data (consume), and produce some ouput. I dont know anything about queueing, is that not what reading data from a buffer is doing?
04-16-2014 02:17 PM
@papacode wrote:
I dont know anything about queueing, is that not what reading data from a buffer is doing?
Queuing is nothing more than adding items to the queue (FIFO), in your case in the producer loop. You then dequeue the element in the consumer loop.