LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot multiple XY Graphs (dynamic data type)

Solved!
Go to solution

Hi Mystogan,

 

scripting with DIAdem is not as difficult as it seems to be.

 

There is a so called "Record"-function that writes the script code for what you click with your mouse. You find a little description at the following link:

Recording a Script

http://zone.ni.com/reference/en-XX/help/370858K-01/procscript/procscript/procscript_recording_autose...

 

In this link you get a description how to execute a VI with DIAdem:

Calling a LabVIEW VI from DIAdem 10.1 or Above

http://digital.ni.com/public.nsf/allkb/D4947ACD289AE7A9862572D600603974

 

This is a tutorial about connecting a VI with DIAdem:

Calling a LabVIEW SubVI with DIAdem

http://www.ni.com/white-paper/13595/en

 

I hope this is helpfull for you. And no worries, when I made my first scripts with DIAdem, I was surprised how easy little codes get scripted with help of the recorder.

 

If you have any further questions please ask.

 

Regards,

Florian

0 Kudos
Message 11 of 24
(1,695 Views)

Hi Florian,

thanks for your inputs.

 

I'm trying to follow the tutorial shown in http://www.ni.com/white-paper/13595/en and got stuck with "CurrentScriptPath" function which is not recognized in my diadem 11.0. I've been looking in google and found out here http://forums.ni.com/t5/DIAdem/DIAdem-doesn-t-recognize-my-CurrentScriptPath-function/td-p/2162738 . They said that the function should work in my diadem version. I've tried to change the function with "AutoActPath" function but another problem occurs, said that line 13 is not executable. I think the problem is not really solved with using "AutoActPath" instead of "CurrentScriptPath".

 

However, where can I find explanation about these functions, variables, etc. to understand them better? only in Help (F1)?

 

TestLCM.JPG

 

I have followed the instructions; make new project, new VI, renaming controls and indicator, build source distribution (just like the tutorial).

This is the SS of my Diadem version.

 

Diadem Vers.JPG

 

 

0 Kudos
Message 12 of 24
(1,677 Views)

Hi Mystogan,

 


I think the help(F1) is quite good to inform about a specific funktion. For a general overview it might be better to have a look on the NI homepage. There are a lot of tutorials and probably some interessting for you, too.

 

http://www.ni.com/tutorials/

 

About the "CurrentScriptPath" function I have to inform myself. I did the little tutorial as well. Everything is working, but the problem I had, was that my path was wrong, because I didn't name my VI as proposed. So the path was wrong at the beginning.

 

I will write you, if I know anything more about the "CurrentScriptPath" - problem. Can't explain it myself at the moment.

 

Do you get another error message, than the one in the "Logdatei"?

 

Regards,

Florian

 

0 Kudos
Message 13 of 24
(1,669 Views)

Hi Mystogan,

 

did you look in help for the "CurrentScriptPath"-function. Does it exist there?

 

This varaible ist still written in black, so the programm doesn't recognize it as a veriable.

 

Either you have written in wrong (shouldn't happen with copy & paste) or your DIAdem doesn't know "CurrentScriptPath" as a predefined varaible. Then it would be the soution, to use the "AutoActPath"-function instead of "CurrentScriptPath".

 

The error in line 13 may occur because of the mistake I made (described in the post above), when the name of the VI in the script doesn't fit to the name you gave your VI.

 

Regards,

Florian

0 Kudos
Message 14 of 24
(1,663 Views)

Hi Florian,

 

I've been trying to search "CurrentScriptPath" in help index, but I dont get anything. Is this because I dont have full license with diadem? Everytime I started Diadem, there is a warning about license, and I'm using like a temporary license which said its available until 17 April.

 

regards,

Yan

0 Kudos
Message 15 of 24
(1,660 Views)

Hi Mystogan,

 

that could be a reason. You just see help and examples for toolkits you have. But that the evaluation license is running out shouldn't be a problem as long as the end of the license isn't yet.

 

Can you look for the "AutoActPath"-function. Perhaps the "CurrentScriptPath" doesn't work with your license, but this function does.

 

Regards,

Florian

0 Kudos
Message 16 of 24
(1,658 Views)

Hi Florian,

 

yes, "AutoActPath" is available in my Diadem Help list but not the "CurrentScriptPath". But however, the problem in line 13 is still there, I might have to try to delete everything and start over again. Btw, is there any easy&simple example to start with script-programming in Diadem? I've seen some examples and most of them are not quite simple and not too relevant to what I need (I only need like; call templates, call data, put the data on the graph, save them as ppt and pdf). I'll keep looking in the Diadem examples and NI tutorials pages.

Oh yeah, I tried to record "what I do in diadem", such as open templates, open files and got recorded. But when I drag my points to the graph, it doesnt get recorded. I think I'll search further in examples, unless you can show me a relevant example.

 

oh yeah, question though:

1. back to topic title, is it possible to plot multiple XY-Graphs in ddt? (whatever the answer is, I would take it as the answer to my post here)

2. if I have the script done in Diadem to call templates, call data, plot data, etc. Is that means I need to open diadem in order to execute the script? or is it possible without opening Diadem?

 

regards,

Yan 

 

 

0 Kudos
Message 17 of 24
(1,653 Views)
Solution
Accepted by Mystogan

Hi Mystogan,

 

to find an example I need some more time, but with your to other questions I can already help you.

 

1. According to the following link i found it is not possible to plot more than one graph with DDT.

Using the Dynamic Data Type

http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/dynamic_data_type/

 

2. Yes that means, that you would have to open DIAdem. But instead, if everything works as I imagine, you don't have to open LabVIEW yourself.

 

I will look for a quite simple tutorial or example that will hopefully help you.

 

Regards,

Florian

0 Kudos
Message 18 of 24
(1,649 Views)

hi Florian,

 

thank you very much for all of your efforts. And yes, after starting over the tutorial again I'm able to execute the script and call my VI. 

 

regards,

Yan.

 

*I just noticed that the generated "builds" folder contains so many VI's and total size of the folder is 25,9MB. Is it standard size?

0 Kudos
Message 19 of 24
(1,645 Views)

Hi Mystogan,

 

the example i could find is definitely not easy, but could solve your basic question.

I don't know which language you use in DIAdem, in German it is called "Steuerung von DIAdem aus LabVIEW".

 

The main point is, this example led me directly to LV and opened another LV-example, called "LV_DIAdem_ActiveX.vi"

 

I quote from the example description:

"This VI is an example for using the DIAdem ActiveX interface to run DIAdem commands. The VI loads a TDM/S data set, opens a REPORT layout, and creates a PDF report in DIAdem."

 

Doesn't that sound like the application that you want?

You migth specify a couple of things, but the main idea is the same isn't it?

 

If you need another example of DIAdem, just tell me.

 

Regards,

Florian

0 Kudos
Message 20 of 24
(1,640 Views)