ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build an waveform using predefined listbox elements

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

0 Kudos
Message 1 of 3
(2,607 Views)

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..."

0 Kudos
Message 2 of 3
(2,605 Views)

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/

Best regards
JM, LabVIEW CLA
Message 3 of 3
(2,583 Views)