Scripting an interactive labview VI

I have a large top-level VI that controls and performs data collection for many different devices and over different interfaces. I currently do all of the control interactively through the front panel UI. I would like to have my VI be able to run off a script... not an external scripting language, but something like the Setpoint Profile VI's that come with the PID control toolset.
So obviously, implementing the Setpoint Profile VI's for my temperature controllers is pretty trivial. My problem is that I have many other devices which aren't necessarily controlled the same way. For example, for PID temperature control, you would just continually set the setpoint at a given interval, but for RS232-controlled pump, you would onl
y want to send a signal to stop or start it. I would like to have the scripting be a feature of the existing interactive VI (so I can toggle between automated and manual modes with a switch), and hopefully not have to have completely separate code.
So bascially I am wondering if anyone has a good strategies or examples for doing such a thing. Here are some issues I can think of:
- is it better to have one huge script that has the settings for all devices, or should I have separate scripts and synchronize them?
- I was considering scripting the UI itself, kind of like a "ghost user" using property nodes, but recent discussions on this board tell me this is not very efficient.
- are my expectations realistic?
thanks in advance for any advice.

Hi,
I think that you should implement a similar idea to the SetPoint Profile VI. One of the inputs to this VI is an array of clusters where each cluster has the time-value pair (setpoint). One approach would be to change the cluster to contain time and values for each device you are trying to automate. For example, you would have time, value for the temperature control, value for the pump and so on. Since the value for the pump would be on and off, you would want to have three values: ON, OFF and IGNORE(do nothing to pump at this time). Having an array of cluster with each cluster containing time and values for all your devices will allow you to synchronize the flow of your application since the time value will be common for all the devices.
Good luck
with the application. I hope this helps.
Sincerely,
Feroz
National Instruments

Similar Messages

  • ActiveX can't create object when VB Script called from Labview

    I have an interesting issue that I can't find a solution for. I am using the DIAdem Run Script.VI in Labview to call a script that opens an Outlook object and sends an email. When the script is called via LabView I get this error:
    However, when I manually run the script from the DIAdem script tab it works as expected with no errors.
    This is the code:
    'Begin email send function
    Dim oOutlookApp
    Dim oOutlookMail
    Dim cnByValue : cnByValue = 1
    Dim cnMailItem : cnMailItem = 0
    ' Get Outlook Application Object
    Set oOutlookApp = CreateObject("Outlook.Application")
    ' Create Mail Item
    Set oOutlookMail = oOutlookApp.CreateItem(cnMailItem)
    ' Set Mail Values
    With oOutlookMail
    .To = "[email protected]"
    .Subject = "Report: " & Data.Root.ActiveChannelGroup.Name & " for " & CurrDate
    .Body = "test automatic report emailing with VB Script."
    ' Add Attachement
    Call .Attachments.Add(strLocFileName, cnByValue, 1 )
    ' Send Mail
    Call .Send()
    End With
     (Original code includes Option Explicit and all variables are properly included/declared, I just took the snippet of what's causing the error).
    I have looked at the following threads for info already:
    http://forums.ni.com/t5/DIAdem/Some-errors-when-calling-LabVIEW-VIs-Interactively-from-DIAdem/td-p/2...
    http://forums.ni.com/t5/DIAdem/Active-X-component-cannot-create-object-Diadem-8-1/m-p/71212/highligh...
    -I tried running the script via Windows explorer (per Brad's suggestion) by itself without the DIAdem specific functions and it runs fine.
    http://forums.ni.com/t5/DIAdem/Error-while-runing-diadem-asynchronous-script-from-labview-on/m-p/111...
    -I am not running the scripts asynchronously
    Using Windows 7 (64bit), DIAdem 11.2 and LabView 7.1.1
    Thank you.

    Hey techerdone -
    I'm afraid I personally can't be of much help - I tested your code both from DIAdem and from LabVIEW and each worked without issues in both cases (Outlook closed, Outlook open).  I'm using DIAdem 2011 SP1, LabVIEW 2011, and Outlook 2007...
    Derrick S.
    Product Manager
    NI DIAdem
    National Instruments

  • How to get the context data using java script in interactive forms

    Hi All,
    How to get the context data using java script in interactive forms by adobe,  am using web dynpro java
    thanks.

    Hi venkat,
    Please Refer this link.
      Populating one Drop-Down list from the selection of another Drop-down list
    Thanks,
    Raju.

  • Script Matlab In Labview

    Buongiorno a tutti,
    sono nuovo di questo forum. Sono un tirocinante presso l'università di Napoli Federico II e sto familiarizzando con l'ambiente LabView. Mi è stato assegnato il compito di eseguire uno script Matlab mediante LabView (le macchine su cui lavoro possiedono la versione 7.0 e 8.5). Se mi sapete dare qualche informazione ve ne sarei grato o anche qualche link visto che sto agli inizi.
    Saluti.
    Sorry for my english...

    Sorry, can you move this question to italian community?
    Thanks
    Sorry for my english...

  • Matlab script window in labview 7.0

    In labview 7.0 the matlab window associated with the scripts server is normally hidden and not accessible to the user. In LV 6.x it was and provided a flexible and interactive way of collecting, analyzing and storing data as matlab workspace.
    Is there an alternative way to access the script server and its workspace under LV 7 ?

    The script server window is not hidden on my machine and I am using LV 7 with Matlab R12. I am not sure how to change this setting (or even if it's possible).

  • I can't find the MATLAB script node in labview

    We are using a MAC G4 with OS 9. We also have labview 5.1. I have looked under Mathematic>>Fomula in the tools palette and I cannot find the MATLAB script node.
    Is there an extra download that I need to get this MATLAB script node?

    The HIQ and MATLAB script nodes are only available in the full and professional development systems. If you have one of these versions, these nodes should be under the Mathematics>>Formula palette.
    If you have the base package of LabVIEW, you will not have access to these script nodes. Details about which options are included in which development packages can be found at:
    http://www.ni.com/labview/devchart.htm

  • Filling an Activity  from the Interactive Script  in  Interaction Center WC

    Hi Experts,
       I need to fill an activity from an Interactive Script in the Interaction Center WinClient.
       When i finish selecting in the script all the possible answers, i need to create an activity with information coming from the script. How can i make that possible?
    points rewarded
    thanks

    Alberto
    You can create an activity.i.e., you can create an Order from the Interactive Script if you already created the Script structurethen follow the below steps
    I think it would be helpful
    Procedure: 
    T-Code:  EWFC0
    Path: SPROIMGCustomer Relationship ManagementCustomer Interaction CenterVisible ComponentsAction Box SettingsDefine Configuration Profile for Action Box.
    1. Choose F4 help to select one of the Action Box profiles you have created and you want to adapt and choose change.
    2. Mark the Action box Configuration and create a new Action Box Group by choosing Create transaction group.
    Enter a group ID, description and icon for the new transaction group and choose Continue.
    3. Mark the new transaction group and create a new Action Box transaction by choosing Create transaction.
    4. Enter a transaction ID.
    5. Enter a Transaction Definition section, select Workspace.
    6. In the Transaction Definition section, select Workspace.
    Two additional fields will appear.
    7 Choose F4 in the Workspace field to select the Script.
    8. Choose F4 in the profile field to select the Interactive Scripting profile that you created in the previous steps above.
    9. Enter a Slot Name if desired.
    10. Choose Continue.
    You are automatically taken to the Maintain Data Flow screen .No data flow parameters need to be maintained for the Interactive Scripting workspace.
    11. Choose Back.
    12 Choose Save.
    Note:  Since Only Workspace of this type can be open at once, you will need to close the Automatically Created Interactive Scripting Workspace before launching the Interactive Scripting Action Box call.
    Regards
    Surendra

  • Matlab script launched from labview

    Hi everyone,
    I need to run a matlab script controlling a network analizer from labview. I use labview to start the movement of the motors in some experiment. Then, once the movement starts, matlab should run a script to perform adquisition and treatment of the data. Could anyone give me some trick of how to launch the matlab script?
    Best

    Here is a link that looks to describe what you are asking
    http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/creating_a_matlab_script/
    Hope that helps.

  • 2651 A TSP Script conversion to LabVIEW

    Hello,
    I have a problem on the conversion of any TSP scripts that contain call functions and for end loops. I'm new to TSP scripts with trigger models. I used Test Script Builder (TSB) tool and am able to execute any TSP and generate raw data but I seems unable to convert most TSP codes in LabVIEW VISA command or TSP loader LV and execute it to generate data.. I can't find any tutorial or examples how to do it. 
    Let's say.. Use the example KE2651A_Fast_ADC_Usage.tsp (pulse) and I'll just focus on function CapturePulseV(pulseLevel, pulseWidth, pulseLimit, numPulses) portion. I saw few LV examples that said loadscript myscript and close it by endscript.  I did many different approaches and I kept getting errors especially from print function that I am not able to generate any data via LV by having it to read data from buffer from inside the instrument. Some approaches, I got no error but no data.. Some approaches, I got -285 error.
    The portion of the pulse TSP code that works in TSB is here (I am not including loadscript and endscript) and what is the PROPER way to re-code it to LabVIEW and execute it and get data? Thanks:
    function CapturePulseV(pulseLevel, pulseWidth, pulseLimit, numPulses)
    if (numPulses == nil) then numPulses = 1 end
    -- Configure the SMU
    reset()
    smua.reset()
    smua.source.func = smua.OUTPUT_DCVOLTS
    smua.sense = smua.SENSE_REMOTE
    smua.source.rangev = pulseLevel
    smua.source.levelv = 0 -- The bias level
    smua.source.limiti = 5 -- The DC Limit
    smua.measure.autozero = smua.AUTOZERO_ONCE
    -- Use a measure range that is as large as the biggest
    -- possible pulse
    smua.measure.rangei = pulseLimit
    smua.measure.rangev = pulseLevel
    -- Select the fast ADC for measurements
    smua.measure.adc = smua.ADC_FAST
    -- Set the time between measurements. 1us is the smallest
    smua.measure.interval = 1e-6
    -- Set the measure count to be 1.25 times the width of the pulse
    -- to ensure we capture the entire pulse plus falling edge.
    smua.measure.count =
    (pulseWidth / smua.measure.interval) * 1.25
    -- Prepare the reading buffers
    smua.nvbuffer1.clear()
    smua.nvbuffer1.collecttimestamps = 1
    smua.nvbuffer1.collectsourcevalues = 0
    smua.nvbuffer2.clear()
    smua.nvbuffer2.collecttimestamps = 1
    smua.nvbuffer2.collectsourcevalues = 0
    -- Can't use source values with async measurements
    -- Configure the Pulsed Sweep setup
    -- Timer 1 controls the pulse period
    trigger.timer[1].count = numPulses - 1
    -- -- 1% Duty Cycle
    trigger.timer[1].delay = pulseWidth / 0.01
    trigger.timer[1].passthrough = true
    trigger.timer[1].stimulus = smua.trigger.ARMED_EVENT_ID
    -- Timer 2 controls the pulse width
    trigger.timer[2].count = 1
    trigger.timer[2].delay = pulseWidth - 3e-6
    trigger.timer[2].passthrough = false
    trigger.timer[2].stimulus =
    smua.trigger.SOURCE_COMPLETE_EVENT_ID
    -- Configure SMU Trigger Model for Sweep/Pulse Output
    -- Pulses will all be the same level so set start and stop to
    -- the same value and the number of points in the sweep to 2
    smua.trigger.source.linearv(pulseLevel, pulseLevel, 2)
    smua.trigger.source.limiti = pulseLimit
    smua.trigger.measure.action = smua.ASYNC
    -- We want to start the measurements before the source action takes
    -- place so we must configure the ADC to operate asynchronously of
    -- the rest of the SMU trigger model actions
    -- Measure I and V during the pulse
    smua.trigger.measure.iv(smua.nvbuffer1, smua.nvbuffer2)
    -- Return the output to the bias level at the end of the pulse/sweep
    smua.trigger.endpulse.action = smua.SOURCE_IDLE
    smua.trigger.endsweep.action = smua.SOURCE_IDLE
    smua.trigger.count = numPulses
    smua.trigger.arm.stimulus = 0
    smua.trigger.source.stimulus = trigger.timer[1].EVENT_ID
    smua.trigger.measure.stimulus = trigger.timer[1].EVENT_ID
    smua.trigger.endpulse.stimulus = trigger.timer[2].EVENT_ID
    smua.trigger.source.action = smua.ENABLE
    smua.source.output = 1
    smua.trigger.initiate()
    waitcomplete()
    smua.source.output = 0
    PrintPulseData()
    end
    function PrintPulseData()
    print("Timestamp\tVoltage\tCurrent")
    for i=1, smua.nvbuffer1.n do
    print(string.format("%g\t%g\t%g",
    smua.nvbuffer1.timestamps[i],
    smua.nvbuffer2[i],
    smua.nvbuffer1[i]))
    end
    end
    Solved!
    Go to Solution.

    Ok, Since I finally am able to use any *.tsp codes onto LV platform with no problem now. For fun, I decided to import KE2651A_Fast ADC Usage.tsp (from Keithley 2651 A example code) onto LV platform using my new TSP_Function Script Loader.vi (updated) as subroutine into KE2651A_Fast ADC Usage.vi along with plots and readable data format for anyone who are interested in learning how to do it.
    This should mimic what TSB (Test Script Builder) program behaves by dumping raw data into output but it can't be manipulated such as graphs, etc like this vi can.
    Enjoy.
    Both VIs are in LV 2011
    KE651A_Fast ADC Usage.vi (main)
    TSP_Function Script Loader.vi (subroutine)
    Attachments:
    KE2651A_Fast ADC Usage.vi ‏117 KB
    TSP_Function Script Loader.vi ‏21 KB

  • 8.1/WLST: Can't get ServerDebug flags in script (can interactively in wlsh)

    When I execute wlsh, I can interactively browse into the "/ServerDebug/servername" tree, do an "ls" and see all the attributes of the ServerDebug object for that server.
    I'm now trying to do the same in a wlst script. I already have a working script that gets the "heapfree" from the server, but I can't seem to get my "serverdebug" script working. I can't seem to find a node named "ServerDebug" (or "ServerDebugs") when I do an "ls()" and try "cd()"ing into various directories.

    yes, akbar is right.
    Although ServerDebugMBean is registered in MBeanServer, it is not displayed/available in WLST, because this mBean is not documented. The mBean's attributes might change in the next release w/o notice. BEA discourages its use.. sorry.
    Thanks,
    -satya

  • Interactive script and Interaction record

    Hello Gurus,
    Is there any places where relationship between interaction record and script which was run for customer is stored? My goal is to see for example how was survey from script field for specific customer.
    BR
    Piotr

    Hi Mohan,
    Both the Interaction record as well as the Service ticket created are stored in CRMD_ORDERADM_H.
    If u want the document flow :
    ->Just enter the transaction no in the object_id field in the above table
    ->U will get the guid no.
    ->Now with this guid u can get all the details via FunctionModule: BAPI_BUSPROCESSND_GETDETAILMUL
    ->And to read the document flow you can use function module:
    CRM_DOC_FLOW_READ_DB
    passing the guid obtained from above table.
    Hope this will help you.
    Thanks and Regards,
    Ashish Patel.

  • Scripting in Interactive form

    Hi,
    I have three radio button in my interactive form, What Javascript code i need to write in order to find out if i have checked a radio button or not.
    Regards,
    Virat

    Hello Virat,
      I am not sure if this helps you or not but you will also need to add in this to your wdDoModify() , where "My_Form" is the name of my interactive form
    // =================
    if(firstTime){
              IWDInteractiveForm iForm = (IWDInteractiveForm)view.getElement("My_Form");
              iForm.setDynamicPDF(true); 
    // =================
    The link provided by Marita is also very useful, particularly the last section on javascripts examples. I will also recommend that you vist the livecycle forum in adobe.com for sample interactive forms to be downloaded.
    from
    Kwok Wei

  • Unix scripts to interact with Windows NT

    Hi,
    I would like to know whether I'll be able to create a program using KOrn shell scripting that can ftp a file from one Unix machine to an NT machine and then it has to run a Java Program in the Windows Environment and in the end,it needs to be ftp -ed back to the Unix machine.
    Is this possible?
    What would be the exact commands to ftp a file from a unix server to a directory on a Windows NT server?
    Also to run the JAVA program in Windows ?
    Are there any tools to make it easier in the market?
    Any idea or solutions are welcome.

    Sounds like your working in a mixed O/S environment.
    From my experience it is probably easier for you to set the job running from NT and have your NT box ftp to your Solaris box, get the JAVA file, run the JAVA file and have the NT box ftp the results back to the Solaris box. This is very easy to configure:
    Create a simple text file called ftp.txt in c:\ on your NT box. Add the following lines:
    ftpaccount
    P4s5W0rD
    lcd c:\where\you\want\the\JAVA\file\to\run\from
    hash
    bin
    cd /dir/with/JAVA/file/in/it
    get JAVAfile
    close
    bye
    Save this text file.
    The first line is the UNIX account you will be logging into on the Solaris box;
    The second line is the password for the UNIX account;
    The third line switches to the local directory on your NT box where you want the JAVA file to sit;
    The fourth line tells ftp to turn on hash marking; the fifth line tells ftp to transfer files in binary mode;
    The sixth line changes to the directory in which your JAVA file is held;
    The seventh line gets the JAVA file (replace JAVAfile with the name of the file)
    The eight line closes the connection to the Solaris box;
    The ninth line ends the ftp utility on NT.
    Create a second txt file called ftp2.txt and add the following commands:
    ftpaccount
    P4s5W0rD
    lcd c:\where\the\results\file\sits
    hash
    bin
    cd /dir/where/results/file/needs/to/be/put
    put resultfilename
    close
    bye
    The first line is the UNIX account you will be logging into on the Solaris box;
    The second line is the password for the UNIX account;
    The third line switches to the local directory on your NT box where the JAVA result file sits;
    The fourth line tells ftp to turn on hash marking; the fifth line tells ftp to transfer files in binary mode;
    The sixth line changes to the directory on the Solaris box in which you want your results file to sit;
    The seventh line puts the results file on the Solaris box;
    The eight line closes the connection to the Solaris box;
    The ninth line ends the ftp utility on NT.
    Now create a bat file to run the ftp-scripts and execute the JAVA file ie ftp.bat. Add the following lines:
    ftp -i -s:"c:\ftp.txt" 10.1.18.208:
    <next line needs to be the DOS command to run the java file on NT ie c:\Temp\DMS0104\jinit11819.exe -s -m>
    ftp -i -s:"c:\ftp2.txt" 10.1.18.208:
    where 10.1.18.208 is the ip address of the Solaris box
    whenever you need to run the script at the command prompt run c:\ftp.bat, or you can schedule it to run using the "at" command.
    If I haven'e explained this very clearly look in BigAdmin scripts or search the net as there are hundreds of examples of ftp scripts.

  • Interacting with labview with my own developed scritpting language.

    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

    Hi Dennis_Knutson
    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.

  • How we can import and run the matlab codes in labview using xmath script.

    hello,
    i have some GUI code in MATLAB and i want to process that codes in labview . tell me about the procedure how we can done this task.
    thanks in advance
    rachana
    Er. (Instrumentation)

    Hello,
    The title of your post asks about using Xmath script.  Is this what you intended?  You can use the Xmath script node in LabVIEW if you have MATRIXx 7.x or earlier installed.  However, the syntax is slightly different from the syntax of The MathWorks, Inc. MATLAB® software.
    In LabVIEW 8.0, we introduced LabVIEW MathScript.  The LabVIEW MathScript syntax is similar to the MATLAB language syntax.  In LabVIEW MathScript, you generally can execute scripts written in the MATLAB language syntax.  However, the MathScript engine executes the scripts, and the MathScript engine does not support some functions that the MATLAB software supports.  In order to reuse code that you have written, open the MathScript Window by going to Tools >> MathScript Window.  You can also use the MathScript node as part of a VI you are writing.  You can find the node on the Programming >> Structures palette.  You can import an existing script by right-clicking the node and selecting "Import..."  You can create inputs and outputs for the script by right-clicking on the node and selecting the appropriate option.  If you wish to call any functions you have written, put them in the MathScript search path.  By default, this is your "My Documents\LabVIEW Data" folder.  In LabVIEW 8.5, you can change the default search path for the main application instance by going to Tools >> Options.
    LabVIEW MathScript does not contain very many GUI functions at this time.  You can use the VI's front panel as your GUI, though, and interact with your program that way.  Let me know if you have other questions about moving your code or about specific functions.
    MATLAB® is a registered trademark of The MathWorks, Inc.
    Grant M.
    Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments

Maybe you are looking for

  • Podcast not showing up in iTunes

    I have a podcast in iTunes called In The Bleachers (http://inthebleachers.net). My problem is that iTunes doesn't keep the episodes listed for long. I released one last thursday and today when I looked for it in iTunes it was gone. Is it because i am

  • How to get tool tip for ALV Contents.

    Hi, I have a ALV list with some data and Icons. When my mouse is on Icon, it should display a info text or tool tip, Any body help me? Best Regards Vinay.

  • Lumia 1520 Sim and MicroSD bay

    Hello, My Yellow 1520's sim and microSD bays are wobley and not secure. Is this common where they kind of wiggle around when you touch them when they are fully installed? I'm not sure if this is a common issue or if it is only unique to mine. If it i

  • Organizing colour mode for print in Illustrator

    Hi, I want to set up my document as a two-colour for print. I'm not really sure what is the correct swatch library to choose, if there is such a thing. Either way, i selected Pantone Solid Uncoated as my swatch library. I chose two colours from this

  • My itunes won't copy new ebooks to my ipad mini, and when i click on my ipad in itunes in my laptop, it has a circle in it and its faded

    i tried adding a new book to my iBooks but then it won't show up in my ipad. that's from my laptop to my iPad min now, when i click my iPad on my iTunes in my laptop, i see the book but it has a circle beside it, and it's sort of faded, it didn't cop