Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Smooth roll mode graphic display?


  • Please log in to reply
4 replies to this topic

#1 analogconsultant

analogconsultant
  • Members
  • 37 posts

Posted 30 March 2013 - 07:58 AM

Folks, Tried to display a signal similar to an ECG, where the graph slowly rolls over the screen from right to left. Just like roll mode on a digital oscilloscope. With DAQFactory that was a disappointment, even at the highest page refresh rate it is a very jagged motion. You'd get a headache looking at that for more than a minute. Is there a software (other than $$$$ Labview) that can do a smooth rolling graph display on a PC without requiring me to be a hotshot programmer? I mean, it ain't rocket science. We did this in the 80's on rather archaic hardware and had a super smooth roll mode display. Nowadays every cheap DSO or PC-oscilloscope can do that. Regards, Joerg

#2 AzeoTech

AzeoTech
  • Admin
  • 323 posts

Posted 01 April 2013 - 10:13 AM

In DAQFactory: The refresh rate of a graph is determined by the page refresh rate. You can change this by right clicking on the page name in the workspace and selecting "Properties", then changing the refresh rate. The default is 0.5 seconds. Anything smaller than 0.03 is a waste of CPU power since that yields 30 fps, which is about the limit of what the eye can see. This is not your case, but I'll say it anyway: If you are doing slow data, say every 5 seconds and want the graph to scroll smooth, you need to feed the graph some faster data. The easiest way to do this is to add another trace to the graph: Y Expression: 1 X Expression: systime() Then the graph will scroll with the refresh rate of the page because systime() will always be the time of refresh and that will cause the x axis to scroll. You can make the Y Expression any scalar value. If you are still seeing jagged data, then its probable that your data isn't actually coming in at the rate you think it is, or your processor isn't powerful enough (or is busy with lots of other things). Perhaps you can post your .ctl doc so I can evaluate. I've attached a sample showing all I've described. There are two channels, one at about 30hz, one at 1/5hz being plotted. The refresh rate of the page is set to 0.1. The top graph shows the 30hz data, which moves nice and smooth. The bottom graph is the 1/5hz data, but runs smoothly because of the technique I described.

Attached Files


Main Web: www.azeotech.com
Express Web: www.daqexpress.com

#3 analogconsultant

analogconsultant
  • Members
  • 37 posts

Posted 01 April 2013 - 11:09 AM

Thank you for the detailed response, it certainly has helped me imporve things to some extent. What I was using was actually just the "graphing.clt" example that came with the DAQFactory install. But I think that after your response I have a hunch what it could be: The Labjack sends enough data, that's probably not the issue, but likely sends it in USB packets. Instead of storing and smoothing them out DAQFactory probably just dumps the chunks of data as they come. I've tried adding Y Expression: 1 and X Expression: systime() and that does speed it up. When using your example with the test data it's at similar speed. However, setting the page refresh any lower than 0.1 does not increase the smoothness any further. It still is not a totally smooth rolling display like the FFTs and other things I run on the same PC. Also, it "paste on" chunks at the end, which could be because the Labjack isn't streaming. This is something that could possibly be improved. For example, many oscilloscopes work in the same way, they transfer data over the USB in virtual RS232 manner, in chunks. Yet you still get a nice smooth roll mode display on the PC,same as on the scope itself (which usually has a much les powerful processor and a simple TFT). Thanks again for your help. Regards, Joerg

#4 AzeoTech

AzeoTech
  • Admin
  • 323 posts

Posted 01 April 2013 - 12:01 PM

Yes, the issue is probably with the hardware as I indicated. You can really only use poll mode so fast. How fast depends a little on your PC and which LabJack unit you have. The U12 is particular slow, and the graphing.ctl example with two inputs would take close to 60ms per cycle. The U3 series is a bit faster, probably 10-15ms per cycle, but there is overhead. If you arent' streaming, you get one data point at a time. If you stream you get data in chunks as you described. My guess is those other scope apps stream data at high rate, thus getting the fast graphing. Why don't you try streaming your data and see how it looks? Use the "BasicStream.ctl" file as a starting point. Change the refresh rate of Page_0 to 0.03.
Main Web: www.azeotech.com
Express Web: www.daqexpress.com

#5 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 01 April 2013 - 01:04 PM

As AzeoTech mentioned, in command/response mode you get 1 sample or scan per USB packet. On the U3 it typically takes about 1 or 4 ms per packet per Section 3.1 of the U3 User's Guide:

http://labjack.com/s...users-guide/3.1

I opened the graphing.ctl example with a U3 connected. The chart seems smooth enough to me, but the ADC channel is only being acquired at 1 Hz to the 1Hz chart updates are obvious. What do you change in graphing.ctl to cause problems?


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users