Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

problem NI PCI 6259 with Simulink

Hello,

 

I use Matlab 2008a with Win Xp.

Maximum sample rate of NI PCI 6259 is 1.25MS/s.

When I set sampling time=200 kHz my program am in simulink (Real Time Windows Target) is ok.

I have 2 problems with higher sampling rate.

 

1- When I set sampling time=500 kHz then build in matlab IS ok but I cannot run my program in simulink and matlab is closed.

2- When I set sampling time=1MHz then build in matlab IS NOT ok and a error could be generated with Real Time Windows Target "Too fast for this hardware"

 

Would you please help me how can I do a high sampling rate with "Real Time Windows Target"?

 

Best regards

 

0 Kudos
Message 1 of 8
(3,049 Views)

Hi,

 

In regards to the hardware, I can help you with setting the appropriate sampling rates for the card.  Yes, the maximum sampling rate for this device is 1.25MS/s for a single channel, and 1MS/s (aggregate) over all channels.  Are you acquiring off multiple channels or just a single channel? At 500kHz and two channels, you will see 1MHz sampling rate aggregate, which is within spec, but 1MHz on more than one channel is not possible.

 

Concerning the environments you are working in, I do not have experience with them, so why you are seeing your program run in one environment but not the other is unknown. 

 

 

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 2 of 8
(3,036 Views)

Thank you for your kind reply.

 

I connect AI0 to AO0 and in Simulink I connect a Sin wave to AO0 and a scope to AI0.

I use only a channel but these errors are caused.

Would you please tell me what can I do?

Also I have another problem,

If I use 3 channels so for any channel I have 1M/3 sample and if I use 4 channels so for any channel I have 1M/4 sample.

Is it right?

 

Best regards

 

0 Kudos
Message 3 of 8
(3,029 Views)

Thank you for your kind reply.

 

I connect AI0 to AO0 and in Simulink I connect a Sin wave to AO0 and a scope to AI0.

I use only a channel but these errors are caused.

Would you please tell me what can I do?

Also I have another problem,

If I use 3 channels so for any channel I have sample rate =1M/3 and if I use 4 channels so for any channel I have sample rate=1M/4 .

Is it right?

 

Best regards

 

0 Kudos
Message 4 of 8
(3,029 Views)

For one channel, you are correct in identifying the sampling rate as 1.25MS/s.  For two channels, your fastest sampling rate per channel will be 1MS aggregate, and since you have one timing engine, the maximum sampling rate over the two channels will be 500kS/s, or 1MS/2.  For three and four channels, they all have to be on one timing engine, so the max sampling rate for the channels will be 1MS/3 and 1MS/4 respectively, so you are correct with your statement there.

 

What I would recommend is start simple, try doing a finite acquisition in your programming environment with a set sampling rate and go from there.  One thing you mention is connecting a Sine Wave to AO and a Scope to AI.  This should be opposite, since AO generates an output (Analog Output) so you will want to read this with a scope, and AI reads an input (Analog Input) so you will probably want to read your sine wave.

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 5 of 8
(3,013 Views)

Would you please describe your sentences “What I would recommend is start simple, try doing a finite acquisition in your programming environment with a set sampling rate and go from there”.

 

I don’t understand your sentence.

 

Best regards

0 Kudos
Message 6 of 8
(3,009 Views)

I cannot see your program that you are writing, so my recommendation was try writing the simplest program possible to see if you can acquire at 500kS/s or 1MS/s on a single AI channel, and see if you still receive the error. 

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 7 of 8
(3,005 Views)

Hello,

 

I send for you my Simulink file.

Errors remained in Simulink.

Would you please help me for high sampling rate.

 

Best regards

Download All
0 Kudos
Message 8 of 8
(2,992 Views)