Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with read value from analog input module on CompactRIO

Solved!
Go to solution

Hi,

I have problem with read value from analog input module on compactRIO. I create simple vi on FPGA. My code get value from AI1 and transfer this data via DMA channel to Host. AI1 is also write to analog output. I connect to AI1 signal from generator, this signal is sine 10Hz. But in chart on Host is very strange. I attach print screen from this chart. Could you help me with this problem? I don't know why output from analog input on compact trio is wrong.

0 Kudos
Message 1 of 12
(4,010 Views)

What module are you using to read the signal?  What sample rate are you using?  Sharing code would help us a lot to help you.


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
0 Kudos
Message 2 of 12
(4,001 Views)

HI, this modul is NI9215 to read the signal, but i don;t know how i can set sample rate in this module, could you tell me how i can set it?

0 Kudos
Message 3 of 12
(3,960 Views)

@kawa1500 wrote:

but i don;t know how i can set sample rate in this module, could you tell me how i can set it?


The sample rate is being dictated by that wait in your loop.


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
0 Kudos
Message 4 of 12
(3,956 Views)

Ok,

I set sample rate on 100us

0 Kudos
Message 5 of 12
(3,948 Views)

Slightly off-topic: Use the loop-timer express VI, not the wait VI for a correct and stable loop-rate. In your current code the loop rate is not 100 µs, as the code after the wait-vi also needs some time to execute.

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 6 of 12
(3,943 Views)

Everything looks pretty normal so far except as mentioned having a wait instead of a timer. Have you tried an oscilloscope? I'm guessing it looks a little cleaner there? Can you post your RT code? My next guess is there's a hardware problem. Are you in single ended or differential mode? Try the other? Try another channel?

 

Also, to rule out your code, you might want to try an example like 

C:\Program Files (x86)\National Instruments\LabVIEW 20xx\examples\CompactRIO\Module Specific\NI 9215\NI 9215 Getting Started\

0 Kudos
Message 7 of 12
(3,941 Views)

I changed wait on loop timer but this don't solve the my problem.

0 Kudos
Message 8 of 12
(3,914 Views)

I am using the oscilloscope, i connect to oscilloscope three channel (signal from generator, signal from analog input and signal from analog output). Two last of signal are similar to chart from VI but not similar to first signal from generator. Today i try change channel on compactRIO and change mode connection to module NI9215.

 

In this location don't exist module NI9215 with examples, i don't know why? In this folder:

C:\Program Files (x86)\National Instruments\LabVIEW 2012\examples\CompactRIO\Module Specific\

existing list of module but not existing my module.

0 Kudos
Message 9 of 12
(3,912 Views)

I wrote wrong information in my last reply. On oscilloscope i have connected two signal. First signal comes from generator ( and this signal is the same as input on analog input module) and second signal comes from analog output. Signal from analog output is similar to signal in LabView Chart.

I change channel and this problem still exists. Do you have more suggestion what is wrong in my program?

0 Kudos
Message 10 of 12
(3,903 Views)