Hello PlasmaGuy.
Thank you for contacting National Instruments.
I have a few recommendations on how to improve your code in order to make it more reliable and predictable. First, the reason that you are seeing one of the write tasks work while the others do not work is because there is a race condition determining which DAQmx write VI executes first. This is because there is no dataflow specified from one case statement to the next. Thus, depending on which case statement is executed first (which is not determinant), a different case will execute and thus a different DAQmx write will execute. This, coupled with the fact that only one DAQmx write task can be running at the same time on the same board, is what is causing either your preflow or cutflow to work while the other one doesn't. So, before you execute a second DAQmx write task, you must first stop the preceding DAQmx write task.
Secondly, I would recommend only using the DAQ Assistant Express VI or only using the lower level DAQmx VI's. For this application, I would recommend using the lower level DAQmx VI's since they give you a lot more control over what happens in your application. When you use DAQmx low level VI's and the DAQ Assistant Expres VI, there can be complications related to this differing level of control that you have over the VI's.
Third, I would recommend looking at a few resources that will get you more familiar with DAQmx and the functionality that it offers. The common series of events that should take place for a successful DAQmx task is 'DAQmx Create Virtual Channel', 'DAQmx Timing', 'DAQmx Start Task', 'DAQmx Write/Read', 'DAQmx Stop Task', 'DAQmx Clear Task'. Following this order will help with proper dataflow, execution, and correct termination of the task. More information on each of these VI's can be found at:
Learn 10 Functions in NI-DAQ and Handle 80 Percent of Your Data Acquisition Applications
Two helpful links that will help you in your transition from Traditional DAQ to DAQmx are:
Answers to Frequently Asked Questions about NI-DAQmx and Traditional NI-DAQ
Transition from Traditional NI-DAQ to NI-DAQmx
Also, there are numerous shipping examples that come with your version of LabVIEW. These can be accessed by selecting 'Find Examples' on the LabVIEW splash screen that launches at startup. Then, please choose to Browse according to 'Directory Structure' instead of the default 'Task' selection. Then, a folder named 'DAQmx' will be viewable on the main Example FInder window. Inside of this structure is a large number of example programs that will help you more familiar with DAQmx and the structure it follows.
I hope this helps you with your application. Let me know if you have any additional questions or if any of my statements require further clarification. Good luck with your application and have a great day!
Brian F
Applications Engineer
National Instruments