LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enable DAQmx channels in sequance

Hello,

I am working on a program that will run the same test over multiple channels. Sequence that I am looking for is: Enable channel, run test, record data, enable next channel, run test and so on.

 

I am using USB-6343 Multifunction I/O Device to trigger relay channels “Diodes Tested”. I am struggling to get the channels to enable one at a time. I have tried this using shift registers with bullion array but did not work in a sequence.  

 

Any help is greatly appreciated!

Thanks,

Mike

0 Kudos
Message 1 of 11
(2,110 Views)

Hi Dzordan,

 


@Dzordan wrote:

Sequence that I am looking for is: Enable channel, run test, record data, enable next channel, run test and so on.

 

I am using USB-6343 Multifunction I/O Device to trigger relay channels “Diodes Tested”. I am struggling to get the channels to enable one at a time. I have tried this using shift registers with bullion array but did not work in a sequence.  


You should better name it "statemachine" instead of "sequence": you may think about adding more states to implement your required "sequence" of states…

 

What is a "bullion" array? Are you talking about the boolean array labelled "Diodes Tested"?

When you want to enable just one of those two diodes then you should use a boolean array of two elements and set both to FALSE. Then you can set the first or the 2nd element to TRUE as needed. And why do you use a local variable of that array for DAQmxWrite when you should use a shift register instead?

(Right now you increment the integer value in a shift register, but then you convert that value into a boolean array. Why do you expect "only one enabled" boolean this way? Do you know how the conversion from integer value to boolean array actually works?)

 

Btw. you should not use InRangeAndCoerce on a string input: use IR&C on the float value after conversion from string!

Best regards,
GerdW


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

Hi GerdW,

 

Thanks for the reply!

 

The program needs to be able to test 18-25 diodes/channels, I was hoping there is a better way to do this than making a separate case for each.

I used local variable because I did not know how I can use shift register to enable each channel individually. When I convert integer to Boolean array it counts in binary so when converted:

CH “1” would be T,F, CH “2” would be F,T but for channel “3” I am getting T,T,F - which makes sense but not what I need, I get both CH  1 and 2 on…

Any suggestions on how to achieve this?

 

Thanks,

Mike

0 Kudos
Message 3 of 11
(2,065 Views)

So, you're controlling relays using DAQ DO to switch each diode to connect with SMU.

 

santo_13_0-1641508192855.png

santo_13_1-1641508205840.png

 

All you need is a simple bitwise operation or logical shift to set only the appropriate channel and reset all others.

santo_13_2-1641508267401.png

 

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution
0 Kudos
Message 4 of 11
(2,061 Views)

Santhosh, I implemented your idea using a local variable, I can see the bit shift is working correctly but the channels still do not trigger. Also, I am now seeing an error -200524: Number of Channels in Task </B>2, Number of Channels in Data </B>32. It’s not liking that there is a mismatch in channel number.

Any thoughts? - Thanks

0 Kudos
Message 5 of 11
(2,033 Views)

Hi Dzordan,

 


@Dzordan wrote:

Santhosh, I implemented your idea using a local variable, I can see the bit shift is working correctly but the channels still do not trigger. Also, I am now seeing an error -200524: Number of Channels in Task </B>2, Number of Channels in Data </B>32. It’s not liking that there is a mismatch in channel number.

Any thoughts?


Thoughts:

  • Why do you need a local variable to implement the code?
  • When DAQmx reports that error than you did something wrong. As you didn't attach any code you need to debug your code on your own!
Best regards,
GerdW


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

I do not know how to use shift registers to make this work correctly, therefore I tried using local variable.

 

Code Attached:

Thanks,

0 Kudos
Message 7 of 11
(2,019 Views)

Hi Dzordan,

 


@Dzordan wrote:

I do not know how to use shift registers to make this work correctly, therefore I tried using local variable.


Then you (REALLY) should step back and return to those "Training resources" offered at the top of the LabVIEW board!

Using shift registers is very basic LabVIEW stuff!

 


@Dzordan wrote:

Code Attached:


You define your DAQmx task to contain two DO lines, but you create an array of 32 elements with the NumToBoolArray function. The same can be seen in the images provided by Santosh!

I recommend to limit that array to just two elements: learn to use LabVIEW array functions and that task is solved within seconds…

Best regards,
GerdW


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

You need to subset the boolean array based on the number of channels in your task.

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution
0 Kudos
Message 9 of 11
(2,001 Views)

I can not get this to work properly. I am having issues inserting/replacing the array using the logical shift so channels enable/disable in a sequence. Possibly my approach is totally wrong...

Any examples or hints would be helpful.

 

Thanks,

0 Kudos
Message 10 of 11
(1,961 Views)