01-25-2016 02:44 PM
Hi All,
I have a X series card that is acquiring digital signals. The data arrives serially, 24b long. The data is semi-constant (the data arrives at 100KHz, but in 24b pulses that trigger at 1000Hz).
Ideally, I would be able to pull the data in a 2D array 24bits wide, but I can't seem to do that- I get a single continuous stream. I need to break that up and convert the 24bits to a scalar value.
Anyone know the best way to do this?
01-25-2016 03:35 PM
Can you share some of your code, or at least give us a VI that has the datatype as a constant? It's easier for us to visualize what you're trying to do any easier for us to communicate back to you what you should try.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
01-25-2016 04:29 PM
01-26-2016 11:10 AM
NOTE: This is an example of what I want to do. At the speeds I need to sample (100KHz data clock rate, 1KHz word rate), I eat up about 5-6% of my processor.
Does anyone know of a more efficient way to handle this?
01-26-2016 11:14 AM
Oh. Slow down your loop rate and let the instrument do the high sampling. You're looping as fast as possible and pulling all available samples. Let the samples build up a bit in the buffer before you read them. You can also set you For loop to perform iteration parallelism. Right click to configure this.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
01-26-2016 11:20 AM
Shouldn't your DAQmx Read use the 2D Boolean Array output instead of the U32? That would elimate the >0 function.
The other change I would do is to just read 24 bits at a time from the DAQmx Read instead of multiples of 24. Then you just do the Boolean Array To Number inside of the FOR loop to convert each channel. You can then use a queue or User Event to send that data somewhere else for processing and then perform the read again (assuming there is data there in the first place).
01-26-2016 11:47 AM - edited 01-26-2016 11:51 AM
@crossrulz wrote:
Shouldn't your DAQmx Read use the 2D Boolean Array output instead of the U32? That would elimate the >0 function.
The other change I would do is to just read 24 bits at a time from the DAQmx Read instead of multiples of 24. Then you just do the Boolean Array To Number inside of the FOR loop to convert each channel. You can then use a queue or User Event to send that data somewhere else for processing and then perform the read again (assuming there is data there in the first place).
You can't read multiple samples in as boolean.
Why do you suggest only reading 24 samples at a time? Wouldn't reading a larger chunk of data and then processing it in a parallelized For loop be faster?
This is what I'm proposing:
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
01-26-2016 11:54 AM
@James.M wrote:
Oh. Slow down your loop rate and let the instrument do the high sampling. You're looping as fast as possible and pulling all available samples. Let the samples build up a bit in the buffer before you read them. You can also set you For loop to perform iteration parallelism. Right click to configure this.
Ah, yes. This was just to show what kind of processing I need to do. I have an idle state built in, I will adjust that to make it optimal (probably pull data at 10-20Hz). And I have the two channels split among separate processors; doesn't seem to save much though.
01-26-2016 12:04 PM
To clarify... I really would like to know if there is a better algorithm for converting the Nx24 element [U32] to N U32s. Possibly a matrix operation?
01-26-2016 12:15 PM
As far as I know, the actual conversion nodes you're using are the nodes you'll have to go through to do the conversion. It's how you use them that's the difference.
Why do you have a Not operator on your boolean array? That's curious.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'