10-29-2008 10:43 AM
Hi,
With the scopes I'm not too bothered about having the zero crossing of the waveform lined up with the LHS of the scope, but what I would like to see is the waveform period fitting exactly into the X axis, ie. the waveform is 'frozen' on the display.
I can set the sample rate on the UI, and I've got it set to 5.5Khz, in chunks of 1100 samples, so the top loop runs at 0.2s so yes I can probably slow down the bottom loop-- or switch to queues.
My next task, however, is try and implement a UI button which, when pressed, writes the current RMS values, frequency etc. to a single line of an excel spreadsheet, with timestamp.. I'm thinking of using the Event structure to do this. What do you think?
Dave
10-29-2008 11:41 AM
Dave,
Definitely, the event structure is designed for that purpose. I put all controls which require the software to take immediate action into an event structure. I would plan on putting the on off switch, the Tunnel setpoint control, and the Load setpoint control into event cases. Presently you are writing the setpoints to the Analog Output on every iteration of the loop. I think the 60009 retains that last value written, so you only really need to write if a value changes. The event structure makes it much easier to do things like that.
Ah, I think I see why you see some jitter in the displays: Dataflow! It is possible, perhaps likely, that the Xscale.Maximum properties are written after the current data is plotted. Put the Voltage Scope and Current Scope terminals inside a one-frame sequence structure and wire the error out clusters from the Scale property nodes to the border of the sequence structure. This is one of the very few appropriate uses of the sequence structure.
Lynn
10-30-2008 08:13 AM
I'm having a bit of a nightmare getting a write to file on demand working. Can you point me to any decent (ie. spreadsheet or CSV) examples which do this using an event structure in a loop independent to the other loops?
What do I do to get the event while loop to terminate and the other loops to terminate?
Dave
10-30-2008 11:00 AM
I've managed to get something sort of working now so I can write to a file on demand. There are some problems though and I was wondering whether anyone could look at my code...
1) I can't make the event drive while loop stop in sync with the other loops. I'm confused about how to do this. I just want to have a single 'stop' button which causes all loops to end
2) I would like to get a time stamp for each row of data - how do I do that?
Thanks
Dave