DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

mathscript in script

sorry but i don't speak English very well!!
Can I run  (put in) a mathscript in the registration of a script?
thanks!!!
0 Kudos
Message 1 of 5
(3,956 Views)

Hi cicciocic,

 

I assume you are talking about the sort of MathScript that you can define and use in LabVIEW, right?  You can run such a MathScript in DIAdem 10.1 or later from the "MathScript" menu in the ANALYSIS panel.  When you register the MathScript in DIAdem ANALYSIS, DIAdem automatically creates a VI that calls the MathScript, then it also creates a VBScript that calls the VI, using the LVRuntime object available in DIAdem VBScripts.  So if you already have a VI that calls your MathScript, you can skip the registration step in DIAdem and just call that VI directly from a DIAdem VBScript using the LVRuntime object.

 

Bad Turpin
DIAdem Produc Support Engineer
National Instruments

0 Kudos
Message 2 of 5
(3,933 Views)

Hi! Thanks for your reply, but  I did not want this.

I created a mathscript in DIAdem and I would like to make a script in DIAdem that does the same. how is it done?
mathscript:
%--------- New MathScript ------------------------
%--------- Enter your MathScript -------

for y = 1:(numeroacquisizioni)
for x = 1:256
Xcinque (y,x) = Input (1,(x+768* (y - 1)))
Xtre (y,x) = Input (1,((x+256)+(768 * (y-1))))
Xuno (y,x) = Input (1,((x+512)+(768 * (y-1))))
Ysei (y,x) = Input (2,(x+768* (y - 1)))
Yquattro (y,x) = Input (2,((x+256)+(768 * (y-1))))
Ydue (y,x) = Input (2,((x+512)+(768 * (y-1))))
end
end
how do I do this in section SCRIPT of Diadem?
GREETINGS, ANTONIO.
0 Kudos
Message 3 of 5
(3,930 Views)

Hi to all!

 

Brad, thank you for your post! It will help to better understand how Diadem works. 

Antonio, maybe i'm wrong, but i figured that you are looking to export a Matlab script into Diadem... Can you confirm my assumption? Anyway, assuming that it wold be the "right" way, you could refer to the knowledge base linked below:

 

Methods for Working with DIAdem and The MathWorks, Inc. MATLAB® software: Data Transfer and Interpro... 

 

Don't worry if you are not confident with your english, instead it's important to correctly describe your problem and the instrumentation you are using, so the community users could understand your issue and post a good solution. You had a good idea to post your question in the international forum, in this way a lot of people can read your message and share different opinions,  moreover you can post your questions also to the NI italian forum.

 

Please let me know if you need additional help! Best regards. 

Matteo
0 Kudos
Message 4 of 5
(3,913 Views)

Hi cicciocic,

 

The way you would do this in DIAdem is the following:

 

1) Create your X channel in DIAdem with values in it from 1 to 256

2) Create or load your N (acquisition) Y channels, each having 256 values in them

3) Loop over the Y channels

4) Inside the loop use the ChnCalculate() command for each formula below to create N result channels

5) Send the N result channels from each formula to a new Group in the Data Portal

6) you now have 1 raw data Group, plus the following new result channel Groups:

     Xcinque
     Xtre
     Xuno
     Ysei
     Yquattro
     Ydue

 

What file format is you acquisition data in?

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 5 of 5
(3,907 Views)