05-23-2014 05:41 AM
Hi all,
I am Divya.
My aim :
I need to develop a programing language to interact with Labview such that the script should call labview front panel, execute the given task and front panel shold give back the result to the script.
I want to achieve this by using my own developed programing language (Valid reasons are there why not to use already exixting scripts which I dont want to discuss here as it is not relevant).
My idea :
As developing a new scripting language is a big task I am planning to start with Python scripting. I am trying to interact with labview using python script for now.
My problem :
As I am fresher to this field I dont know the possible ways to interact with Labview using python scripting. (Except using Labpython). If there is any way to achieve this please guide me on this.
Thanks in advance
05-23-2014 06:35 AM
The easiest way sounds like a command prompt thing, your VI can read the arguments and react to them, then generate a system out, file or similar.
Depending on how advanced you want the scripting to be this can be rather easy or extremely hard.
You can e.g. always use one command per line in the format [command]([args separated with semicolon])
Then cut the string at '(', send the first part to a case structure and handle the rest inside.
/Y
05-23-2014 07:00 AM
05-28-2014 08:19 AM
Hi Yamaeda and Dennis_Knutson
Thanks for the replies.
Hi everyone once again.
I could develop a VI which takes the python command which is within double quotes (" "). And It can give out the command without those double quotes. But it is giving output in string format.
But I want to take that output and do furthur calculations which is not possible with string output. I need to bifergate if there is any '+' symbol or '-' symbol or number of outputs and carry out the respective operation.
Can anyone tell me if there is any labview functional block to convert string to data or any other way?
Hope I am clear. If not please ask me to exlain once again
Thanks for replies in advance.
05-28-2014 10:34 AM
05-28-2014 11:51 PM
I am doing the same as the original question I have asked. As I have mentioned in my question I am starting off with a small addition (or any basic mathematical operation) function using Python script.
And yes the basic idea is to call Labview from script not the vice versa. To achieve this I need to pass the parameters from the python script to Labview and output from Labview to Python. For this purpose I am developing a small VI which vil take Python commands and carry on furthur operations.
I can explain with an example.
I have a command in python as sum=x+y. I want to take this command and send 'x' to a numeric control, 'y' to another numeric control and 'sum' to a numeric indicator and at the same time back to script. In between numeric controls 'x' and 'y' I need to carry out '+' operation. Say if the command is sum=x-y I need to carry out '-' operation(Where identifying '+' or '-' or any other operation is the job of labview).
I have developed a VI which can take the command from python and give it to Labview as a string. I need to know how to bifurcate that string to numeric controls, operands etc.
05-29-2014 12:02 AM
05-29-2014 12:05 AM
05-29-2014 04:21 AM