04-17-2015 03:53 PM
I am receiving the following Daq error:
For my application, I have a DaqTask (DaqTask1.mxb) along with a DaqComponent. All I am trying to do is change the scaling of my channel from the UI. The channel creation code is of course auto-generated in the DaqTask1.vb:
AIChannels.CreateVoltageChannel("cDAQ9184-1A2B748Mod1/ai0", "Channel 0", AITerminalConfiguration.Differential, -10, 10, _
AIVoltageUnits.FromCustomScale)
I have added the following code to the DaqTask.User.vb in the "OnTaskCreated" sub:
Task.AIChannels("channel 0").CustomScaleName = "ch0Scale"
Task.AIChannels("channel 0").Minimum = frmMain.arrayScaleMin(0).Value
Task.AIChannels("channel 0").Maximum = frmMain.arrayScaleMax(0).Value
Where is my problem in relation to the error that I am getting? Do I need to programmatically create a task in the User.vb section of the code since the error is showing "unnamed task". I know that the code is getting to the "OnTaskCreated" sub since I have tested that so it appears that there is a task even if it is not named (??).
I have created a custom scale (ch0Scale) but I am unsure if the above line of code is actually applying the scale to the channel. That was what I though but am unsure now and wondering if that is where the problem lies. If so, how do I apply the custom scale that I created to the channel? Also, is the channel minimimum and maximum the voltage range of the channel or the scaled range? I'm pretty sure its the maximum and minimum scaled ranges but because of the error I keep getting above, it has me questioning that.
Thank you