01-21-2013 12:12 PM
Hi.
I'm new in LabView, and have an idea for creating some some different square pulse waveforms I need. I have an idea of an listbox with all the predefined atoms, such as "Read", "Write", "Delay" etc. which differ in amplitude and pulse length. I want to be able to select an element in the listbox (an atom), and push a button to move it into another "Waveform to be generated"-listbox. There should be a waveform viewer that updates with the current waveform. There should be an easy way to add new atoms, and save/load previously built waveforms.
I'm unsure on how to approach this problem in the easiest way. Can someone give me a push in the right direction?
With best regards,
Niclas
01-21-2013 12:31 PM
I might clarify that listboxes might not be the best solution. Another way could be to just input a string defining the waveform pattern, such as "r r w w d r r..."
01-22-2013 04:35 AM
Hi Nicsjo,
You can probably implement this in many ways, this is one alternative.
You could make a type defined Enum control (Listbox control) that you send to a case structure. Then make the code necessary to create the waveform you want for those specific case. I would also recommend you to use a event structure to not load your processor with to much polling for user event changes.
For modularity you should use a type defined Enum because you then only need to change the control (.ctl file) and then add the corresponding code in the case structure. When you want to add a new waveforms to your program.
So you could start reading on structures and design patterns in LabVIEW. For example Event Structure, Case Structure and a State Machine. Also read up on Enums for the example I briefly explained. In the link below you can find a good starting point. Contact you local office if you want instructor led courses, course material or other information regarding courses.
http://www.ni.com/gettingstarted/labviewbasics/