LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple I/O Actions Labview DAQmx

Hi everyone,

 

I was tasked to modify the attached program for working simultaneously with 2 additional channels. The original has one output channel for excitation and one for measurement, which is later filtered and saved.

 

I have duplicated the design and made arrays of channels to modify the create task vi's to use 2 inputs and 2 outputs. Measurements should always be synchronized and output excitation has to be different for both channels (so I cannot use a single excitation loop for 2 channels, I believe). Please let me know if I am on the right track. I keep getting the error of reserved resource on the start task.vi for some reason, even though I am not duplicating those.

 

I think my efforts have been somehow brute force, since there is probably a way to simplify all of these, but I am in a time constraint so I needed to get something functional before focusing on improving the overall design.

 

The original program is DNA Detector v14.3, while the new one is DNA Detector Experimenting. Another dependent vi is also attached.

 

Thank you very much for your help!

 

Regards,

 

Pedro Ch.

0 Kudos
Message 1 of 6
(2,906 Views)

Hi taxo,

 

it's a bad idea to create a task containing two channels and then to split the channels into two separate tasks when trying to output data. Really bad…

 

Do you know how to specify two channels with just one channel reference? The LabVIEW help explains this…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,887 Views)

Thanks for the quick reply!

 

Yeah i had a feeling that it was a bad idea, do you have any suggestions on how I can proceed? I want to be able to scan and choose the channels evey time I run the program, so the link you provide it seems to only indicate how to reference them if they were always the same.

 

I really appreciate your help, and I hope I have described my issue well. 

 

Taxo

0 Kudos
Message 3 of 6
(2,880 Views)

Hi Taxo,

 

I want to be able to scan and choose the channels evey time I run the program, so the link you provide it seems to only indicate how to reference them if they were always the same.

Why do you think so? The link tells you how to put multiple channels into one channel reference control!

 

When your VI is in run mode: click the array of the channel reference. A menu opens: select "Search…". Now you get a listbox with all available channels: simply select all channels you like using shift/control keys and mouse-click…

 

When your task contains two channels then your DAQmxWrite operation expects an array of 2 elements (for "N channel 1 sample" mode)!

 

Btw.: did you examine the example VIs coming with LabVIEW? There are probably also examples of how to read or write multiple channels in a task…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(2,873 Views)

Oh ok I understand. I actually did a version of that earlier. However, if i picked 2 channels using shift then the write function would write the same thing to both channels. Is there a way to treat them independently ? 

0 Kudos
Message 5 of 6
(2,864 Views)

Hi taxo,

 

Is there a way to treat them independently ?

Provide two values (aka elements) in an array to set the output value of two AO channels…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(2,821 Views)