The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Automation Server/COM and LabVIEW
 live data view
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hanskloss

USA
Posts

Posted - 12/05/2008 :  4:36:34 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and SR (Select Help-->About Origin): 8 Pro, SR4
Operating System: Windows XP

Hi
I would like to use Origin to provide "live" view of neutron scattering data while it is being collected.

I have a set of classes (in C#) that control and receive data from our Data Acquisition System (DAS) - which are histograms of one or two independent variables. They would qualify, I guess, in Origin language as 2-D or 3-D data sets.

Now we would like to plot them and periodically update the plots with fresh data (say every 1-2 seconds while the data are being taken).

As I am not [yet :)] an Origin expert - I am a quite proficient developer - I would like to ask what would be the most optimal way to attack this problem?

1) Create an OPJ project with origin, let my COM app load it, and then send fresh data?
2) Use Lab Talk commands to do the job?
3) Something else?

Again, I do not want to reinvent the wheel and I think that Origin does a pretty good job in presenting the data. All I would like to do is to send the data that is ready for presentation to Origin

Thanks for you help

Piotr


cpyang

USA
1406 Posts

Posted - 12/05/2008 :  5:22:32 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You should buffer your data and then send over to Origin at a slower rate. The following examples shows how to append data to columns and the corresponding plots will live update, but unfortunately it shows adding one point at a time.

http://wiki.originlab.com/~originla/wiki/index.php?title=OriginCOM:Saving_Instrument_Data_to_Worksheet

We will add a new example shortly that shows buffering the values and send over with more points each time.


CP
Go to Top of Page

hanskloss

USA
Posts

Posted - 12/05/2008 :  5:30:59 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
How much slower?
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 12/05/2008 :  6:36:52 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Our test shows that Origin graph (line plots) can be refreshed quite well a dozen times a second. It does not really matter what the buffer size is. So optimally, you would buffer your data so that you send them over to Origin no more then 10 times a second.

CP
Go to Top of Page

hanskloss

USA
Posts

Posted - 12/06/2008 :  8:34:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
What would be max frequency for 3-D plots?
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 12/07/2008 :  07:18:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
3D surface plot will be much slower. We will need to create an example and do some test.

I assume then that you are sending over data as a matrix? The fastest would be to set the matrix as Image view and directly visualize the image on the matrix. Or to make an image plot, that is pretty much the same in terms of refresh speed. You may also consider a contour plot, which is still much faster then a 3D surface plot.

CP
Go to Top of Page

hanskloss

USA
Posts

Posted - 12/08/2008 :  10:46:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes the data is a matrix (essentially an image).

All I need is an image display with a given color map. I do not need the ability to rotate all the unnecessary 3-D stuff. Basically I need something similar to Matlab imshow()
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 12/08/2008 :  4:08:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
We will add an example in C# to use a timer to send a matrix over to Origin and see the image update.

CP
Go to Top of Page

hanskloss

USA
Posts

Posted - 12/08/2008 :  5:36:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I am anxiously waiting for the examples.
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 12/08/2008 :  9:02:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
We have put together an example for the next SR. You can see if you can follow it with just the codes from this wiki link:

http://wiki.originlab.com/~originla/wiki/index.php?title=OriginCOM:Images_and_Plots_Live_Update

For a matrix of 640x480, updating 2 times a second allow rather comfortable continue usage of Origin with the live update. 3 Times a second seems to shows some delay.

CP
Go to Top of Page

hanskloss

USA
Posts

Posted - 12/09/2008 :  10:52:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Shouldn't your nMax in timer1_Tick be
int nMax = NUM_ROWS*NUM_COLS - 1;
?

You have:
int nMax = (NUM_ROWS - 1) + (NUM_COLS - 1);

Go to Top of Page

cpyang

USA
1406 Posts

Posted - 12/09/2008 :  11:41:51 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
int nMax = NUM_ROWS*NUM_COLS - 1;



It is just the max value put into the matrix as a demo. I was using

nc + nr

so that was why.

We found that matrix image view does not support user supplied colormap, so we will need to use an image plot to allow a colormap to be used. We will show an example of image plot with colormap shortly.


CP
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 12/15/2008 :  7:10:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
For a matrix of 640x480, updating 2 times a second allow rather comfortable continue usage of Origin with the live update. 3 Times a second seems to shows some delay.



We have made some improvement on sending matrix data to Origin, so with the above, refreshing 5 times a second is quite comfortable in the upcoming SR5.

CP
Go to Top of Page

hanskloss

USA
Posts

Posted - 12/16/2008 :  3:06:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
What about the example with colormap?
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 12/16/2008 :  5:51:59 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sorry, looks like we do not have COM support for colormap. The following is an Origin C example. We will look and see how to do the same thing in COM.

http://ocwiki.originlab.com/index.php?title=OriginC:Image_Plot

Go to Top of Page

hanskloss

USA
Posts

Posted - 12/17/2008 :  9:13:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can one perhaps issue a bunch of LabTalk commands?
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 12/17/2008 :  10:20:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
We have decided to add Colormap class to COM, so better just use default gray image for now and wait a couple of weeks for SR5, where the colormap can be applied to the Image in the matrix itself, without having to use a separate plot and can be configured with two arrays, array of levels and array of RGB.

CP
Go to Top of Page

hanskloss

USA
Posts

Posted - 02/03/2009 :  1:20:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Is the SR5 coming soon?
Go to Top of Page

greg

USA
1378 Posts

Posted - 09/08/2014 :  4:07:08 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
FYI:
The final Service Release for Origin 8 was SR6.
You can check here:
http://www.originlab.com/index.aspx?go=SUPPORT/ServiceReleases
Go to Top of Page

long123

China
9 Posts

Posted - 06/18/2015 :  02:36:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
We found that matrix image view does not support user supplied colormap, so we will need to use an image plot to allow a colormap to be used. We will show an example of image plot with colormap shortly.


sbvdxfnbghm
Go to Top of Page

lindseynicole010

Canada
2 Posts

Posted - 11/12/2016 :  05:22:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanks
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000