2651 a conversion of TSP Script for LabVIEW

Hello

I have a problem on the conversion of all TSP scripts that contain functions and appeal for the end loops. I'm new to the TSP with models of trigger scripts. I used the Script Builder (TSB) Test tool and am able to run any TSP and generate raw data, but I don't seem able to convert most of the codes in the command of LabVIEW VISA or loader LV TSP TSP and run it to generate data... I can't find any tutorial or examples how to do it.

Let's say that... Use the example of KE2651A_Fast_ADC_Usage.tsp (pulse) and I'll just focus on the portion of function CapturePulseV (pulseWidth, pulseLimit, pulseLevel, numPulses). I have seen a few examples of LV that says loadscript myscript and close on endscript.  I did a lot of different approaches, and I kept getting errors in particular the print function that I am not able to generate data through LV by to read the data in the buffer to inside the instrument. Some approaches, I have had no errors but no data... Some approaches, I got error-285.

The part of the code TSP pulse that works in TSB is here (I'm not including loadscript and endscript) and what is the RIGHT way to modify the code for LabVIEW and run it and obtain data? Thank you:

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

I finally solved it myself! I first create support shell, according to the documents, but the problem was with functions of scripts but I solved by introducing VISA separate, feature writing and THEN retrieve the data from the instrument directly by VISA buffer read more. I did TSP_Function Script Loader that allows simply copy/paste codes teaspoon (any * .tsp) of: TSB program or incorporated into this type of function and loader.vi, name (parameters), defined by its own pasted script then it will generate RAW files directly in the array of strings that can be broken into pieces or restructured into what you want as for the graphics, etc..

That's all I really need to do, I can do codes of tsp in LV and get the data off of it easily via the function defined. Now, this Loader.VI behaves in the same way that TSB keithley-made program I use.

Here I add Loader.vi Script TSP_Function (in LV 2011 +).

Tags: NI Software

Similar Questions

  • Script for the conversion of the hyperlinks to the buttons?

    Hello!

    Does anyone know if West a script for the conversion of the hyperlinks to buttons with the action of going to the URL with the same URL, which has been used with hyperlink?

    Here it is:

    /* Copyright 2012, Kasyan Servetsky
    November 29, 2012
    Written by Kasyan Servetsky
    http://www.kasyan.ho.com.ua
    e-mail: [email protected] */
    //======================================================================================
    var scriptName = "Convert hyperlinks to buttons - 1.0";
    
    Main();
    
    //===================================== FUNCTIONS  ======================================
    function Main() {
        var hyperlink, source, sourceText, destination, page, arr, outlinedText, gb, button, behavior,
        barodeCount = 0,
        hypCount = 0;
        if (app.documents.length == 0) ErrorExit("Please open a document and try again.", true);
        var startTime = new Date();
    
        var doc = app.activeDocument;
        var layer = doc.layers.item("Buttons");
        var swatch = doc.swatches.item("RGB Yellow");
        var hyperlinks = doc.hyperlinks;
    
        var progressWin = new Window ("window", scriptName);
        progressBar = progressWin.add ("progressbar", undefined, 0, undefined);
        progressBar.preferredSize.width = 450;
        progressTxt = progressWin.add("statictext", undefined,  "Starting processing hyperlinks");
        progressTxt.preferredSize.width = 400;
        progressTxt.preferredSize.height = 30;
        progressTxt.alignment = "left";
        progressBar.maxvalue = hyperlinks.length;
        progressWin.show();
    
        for (var i = hyperlinks.length-1; i >= 0; i--) {
            hyperlink = hyperlinks[i];
            source = hyperlink.source;
            sourceText = source.sourceText;
            destination = hyperlink.destination;
            page = sourceText.parentTextFrames[0].parentPage;
    
            barodeCount++;
            progressBar.value = barodeCount;
            progressTxt.text = "Processing hyperlink " + hyperlink.name + " (Page - " + page.name + ")";
    
            arr = sourceText.createOutlines(false);
            outlinedText = arr[0];
            gb = outlinedText.geometricBounds;
            outlinedText.remove();
    
            button = page.buttons.add(layer, {geometricBounds: gb, name: hyperlink.name});
            button.fillColor = swatch;
            button.fillTint = 50;
            button.groups[0].transparencySettings.blendingSettings.blendMode = BlendMode.MULTIPLY;
            behavior = button.gotoURLBehaviors.add();
            behavior.url = destination.destinationURL;
    
            hyperlink.remove();
            source.remove();
    
            hypCount++;
        }
    
        var endTime = new Date();
        var duration = GetDuration(startTime, endTime);
        progressWin.close();
    
        alert("Finished. " + hypCount + " hyperlinks were convertted to buttons.\n(time elapsed: " + duration + ")", scriptName);
    
    }
    //--------------------------------------------------------------------------------------------------------------------------------------------------------
    function GetDuration(startTime, endTime) {
        var str;
        var duration = (endTime - startTime)/1000;
        duration = Math.round(duration);
        if (duration >= 60) {
            var minutes = Math.floor(duration/60);
            var seconds = duration - (minutes * 60);
            str = minutes + ((minutes != 1) ? " minutes, " :  " minute, ") + seconds + ((seconds != 1) ? " seconds" : " second");
            if (minutes >= 60) {
                var hours = Math.floor(minutes/60);
                minutes = minutes - (hours * 60);
                str = hours + ((hours != 1) ? " hours, " : " hour, ") + minutes + ((minutes != 1) ? " minutes, " :  " minute, ") + seconds + ((seconds != 1) ? " seconds" : " second");
            }
        }
        else {
            str = duration + ((duration != 1) ? " seconds" : " second");
        }
    
        return str;
    }
    //--------------------------------------------------------------------------------------------------------------------------------------------------------
    function ErrorExit(error, icon) {
        alert(error, scriptName, icon);
        exit();
    }
    
  • stop the script with labview

    Let's say that I run a script using the "DIAdem"run script.vi"due to the demand of the user.  Later, the user wants to cancel because it took longer than expected.

    How to stop the script using labview tools?

    Jim

    Hi Jim,.

    It is possible, but not in the way I think you hope.  I don't know any way to end a VBScript script running in the DIAdem of the 'outside '.  If you have been watching DIAdem you could hit the key, but a subsequent application of LabVIEW goes in "Script stack" of DIAdem and does not run until the first VBScript happens naturally.

    Of course, you need to run all your calls of LabVIEW to Sophie in an asynchronous way, or does not.

    If you can do is set up each VBScript that you think you might want to abandon to periodically query a global variable of tiara, say "B9" and end of inside the VBScript if B9 = TRUE.  LabVIEW DIAdem (ToCommand) command interface will stack Script tiara, but variable interface of LabVIEW DIAdem (ToDataSheet) does not work.  If you can "poke" during execution of the first VBScript variable B9 of LabVIEW and influence its behavior, but only if and when this VBScript uses this variable (B9) get bitten.

    Of course, none of this helps if your VBScript is busy waiting for a simple VBScript command to run, and it helps only if your VBScript executes several activities, among which it can interrogate the variable (B9).

    Hope that helps,

    Brad Turpin

    Tiara Product Support Engineer

  • float to bytes conversion using c code in labview

    Mr President, I made the taste of the float to bytes conversion using type cast in labview. now I want that conversion using the code c. means I want to know that how labview can suport code c. farmula node is not suporting my code which is working wel in labwindows. kindly help me on this subject so that my skil can be improved using labview

    The node of the formula as its name suggests is to facilitate the access of the algebraic formulas in text form and uses a C like syntax, but is in no way a fully featured parser/compiler. It supports only a subset of the syntax of C for obvious reasons. Why would you need to implement entire code C in LabVIEW for LabVIEW program supports the same functions and to do it with LabVIEW nodes, you will always have better performance you can get in the formula node.

    If you have real C code you wish to call in LabVIEW you use the node form but create a DLL from it and call it via the node library call.

  • Looking for LabVIEW Automation Engineer, MY

    You are looking for an experienced developer of LabVIEW join our company in Acton MA.

    -develop test suites for manufacturing, to maintain existing programs.

    -develop test/scripts for R & D at the beginning of the product development. Transition to MFG

    mickfla wrote:

    You are looking for an experienced developer of LabVIEW join our company in Acton MA.

    -develop test suites for manufacturing, to maintain existing programs.

    -develop test/scripts for R & D at the beginning of the product development. Transition to MFG

    Wrong forum.

    There is another for posting job opportunities.

    That there are a lot of people who want to work remotely, you can be very specific on-site presence is required.

    In addition, are willing to sponsor a visa or you require someone to be a U.S. citizen or Permanent resident?

  • 3532 HIOKI driver is for labview 5.1 but I have labview 8.5.

    I found HIOKI-3532 driver for labview 5.1 but I have labview 8.5. I got the error message you see in the image below. Is it possible to convert the pilot? All solutions?

    Hi Zancis,

    have you noticed the Version Conversion Board at the top of the forum of LabVIEW?

  • Conversion of a driver to labview labwindows

    http://sine.NI.com/apps/UTF8/niid_web_display.download_page?p_id_guid=E3B19B3E9628659CE034080020E748...

    I try to convert the driver on the link above for labview labwindows (8.5) and I'm doing it via the tools--> instrumentation---> interface VI create driver Instruments LabWindows/CVI.

    If I select "basic" to perform the conversion, I get an error message saying that it is not a file valid .fp or the version of the file is too low.

    On the site he lables the driver as being of labwindows/CVI version 6.0, who worked for before conversions.

    If I select 'Advanced' I notice that although the .h file is present, it is NOT the .sub file.

    My trial version of the CVI has expired, if I uninstall and reinstall I'll be able to generate a .sub file?

    Or is there another way to make the driver work?

    Hello Lars,.

    I saved the CVI 2010 .fp file and now the error disappeared when using the wizard. Attached is a fixed zip file.

    Concerning

    Mart G.

  • How to create own IDE for LABVIEW (such as vision builder)

    Hi all

    My pretty funny question, I know that.

    I like to create Labview Application IDE like Vision Builder.

    How to do this?

    As far as I know that Vision Builder is developed with LabVIEW, the source code of course is not public... But why do you want to create a new IDE for LabVIEW? LabVIEW is an IDE, no?

    I think also Vision Builder uses a lot of scripts and sub-panels, I can't help you much more than that.

    For us - outside NI - script cannot be used in an EXE file, they reserve that for their applications not it will be a difficult task.

  • script for vmware?

    is there currently a script to run the conversion at a certain time of the day, I use this option to save and can not have running at certain times because it slows down users because of what, in my view, the problem is, IO, if I want to run this after hours of work, including at - it script for this Thank you!

    Double post, not necessary (see here).

    Franck

  • Support for LabVIEW 2016

    Can someone tell me what VirtualBench drivers will be available for LabVIEW 2016?

    Release date is... right now! NOR-VirtualBench 16.0, with the help of LabVIEW 2016, is available here:

    (My apologies for yesterday, does not but it takes a little while to download pages to go live.)

  • Mode script for ANY c ++ function

    Hi all

    My goal was to use the pxi 5406 to implement features of frequency sweep. Right now, we use only the functions on the list of the frequencies of creation. There are four modes of release for the frequency list, signle, continuous, step by step and burst. We use the bleachers through fashion. It is painful to use this mode, since for each frequency, you need to send a rising edge, so if I have several hundred, it means I have to produce this amount of rising edges. This will generate a lot of buffer in another analog card.

    My question is, could I use script for the frequency list view? Or is there a smart way to achieve this? From the file of signal aid, he said that there are some c programe on script mode. But I can't find any examples in my computer. If you have any other, could you send me?

    Thank you very much.
    .

    Yami.

    Yami,

    The 5406 has the ability to run script mode. Only for her output modes are Standard function and frequency list. However, I believe that you can do what you want to do with the list mode frequencies. Assuming that you do not want to trigger you can put the camera in single or continuous Mode. Single will play your select frequency scan and then once completed, build:

    Continuous is similar, but you continue to repeat the signals to stop:

    All the above details are in aid of signal generators of NOR. I looked under the heading devices > 5406 > trigger > triggering Modes.

    With simple or continuous, you can specify the length of the waveform step, which could be a good starting point. With regard to the examples for c ++, I do not have, but if you look in the Start Menu, NOR-FGEN, National Instruments, examples, OR-FGEN C examples you can find a folder for "Sweep generator", there is a model and an example C you can look over your program after. I hope this helps!

  • Support of NOR-DNET for LabVIEW 2013

    We currently use OR DNET 1.6.6 with LabVIEW 2011. I installed LabVIEW 2013 now also on my computer and tried to synchronize all of the drivers with my installation of LabVIEW 2011.

    Well, it seems that NEITHER-DNET does not support LabVIEW 2013, at least officially. compatibility of Version of LabVIEW and NOR-DNET indicates that NEITHER-DNET 1.6.6 supports 2011 NOR-DNET 1.6.7 2012 LabVIEW and LabVIEW.

    The list NOR system driver November 2013 set OR DNET 1.6.7 defined pilot. When I try to install it, there is no support for LabVIEW 2013.

    My question is, if there is a plan to include support OR DNET for LabVIEW 2013 or later in the game to pilot?

    I copied the directories vi.lib\DeviceNet and vi.lib\nidnet of LabVIEW 2011-2013 and I can load my programs without any problems. I always did not build an executable and does not run on the test set-up, but projects can be loaded in LabVIEW 2013 without any screws of brocken. should I expect any problems running LabVIEW 2013 with the NOR-DNET to 1.6.6 and 1.6.7 driver?

    Nick

    There should not be problems but it is a former pilot, we will not be updated for the future version of labview.

  • Is there a Module NXT for LabVIEW 2010

    Is there a Module NXT for LabVIEW 2010?  If not, are there plans to bring a available and if so, when?

    Hello

    I found a link to a download for the module 2010 here.

    I hope this helps.

  • How to convert the file with VI for LabView .lib to CVI?

    Hello

    I have the .lib file for my lock in the amplifier. The lib file is written for labView and already contains a visual interface (like ActiveX). The point is that I need this file for programming in CVI (8.5). How can I convert a LabView ICB .lib?

    Thank you.

    Denis.

    You said that you had a .lib file and in fact you have an llb file. There is a huge difference between an "i" (eye) and a 'l' (ell).

    There is a LabVIEW Instrument Driver Export Wizard but it's only for new pilots of project lifestyle and you need LabVIEW. There is no other way to convert a LabVIEW driver to a driver of the CVI. If the LabVIEW driver uses methods and properties of the ActiveX, you will need to write the same thing in CVI.

  • What type of support for labview usb protocols?

    Hello guys I want to connect a device to your pc via a usb port and I want to use labview to analyze the data.

    But first of all, I would like to know what usb protocols support for labview.

    USB, USB CDC and other TMC?

    I ve read labview recognizes a raw device to the usb, but what is? Is it VI to read and send data, or I have to do? If these VI exists, they do the handshake? flow control?

    Thank you.

    Please read the chips and have a look at the USB specification (it is linked to in the nuggets).

    TMC, CDC, MAss Storage are all built on the basic USB protocols.

    LabVIEW has no built-in support for one of these classes of devices except Test and measurement.

    Shane

Maybe you are looking for

  • Can I string my new imac to 2015 to my imac 2007. What cable should I use (read: I'm illiterate cable).

    Can I string my new iMac to 2015 to my iMac 2007. What cable should I use (read: I'm illiterate cable).

  • TouchSmart 600-1040nl

    I have this Touchsmart 600-1040. He got very dusty over time. I have many would like to do is open the case to own fans and carefully the cooling fins. So, how can I open the case? Thank you. Wim Kreuger

  • Forum of Multisim

    Use da un anno Multisim 10.1, simulando diversi hydraulic means. ORA improvvisamente non riesco più ad utilizzare he comando 'place' by piazzare nuovi nello schema components (it comando e sbiadito device) quindi non utilizzabile), Posso cosa fare by

  • RAW and JPG

    I want to know what is the difference between RAW and JPG format?

  • I want to buy clip + and have several questions

    is it possible to recharge without usb cable and computer, but a simple reload you have with your mobile phone? is - it really last 15 hours battery? the sound is as good as people say?