Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Daq Assistant generated code

I have a task that was created with the DaqAssistant auto generated code (DaqTask1.vb and DaqTask1.User.vb).  I need to be able to stop/start that task with a button click from my Main form.  This is easy enough to do within the DaqTask1.User.vb as I can simply say "Task.Stop(), etc".  But how can I do essentially the same thing from my frmMain.vb?  This seems pretty simple but I'm struggling with it much like this gentleman did, as I'm trying to do the same thing he was - change scaling parameters of the channels in the task from the UI and be able to stop the acquisition, re-adjust the scales from the UI, start the acquisition again, etc. 

 

Currently, I can change the scaling from the UI, since in my program, once the button is clicked, it immediately calls the "DaqTask1Component.StartRead()" method. This then runs through the DaqTask1.vb where the channels are configured.....then to the DaqTask1.User.vb code, where I am setting custom scaling parameters in the "OnTaskCreated" sub.  However, this method is only called once, which is where I am running into my problem.....I think.   

 

Any help is greatly appreciated.

 

DaqTask1.jpg

 

DaqTaskUser.jpg

 

frmMain.jpg

 

Thank you

0 Kudos
Message 1 of 1
(4,001 Views)