LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Suggestions on how to structure this DAQ code?

Hello, 

 

I am working on labview and have been poking around at how to do this but am not sure how to approach it. I've looked at while loops, case structures, event structures, subpanels, ect and am hoping one of you, with more labview experience than me, would have the knowledge to suggest what course would be best suited. 

 

I currently have a multi-tab setup (can change). No matter what tab I am on or what I am doing, it needs to be continuously recording/displaying data from a load cell and encoder sensor, doing minor analysis on the signal and displaying the resulting value, and monitoring for errors from the sensor. Depending on which tab is active, I then need to be able to also simultaneously

 

- write the data to a tdm file with custom header fields (values for the fields dynamically entered) (user must be able to start a new file, start/pause/restart recording to file as desired, stop (close) that file, and repeat) 

- load tdm files and graph them

- show instructions (set of tabs within the instruction tab)

- change the default values for the signal analysis (I can stop sensor readings and analysis to do this)

 

Any suggestions on what approach you'd take? 

 

If there is any vital info to know that I missed (or am unaware of) let me know and I'll get back to you quickly. I assumed code is less useful when asking for design approaches rather than to fix a problem but I can get some code if it would help. I'm relatively new to labview but learning quick and typically pretty able to implement the specifics, just unsure about the bigger picture here. 

 

I was able to successfuly set up a flat sequence to do the writing to file stuff with the dynamic custom headers, but had the DAQ express vi in the structure which didn't seem to work so well if I want to collect and display data all the time, and only create and write to a file some of the time. I have a pretty simple string visible True/False system set up to hide/show the approriate instructions based on radio buttons. 

 

Much appreciated!

 

0 Kudos
Message 1 of 2
(2,361 Views)

Hello ARK,

 

Your architecture seems fine. Sometimes there's no better architecture, there's just preferences.

 

One thing that I would recommend though is that you avoid using sequence structures and impose the order of execution using data flow. Error wires are usually the best way to do that.

 

Hope this helps.

Tarek B
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,272 Views)