LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pattern Generation USB 6341

Solved!
Go to solution

Vikrant_dhruva_0-1746014566173.png

Vikrant_dhruva_1-1746014662168.png

 

I am trying to generate an 8-bit pattern using USB 6341, but I am getting this error. Any suggestions to improve or change the VI?

Note: I just converted the binary pattern (10110100 to U8, then to 1D-digital waveform)

0 Kudos
Message 1 of 15
(275 Views)

Did you look up what the Error Message means? 

Error -200294 occurred at an unidentified location

Possible reason(s):

Not enough samples were written to satisfy the initial data transfer request condition.
To successfully start a generation, increase the number of samples initially written to the buffer before starting. Alternatively, decrease the number of samples required to start by changing the data transfer request condition.

Did you look up the Example that ships with LabVIEW called "Digital Finite Output.vi"?

Have you read "Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications"?  [You want to skip the first section which says "Use the DAQ Assistant".  In fact, it should say "Never use the DAQ Assistant".)

 

Bob Schor

0 Kudos
Message 2 of 15
(234 Views)

Thanks Bob, for the response. I looked up the examples DIgital-Finite Output and continous.vi 
I actually want to give an 8-bit pattern from user. So, I just did the following as mentioned in the picture. Still I am getting the same error. I increased the number of samples as well initially.
(I changed the representation of the binary data to U32 as well)

Vikrant_dhruva_0-1746023033116.png

 

0 Kudos
Message 3 of 15
(228 Views)

NO PICTURES, please (unless it is a LabVIEW Snippet).  I cannot "see" (and certainly cannot "execute") a "picture" and certainly cannot "play with it" by moving wires or putting in a Probe or Breakpoint.

 

Where (precisely!) does the Error arise?  Have you tried running one function at a time to see which Function generates the error?  [Do you know how to use the LabVIEW Debugging Tools, such as "Highlight Execution" (the Light Bulb on the Block Diagram page) and the Single Step icons?]

 

Bob Schor

0 Kudos
Message 4 of 15
(221 Views)

Understood Bob, I attached the VI. Basically, I am generating an 8-bit test pattern (user input). It shows the isuue with 'not enough samples' even though I have provided enough of them. 
Here 180 = (10110100)

Vikrant_dhruva_0-1746432272693.png

 


The Error:

Vikrant_dhruva_1-1746430682273.png

 

0 Kudos
Message 5 of 15
(132 Views)

Understood Bob, And I tried the debugging but didn't workout. So my objective is to generate an 8-bit pattern. But I am getting the same error ' not enough number of samples'.
Here 180 = 10110100

Download All
0 Kudos
Message 6 of 15
(170 Views)
Solution
Accepted by topic author Vikrant_dhruva

Hi Vikrant,

 

please downconvert your VI beofre attaching to reach a broader audience.

Most prefer "LV2021 or older", I prefer LV2019.

 

Are you sure you create a pattern of several samples?

When you still use that "180" constant as shown in the first message you create a single sample in that conversion.

 

The DAQmx function tells you there is an error because of "too less samples": do you see any reason why it complains about this error?

 


@Vikrant_dhruva wrote:
So my objective is to generate an 8-bit pattern.
Here 180 = 10110100

Do you want to create a bit pattern of 8 bits/samples for one channel?

Why don't you try to solve this basic software problem before starting to use any DAQmx hardware?

 

Example:

This is basic "array handling" stuff in LabVIEW!

Remember: 1D arrays don't have a direction in LabVIEW, but 2D arrays have. You need to provide your bits/samples in the correct order/direction…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 15
(152 Views)

Hello, Vikrant.

 

     If @GerdW just showed you the Waveform (00101101), 8 binary digits, can you see how to get an 8-bit decimal value out of it?  Quick question -- is the number Even or Odd?  Note that there are two ("binary"?) conventions for displaying binary bits in a number -- you need to know which convention is being employed ...

 

Bob Schor

0 Kudos
Message 8 of 15
(137 Views)

Thank you @GerdW for the explaination. I understood the working principle around this. 

0 Kudos
Message 9 of 15
(118 Views)

Hello Bob,
The number which is being employed is an even number. Nevertheless I understood the working around for my issue. Thank you for helping out.

0 Kudos
Message 10 of 15
(114 Views)