LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ACQUISITION _ usb6341 analog and digital.

Hello

I use an acquisition board USB6341 series X and labview 8.5, I would like to acquire a 16Bit binary word (ie 65,536 words (0 1 2 3 4 5 6 ....65535)) and each binary word come to acquire a value of an analog ramp.

The problem is that I can not learn all the words.

Attached is my VI

Can you help me please

 

cordially

 

manu

Download All
0 Kudos
Message 1 of 21
(3,102 Views)

I'm not clear what you mean. What is the code not doing that you want it to do?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 21
(3,101 Views)

Are you trying to read 16 DIO in a single read?  Unfortunately, it looks like that board will only do 8-bit ports.  But what you can do is read the two 8-bit ports and use Join Number (in the Numeric->Data Manipulation palette) to create a 16-bit word.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 21
(3,098 Views)

Hello,

thank you for your answers.
I can read a word of 16 bits, but the problem is that I can not record the measurements quickly. In fact I have a parallel output absolute encoder (16 bit) and I measure a ramp signal (1 nanalog measurement for 1 position encoder).

How can I do to quickly save all the positions?

thank you

0 Kudos
Message 4 of 21
(3,083 Views)

One basic problem is that you are doing file IO in the same loop as the acquisition. In addition, you are doing two different forms of acquisition also in the same loop. The slowest of these three processes will define how fast the loop runs.

 

To correct this, I would spend some time learning about the producer/consumer design pattern. With it you would have one loop acquiring the data and inserting the results into a queue, while a second loop writes the data to the TDMS file. Also, why are you writing the three values in three separate interactions. Use one call to write all three channels.

 

You are also repeatedly regenerating an array of values in a loop. The only time this array actually needs to be recalculated is when the numeric input "nombre bit à controler" changes. This constant recalculation should be removed.

 

You have a two frame flat sequence structure that is doing nothing but cluttering your code. Sequence structures should never be used. They are unnecessary and very bad form. Also bad form and an open invitation to a race condition is the process of reading a local variable, incrementing the value and writing it back to the same variable. The correct way to do this is with a shift register on the loop.

 

What is the wait function with a 0 timeout doing? As counter intuitive as it may seem, this can actually cause the loop to take longer. The issue is that LabVIEW interprets  a timeout of 0 as a special case that tells the runtime engine to immediately release the multitasking timeslot that it is currently executing in and turn over execution to the next process waiting to execute. If there is a lot of parallelism in your program the result is that a delay of 0 can actually make the loop run slower than if it had a delay of 1.

 

The final bottle neck is going to be the USB interface. It may be a very fast serial interface but it is still a serial interface...

 

Another thing that might make a slight difference is to change the analog read from Analog Wfm 1Chan 1Samp to Analog DBL 1Chan 1Samp.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 5 of 21
(3,071 Views)

Hello,

thank you for your answer.

I do not know much about the design model producer / consumer but I try to do something by following your advice.

But I see the same problem, I can not save all measurement points.
But we can make measurements and recordings with a time less than 1ms?

Thank you for your help

 

manu

0 Kudos
Message 6 of 21
(3,058 Views)

Hello,

nobody can help me?

 

manu

0 Kudos
Message 7 of 21
(3,037 Views)

Hello Manu,

 

The USB-6341 has 24 DIO channels but only 8 of them are hardware-timed (up to 1MHz / 1µs). If you are trying to use several 16 DIOs at this rate, it won't work, because the others will be Windows-timed (which is not deterministic, and at best, close to 10ms).

 

Why exactly do you have 16 DIOs to measure an encoder, ther are normally only 2 or 4 DIOs signals to measure from an encoder and it is advised to use counters for that. Or am I not understanding correctly what you are trying to do?

 

Have a nice day,

Marc-Junior

0 Kudos
Message 8 of 21
(3,031 Views)

Hello Marc junior,

thank you for your reply.

You understand my problem. I have to use 16 OID encoder to measure because it has an parallel output of 16Bit

cordially
manu

0 Kudos
Message 9 of 21
(3,027 Views)

If you have a solution for me?
Buying a new card (if so, which?) or alternative

cordially

manu

0 Kudos
Message 10 of 21
(3,017 Views)