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
 Changing the X and Y axis definition of a Matrix
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

codexplorer

USA
15 Posts

Posted - 12/12/2015 :  2:22:21 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 9.1.0 64 bit SR1
Operating System: Windows 7 64 bit

I am exporting a matrix of Z values from LabVIEW to Origin which I later want to plot in Origin as an intensity map.
I want to save the X and Y axis range information while I am doing that, but I haven't been able to figure out how so far.
I am referring to the equivalent of these actions within Origin:

- Select all rows and columns
- right-click menu: Set Matrix Dimension/Labels...
- fill in the 4 values X1, X2, Y1, Y2 in the "xy Mapping" tab:
Map Column to x: From X1 To X2
Map Row to y: From Y1 To Y2

I suspect that using a labTalk script (from within LabVIEW) might do the trick, but my attempt to execute the following script on the Matrix Object I just created and populated in LabVIEW, doesn't do anything (it doesn't throw an error either):

mdim cols:=%d rows:=%d x1:=%f x2:=%f y1:=%f y2:=%f;

where the %d and %f values are replaced by the correct values after passing through a Format to String function.

Any suggestion would be welcome.

Edited by - codexplorer on 12/12/2015 2:45:14 PM

Penn

China
644 Posts

Posted - 12/21/2015 :  10:27:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I have made some little change to the one of Origin's built-in examples, "Matrix Access.vi", and get it correct. When open this vi in LabVIEW, I changed the LabTalkStr as the following:

mdim x1:=10 x2:=20 y1:=100 y2:=200;
matrix -v sin(x)+cos(y);

To see if the XY data is set correct, you can turn on XY data by menu View: Show X/Y.

Penn
Go to Top of Page

codexplorer

USA
15 Posts

Posted - 12/25/2015 :  6:20:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Penn

Hi,

I have made some little change to the one of Origin's built-in examples, "Matrix Access.vi", and get it correct. When open this vi in LabVIEW, I changed the LabTalkStr as the following:

mdim x1:=10 x2:=20 y1:=100 y2:=200;
matrix -v sin(x)+cos(y);

To see if the XY data is set correct, you can turn on XY data by menu View: Show X/Y.

Penn



Where would I find the Matrix Access.vi? Or equivalently, what sequence of calls to the Automation Server is performed?

Nevermind, I found it: http://www.originlab.com/doc/LabVIEW/examples/Matrix-Access
However, if I try that idea, it doesn't work for me. Here is the code I use:



When I execute it, no error is generated, the matrix is populated as instructed but the X and Y values shown when performing the View>>Show X/Y trick are the default values 10/i (where i = 1 to N, where N is the dimension, are the value indices). In other words, the default value of 10 for the X and Y range are not modified by the script.

Edited by - codexplorer on 12/25/2015 8:20:23 PM
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