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
 LabTalk Forum
 LabVIEW - Origin Worksheet name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

masterd

Australia
Posts

Posted - 04/13/2006 :  03:10:47 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5 pro
Operating System:2000 pro

I have data export to origin incopporated into my labview control software. origin part of the software is very similar to tutorial1.vi provided with origin.

i have figured out how to append replicate data for the same run to the same worksheet (rather than overwrite as with tutorial1) but i cant figure out how to append to active worksheet with name other than Data1.

the only way it works is if worksheet i want to import to is active AND called Data1. Each new workshhet i make i literally have to rename back to Data1 for thing to work. is there any way (script, modified vi, or whatever) to modify my situation so data gets imported into active worksheet regardless of its name?

Thanks

Darko

easwar

USA
1965 Posts

Posted - 04/13/2006 :  09:48:16 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Darko,

Good question!

The name of the active page (in your case worksheet) is stored in the LabTalk variable %H. So for example in Origin you can go to script window and type
%H=
and it will print the name of the active page.

So for your case you need to basically get that name into your VI and pass that to the PutWorksheet subVI instead of passing a fixed name.

In the Origin SubVI palette, there is a SubVI called OAGetLTStr which can be used to get the content of %H.

Pasted below is image of tutorial1 that I modified to get %H and then push data into the active sheet. Note that I am not doing any checking to see if it is a worksheet - I am simply assuming that it is a worksheet - perhaps that will work in your case.

Easwar
OriginLab





Edited by - easwar on 04/13/2006 09:49:15 AM
Go to Top of Page

masterd

Australia
Posts

Posted - 04/13/2006 :  11:56:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for such a prompt reply!

Unfortunately, I don't have access to labview at home so will have to wait till i get back to uni tomorrow or day after.

Your mod makes perfect sense so i cant wait to test it!

Cheers

Darko

Go to Top of Page

masterd

Australia
Posts

Posted - 04/13/2006 :  10:48:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It works perfect! Thanks Easwar!

Here is the screenshot of the vi if anyone has got similar situation.

-All the replicates get appended to the same worksheet. ie. you can have more than two columns per worksheet; unlike with tutorial1.vi where data gets overwritten.

-For different run/sample all you need to do is create new worksheet and make sure it is active and data gets imported, regardless of the worksheet name. Again, unlike tutorial1.vi where worksheet MUST be names Data1.

Obviously, you replace SampleDataNoise.vi with your data input.

Thanks again

Darko

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