06-17-2007 11:28 PM
06-18-2007 11:28 AM
06-18-2007 11:36 AM
One "weird thing" will be the "Current now" will show the value when this code starts because there is now data flow dictating when that value will be read.
As a general rule, LV will evaluate values that have no data dependacies before anything else.
Simply putting all of the code at the bottom in a seq frame will fix that issue.

Ben
06-18-2007 03:44 PM
I think Kenny is definitely correct. A state machine will really help with the code. However, the specific reason why your data is strange is what Ben hinted at. You are putting a scalar (single value) in for X and an array of scalars in for Y. You should build X as an array like you do with Y. See the attached screenshot for an example of what I am talking about.
Good luck!!
06-18-2007 08:43 PM
06-19-2007 12:58 AM
06-19-2007 03:06 PM
Basically, there are a few options for your code. You could remove the sequence structure and program you application using dataflow alone. This is what mikeporter is suggesting (I believe). You could use error clusters going from VI to VI in the order you want to execute. This will force LabVIEW to execute each VI in the desired order. This is an example of dataflow and it removes the need for a sequence structure. This will be the easiest way to implement your code. If you code could grow and eventually have a lot of different cases that you need to switch (at will) between then a state machine is the way to go. LabVIEW has a template for this and there are many good articles on NI.com that talk more about how to do this. As for the actual logic of what you are doing, it seems fine. Implementing dataflow will just clean up your code and be a better practice. Also, reading the desired number of samples all at once may be a better practice as well, if your Read VDC can do that.
06-19-2007 03:11 PM
06-19-2007 10:23 PM
Hi,
thanks for offering. if i may impose on you; the files are attached. For any other stuff it should be instrument interfaces...
Regards,
06-19-2007 10:35 PM