06-01-2009 12:37 AM
Hi Ben, sounds like something I'd be interested in too. let me know if you figure this out.
Ben__B
06-02-2009 07:29 PM
Hi Ben,
I see you've discovered the wonders of the LV forums too! I think I know how to do it but have to test it out first (it involves arrays and x-y graphs), hopefully I'll have something to show you by next Tuesday!
Ben
06-08-2009 02:47 AM
Hi Ben,
Here's my first attempt at creating a digital CRO. You were right about For loops not being a good idea so instead, borrowing some work David has done on Arrays as part of his FFT program (which if you havn't see then you definately should), this vi creates a 1xn (where n is the length/multiple/fraction of one scan of trigger) array of zeros which are then replaced by the input channel values (in this case also the trigger) when triggered by an event. The output can then be scaled, offset and also saved to .csv file. I've tried to attach a copy of my test vi for this, I hope that works!
There is still alot that I'd like to improve/test with this vi, namely:
1. I'm not sure how it will work for external triggers into Labview as our trigger is created on the FPGA and then sent both into the RT controller and to our high voltage amp (also, when testing, I noticed that when using local variables to send the trigger values between loops, that the trigger didn't work very well, so I may have to use FIFOs to send the signals from the FPGA to the RT which is not exactly desirable due to a) there being a maximum number of FIFOs that can be used and b) the extra compilation time needd when FIFOs rather than local variables are used).
2. Obviously I'm going to have to increase the number of input channels (probably to 4). This shouldn't be very hard and, again using arrays, you should then be able to choose which 4 of any number of inputs to graph and do so by name which would be handy (and also a trigger select). These could all then be plotted on the same/different graphs depending on your preference.
3. Instead of just using a T/F case structure for different triggering methods I'd like to insert any number to choose from. Those that I have thought of, and can implement easily are: a) Maximum and decreasing, b)Minimum and increasing*, c) a specific value and increasing* and d) specific point and decreasing. Though with a * are implemented in the vi. Are there any other useful ones that you can think of?
4. Saving data it would be great to have an increasing numberical file name system (i.e. first time you hit "Save" it saves 1-(1-4).csv, where the (1-4) indicate the channel being saved - ideally all would be saved at once, as well as the trigger - and then the second time you hit "Save" it saves file 2-(1-4).csv etc.). I know this can be done in Labview but havn't figured out how yet.
5. There is one bug that I can see straight away and that is if you increase the number of points in the scan at the EXACT (havn't managed to do it yet) same time that the trigger becomes true (the trigger resets everytime you change the number of points on the graph), then the output graph will only be as long as the original (i.e. non-increased) number of points. I'm sure there must be other bugs too!
Anyway I'll hopefully be able to improve this and create a proper subVI sometime over the next couple of weeks and will let you know when thats finished, but if you can think of anything that I've missed/other improvements to make please let me know!
Ben