08-04-2005 09:19 AM
08-04-2005 09:21 AM
08-04-2005 09:34 AM
Hi,
You can use a while loop instead. This while loop must be stopped whenever the number of executions exceed a user defined limit or a boolean switch, that you've talked about, has been pressed.
08-04-2005 09:47 AM
Hi,
Thanks for you response, i guess i should have figured that out. I was just curious to know if you could simulate a break or continue nevertheless problem solved. I have one more question regarding my VI, if you see the attached file in my innermost sequence structure which is labeled as Forward Direction or Reverse direction. I read an array from a Sub-VI and then take the average of the array.
How can i store the read value consecutively in an array ? So for example when i get the first value i want it to be stored in A[0], second value in A[1],.......A[267]. I tried using intilize array and all sorts of combinations but the value gets overwirtten in index 0 of the array.
Please free to make modifications to my code and send it back with suggestions
Thanks
GM
08-04-2005 12:33 PM
I am not intending to insult you but your code is poorly written. You repeat a lot of code in each sequence structure. Actually, sequence structures are not very good for programming. A lot of code is hidden, and a lot of code is duplicated. Also, it is hard to read and understand. You should revise your code and use loops to repeat the code that is executed in all of your sequence structures. As an example, I have attached a for loop vi that duplicates every frame in your sequence that writes to the serial port. Instead of having all those frames, I have one loop. Study the attached vi, modify your vi to look similar, then post any more questions you might have. Try to get rid of all sequence structures, you don't need them for this program. Event the Forward, Reverse code can be done in a loop. If you don't know what loops are, you should study any examples tha come with Labview.
Also, your boolean array has only one dimension. It contains an array of bits. To show each byte, you need a two dimensional array. My example shows how each byte is stored in the 2D array. The first value (4 bit array) is in row 0, the second in row 1, etc.
08-04-2005 12:50 PM
Hi,
I'm agreed with bob, but if I want to focus on the problem you issued, I suggest using the History property of your waveform chart. (I'm not sure if your questions is related to what I'm saying!)
right click the chart in block diagram and create a property node. then select History. you'll have your array.
08-04-2005 12:52 PM
08-04-2005 12:53 PM
08-04-2005 12:56 PM
08-04-2005 01:00 PM