Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Not achieving high scan rates

I've been trying to develop a system to log from a 9219 (2 channels) and a 9201 (4 channels) but I'm hitting some serious blocks.

 

Despite setting the scan engine speed to 1kHz I'm only actually getting approximately 136 samples of the 6 channels every second. I switched to an FPGA version of the same process, with no conversions/maths in the FPGA side of things, just firing it into a FIFO, then dragging it off the fifo and logging it to onboard flash and I can't seem to log very quickly in that either, in fact - approximately the same rate. I'm getting ~1400 samples on each channel after 10 seconds of logging.

 

Any ideas?

0 Kudos
Message 1 of 4
(3,627 Views)

I'm not quite sure what might cause rates that slow, but your post definitely caught my eye because rates like that should NOT be a problem even with scan mode.  I have a generic data logger application built on scan mode, so I reproduced your hardware set up (9219, 9201) and ran my app.  My controller is a 9024, which might be faster than what you have.  I was able to log all channels from those 2 modules to a very primitive CSV format at a 1 msec scan rate.  Take a look at the attached VIs to see how I did it.  Be forewarned that the VIs use the programmatic API to RSI modules and aren't specific to the 9219 and 9201 at all.  If you have any questions about it feel free to post them here.

Ross Houston
Principal Software Engineer
Timing & Sync Software R&D
Download All
0 Kudos
Message 2 of 4
(3,584 Views)

Cheers for that, I'll have a look over your code and try it out. I'm on a 9022 controller/9114 chassis.

 

What I find odd is the same logging speed regardless of setting (unless I go slower of course) regardless of scan mode or FPGA approaches. Further discussion with other folk on here suggests that the 9219 wouldn't return redundant data and so I'd be waiting for it to grab and send each time, but your experience quashes that thought. Very odd. I suspect I'm doing something stupid but haven't spotted it yet!

0 Kudos
Message 3 of 4
(3,567 Views)

Getting the same logging throughput regardless of other factors is strange, and honestly I don't really have a hypothesis for that.  Feel free to email me your code.

 

That being said using variables to talk to a module in scan mode WILL return redundant data.  When you read a variable in scan mode you are reading a cache that gets updated once every scan period.  If you read it faster than that you certainly will see redundant data.  If you don't want to deal with redundant data the thing to do is use the timed loop and configure it to synchronize to the scan engine.  Once you do that your only worry is "Did the code in the timed loop take too long to execute?" and there is some status to watch so you'll know if that happens.  The VI attached should be a pretty good example of that.  Sounds like you figured that out.  Good luck, and let me know if I can help further.

Ross Houston
Principal Software Engineer
Timing & Sync Software R&D
0 Kudos
Message 4 of 4
(3,564 Views)