LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data munber error

Hello,

I have done one program and when I try to run the program I see one error that says that I am putting one number data of 18 in one line that only have 8 numbers. Could you help me please to solve this problem? In the last case of the case structure I have one array of 18 and I divide the array in three different parts not to have one array of 18.

I attach the program here.

This is the message of the error.

"

If you are using the Digital Waveform datatype, make sure the number of lines in the digital waveform matches the number of lines in the channel. If you are using boolean data, make sure the array dimension for lines in the data matches the number of lines in the channel.

 

Number of Lines in Channel: 8

Number of Lines in Data: 18

 

TaskName: _unnamedTask<29>

"

0 Kudos
Message 1 of 7
(1,653 Views)

Since you seem to be starting to learn LabVIEW, I would recommend that you "start small".  Instead of taking a complex Example and making it more complex, try to make it as simple as possible.

 

You seem to be wanting to do Digital I/O, using 18 lines (which you are splitting among three Digital I/O Channels).  Why don't you write a very simple routine that puts out a square wave (alternating Boolean True and False) on 1 line of Channel 0, and see that it works, and then 8 lines of Channel 0.  It is not clear to me if you want to do this one point at a time, or using the timing ability of your DAQ device to output a digital Waveform (which has, say, 1000 sample points designed to be output at a specified frequency, say 1 kHz) -- you should make your sample program do this if that is what you ultimately want.

 

Once you have this very simple routine working, you can look at the more complex code you attached (thank you for doing that!) and fix your errors yourself.

 

Bob Schor

 

P.S. -- the term "lines" has many meanings.  Be sure you understand the meaning(s) with respect to this DAQ device and your program.

0 Kudos
Message 2 of 7
(1,604 Views)

Sorry, I don't have drivers installed, so I cannot look at your code in detail. Can you at least tell us where the problem function that generates the error is located?

 

Nobody here has the time to go through a gigantic diagram full of race conditions. Who wrote this code?

 

Some glaring issues:

:

Most likely the control values for output 1 & 2 will get read at (A) before their value property is written (B), meaning that most code in the first sequence frame is moot.

 

altenbach_0-1577989646477.png

 

 

Simplify! You can wire a numeric to case structures:

 

altenbach_2-1577989851264.png 

altenbach_3-1577989914398.png

None of your value property nodes are needed. 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 3 of 7
(1,523 Views)

The error is located in the red and blue circles you have done.

Thank you for your time to respond my question!

0 Kudos
Message 4 of 7
(1,444 Views)

I should put it like this?

Captura.PNG

0 Kudos
Message 5 of 7
(1,389 Views)

Hi 99,

 

getting better.

 

Now get rid of those InsertIntoArray functions. When you want to make sure you always get an array of 8 elements you should use BuildArray and append an array of 8×FALSE, followed by ArraySubset to keep the length at 8 elements…

 

No need to initialize an array of 8×FALSE 3 times.

The loop above "VirtualBench Device" is wrong (not shown in the last image). Completely wrong…

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 6 of 7
(1,338 Views)

So, I have to create one array constant of 8 elements and connect this array to the function BuildArray?

Thank you for your help!

0 Kudos
Message 7 of 7
(1,321 Views)