04-22-2016 11:16 AM
I am trying to use Labview to call another program called Mathematica and then Run the Mathematica notebook. So far I have been able to call and open the Mathematica notebook using Labview "System Exec.vi" but I have not been able to Run the notebook. I am having trouble trying to figure out how the Mathematica options for the command line can be used.
I also tried to use Active X with "Automation Open" but I cant seem to find the proper reference for Mathematica for this vi. Any suggestions?
04-22-2016 11:18 AM
You have given us a specific step. What are you actually trying to do. If we understand that, we can likely help you find an easier way.
04-22-2016 11:27 AM
I am trying to open a Mathematica file and evaluate the notebook using Labview. In other words I am trying to use Labview to open the Mathematica file and then tell Mathematica to Evaluate the notebook (Go to Evaluation then go to Evaluate Notebook).
04-22-2016 01:00 PM
What makes you think that Mathematica supports ActiveX? True, in 2003, someone presented a talk on "Mathematica for ActiveX" (which they named "MAX" -- I hope NI sued them), but given that Microsoft, itself, has largely abandoned ActiveX, this is probably not the way to go.
This is much more a Mathematica topic than one for LabVIEW. You can run Mathematica in "Script" mode (using "m files" -- can't these guys come up with better names?), as discussed on the Web and within Mathematica itself. Start there. It doesn't look at all easy to me.
Bob Schor
04-22-2016 01:13 PM
Well I also mentioned that I was able to call and open Mathematica using the Labview "System Exec. vi" . I run into a problem when I try to tell Mathematica to evaluate the notebook. I would prefer to use Labview to call Mathematica because I have created a Labview software to drive a motion control driver and to acquire data from a detector at the same time. But I use Mathematica to post process the data that is acquired. What are your thoughts on using "System Exec.vi"?
04-22-2016 01:46 PM
By the way Bob I was referring to Mathematica not MatLab
04-22-2016 02:10 PM - edited 04-22-2016 02:11 PM
I am not familiar with Mathematica's command line, but typically you would need to pass parameters in the standard input of SystemExec.vi, such as the notebook name (and read the result in the standard output if that's even possible). Most likely you will need to have your notebook generate some kind of file to read or open later on.
Check this StackExchange thread which seems to be dealing with that question: http://mathematica.stackexchange.com/questions/30310/command-line-execution-of-mathematica-notebooks...
04-22-2016 10:27 PM
I am perfectly aware that you were referring to Mathematica, which calls its script files "m files". From a Wolfram Help Document:
"A Wolfram Language script is typically written as a file with extension .m in the Wolfram Language source format."
Bob Schor
04-25-2016 02:44 PM
unfortunately the link failed to load but I will try to search the site for help. Thanks
04-25-2016 02:54 PM
That's strange, it still works fine for me.
I am attaching a PDF of that page if that can help.