LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DaqMX create channel

I have two cDAQ9181 with one 9421 modules inside each. I am developing a data acquisition system using Labview to collect digital data from the aforementioned devices. 

Can I use a single DaqMx create channel (digital input) for both cDAQs?

Currently, if I try to select multiple devices I get an error: "Physical channel range syntax in the input string is invalid because multiple devices were listed in the string".

Thanks for your support.

 

0 Kudos
Message 1 of 22
(3,299 Views)

Hi Davide,

 

as the error message says: you cannot put 2 different chassis into one DAQmx task…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 22
(3,270 Views)

Thanks

So what is the solution? Two DaqMx tasks in parallel? I hope I don’t have to build another vi

 

0 Kudos
Message 3 of 22
(3,257 Views)

Hi Davide,

 


@DavideB wrote:

So what is the solution? Two DaqMx tasks in parallel? I hope I don’t have to build another vi


Yes, two tasks.

No need for another VI: you can handle both tasks in one VI (or even one loop)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 22
(3,255 Views)

I am trying to read from 2 cDaqs. Then I try to concatenate the array and write it to an xls file. But I am missing something as you can see in the attached vi. Let's say I am reading 6 lines (booleans) from cDaq1 and 6 lines from cDaq2:

cDaq1:

000

010

cDaq2:

011

001

I should get something like this

000

010

011

001

and then write it to the xls file, after converting to decimals:

0

2

3

1

The build array object is not correct here, probably. Any suggestion? thanks

0 Kudos
Message 5 of 22
(3,178 Views)

I think I solved it replacing build array with insert into array!

Thanks

0 Kudos
Message 6 of 22
(3,174 Views)

The problem you're having is that your Build Array was not set to "Concatenate Inputs"

Right click on the Build Array and tick that option, and you'll get the output you wanted:

Example_VI.png


GCentral
Message 7 of 22
(3,153 Views)

Thanks cbutcher

but isnt the solution with insert into array correct?

0 Kudos
Message 8 of 22
(3,149 Views)

Insert into Array might work, but it has the wrong "feeling" or intent.

 

Part of writing good code is making clear what you're trying to do, and what you want to do is build a bigger array by concatenating two smaller arrays. Insert into array suggests you're wanting to place stuff in the middle of a larger array.

 

Even though in this case they can be used to do the same thing, they suggest different things.

 

When you can, write code that most naturally describes what you're trying to do.


GCentral
Message 9 of 22
(3,146 Views)

Yes, I agree, thanks.

Now I have the problem to connect the task out and error out pins of two DaqMx read objects. How can I fix that?

0 Kudos
Message 10 of 22
(3,099 Views)