Prev: TCP/IP USB camera
Next: help with Sunny Boy inverter
From: 0401061296 on 23 Sep 2007 09:40 Hi guys, I know i can send empty array to history (or vaule in the case of graph) property node to clear graph programmatically. But it seems does not work with my application. I have got a large array of 8 bit binary data coming in from my FTDI FT245 FIFO convertor at quite high rate, i wish to display 102 of them on a graph at a time. So after the first 102 byte data has been displayed on waveform graph, the graph clears itself, then display the next 102 byte data and so on. My attempt is to use a for loop with N = 102 and connect that to waveform graph. I then use case structure to clear my graph once the N = 102. There must be something wrong with my program as what the vi dose is it only display the 1st 102 byte data on the graph, then it just stops. I have attached part of vi file below. For simplicity prupose, i have changed N = 10. Just one more question, is there anything in labview which waits for certain period of time for data coming in (like time out), if no data has come in during that period of time, it display the previous data on graph. I am quite new to LV and your help would be greatly appreciated. Thanks in Advance. Kim ask.vi: http://forums.ni.com/attachments/ni/170/273593/1/ask.vi
From: altenbach on 23 Sep 2007 13:40 0401061296 wrote: Just one more question, is there anything in labview which waits for certain period of time for data coming in (like time out), if no data has come in during that period of time, it display the previous data on graph. A graph retains its data until new data arrives, so there is no need to constantly update with the same old data. You should simply make sure that your loop only spinf if new data is available, there is no good reason to spin a loop if all it does is reprocess the same old data.
From: 0401061296 on 25 Sep 2007 00:10 Thanks for your vi file and it is really helpful. I have noticed that your file only works fine when the size of incoming 1-D array is constant and an even number. However, when the size of incoming array is variable, the remainder from the remainder-quotient function is non-zero therefore there will be some loss of data that is displayed on the graph. For example, when we set the N =95 (the size of array) and 10 elements of the array should be sent to the graph, this will result a remainder of 5 and the waveform graph will only display the first 90 bytes data, and miss out the rest 5 bytes data.. For our application, the size of array changes all the time and new data keeps coming in. If we update the starting index value periodically and dont delete the previous data which has been displayed on the graph, it will eventually overflow the buffer. Is there anything we can do to destroy or remove the part of the array elements which have been displayed on the graph previously, and shift the rest of the array elements down so that the total size of the array will be kept relatively small and does not overflow the buffer? Thanks in Advance. Kim
From: altenbach on 25 Sep 2007 01:10 altenbach wrote:If you want to use a graph instead of a chart, you can keep a buffer in a shift register where you would move data in as desired (using replace array subset) and keep track of the insert point. Initialize a shift register with a fixed size array. Rotate the existing array left by the size of the new data array, then replace the tail with it. Send the result to a graph. And here's an example for that possibility. :) askMOD3.vi: http://forums.ni.com/attachments/ni/170/273911/1/askMOD3.vi
From: 0401061296 on 25 Sep 2007 06:40 Hi altenbach, thanks for your prompt response. All of your sample vi files are very helpful. I have just realized a problem with my application. I need to constantly send 102 bytes data from our sensor to the graph. In order to test out the vi, I have constantly sent 102 bytes of similar data. I expect to get a constant graph but the graph is constantly shifting. We suspect that this is due to handshaking problem or a loss of data during the transmission. Maybe the rate of imcoing data is not synchronized with the rate of while loop iteration. We have spend whole last 2 days to find a solution , and unfortunately, still couldnt figure out how. Any ideas that I could solve this problem? Any suggestions are highly appreciated.
|
Pages: 1 Prev: TCP/IP USB camera Next: help with Sunny Boy inverter |