Test and Measurement Forum

Using Pico Technology Products with NI LabVIEW FAQs and Tips

Post your LabVIEW discussions here

Using Pico Technology Products with NI LabVIEW FAQs and Tips

Postby Hitesh » Thu Aug 15, 2013 3:48 pm

Below are some frequently asked questions regarding the National Instruments' LabVIEW examples along with other information. The examples we provide are intended to demonstrate how to call functions from the shared library files (.dll) that are provided in the Software Development Kit (SDK) to perform functions with the devices.

1. Which products do you provide examples for?

We provide LabVIEW examples for all our current Oscilloscopes and Data Loggers. These are available in the Software Development Kit available to download from http://www.picotech.com/downloads

2. Which versions of LabVIEW do you support?

We provide examples saved for LabVIEW 8.5 which should be compatible with later versions.

LabVIEW 9.0 will be required for newer oscilloscope examples that contain a PicoScopeXXXXExampleRapidBlockBulk example as a result of the use of Data Value References.

Please note that our examples have been saved using a 32-bit version of LabVIEW and most have not been tested with a 64-bit version (see also point 9).

3. What files do I need?

For all devices:

  • The dynamic link library (dll) files supplied in the SDK (32- or 64-bit), including the psXXXXWrap.dll files for PicoScope streaming data collection examples

The wrapper dll provides functions as a workaround to the C-style callback functions used to indicate data is ready for collection in streaming mode.

The picoipp.dll file will also be required for oscilloscopes (with the exception of the PicoScope models using the ps2000 and ps3000 drivers).

On 64-bit operating systems you can install both the 32- and 64-bit versions of the SDK using the installers. Both will be create entries for the location of the driver files in the Windows PATH Environment Variable.

For oscilloscopes:

  • The PicoScopeXXXX.llb library file which contains reusable components
  • The example vi file that you wish to use

For Data Loggers:

  • Example vi file

4. Where can I find documentation on the examples?

There may be some information contained in the sub-vi’s or the example vi files. Please also consult the Programmer’s Guide for your product as this contains information on the API function calls and the sequence of how to call them to collect data.

5. Can I control multiple devices?

Yes you can – simply duplicate the library function calls and sub-vi calls but use the handle parameter output from the open unit call for the additional device.

It is also possible to control products from different ranges from a single vi by adding the relevant function call blocks and sub-vi’s from the respective Software Development Kits to your vi file.

6. How do I call a function that isn’t available in the llb/vi file?

A ‘Call Library Function Node’ block can be placed in the block diagram.

  • Right-click in an empty area and select Connectivity -> Libraries & Executables -> Call Library Function Node

    Call_library_function_node.png
    Selecting Call Library Function Node

  • Next double-click the ‘Call Library Function Node’, then browse and select the required dll (in this case the ps3000a.dll for a PicoScope 3000A/B/MSO device) and set the properties as shown below:

    Call_Library_Function.png
    Call Library Function dialog - Function tab


    NOTE: When selecting the dll you can specify it by name (if the SDK has been installed) or by providing the full path to the dll's location as required.

    - The SDK installation sub-directory e.g. C:\Program Files (x86)\Pico Technology\SDK\lib

    - The same directory as the vi files

    - The resource directory in your LabVIEW installation
    e.g. C:\Program Files (x86)\National Instruments\LabVIEW 2013\resource

  • Click on the Parameters tab, and add the information for each of the parameters defined in the Programmer’s Guide (see point 7 regarding data types). Note how the Function prototype changes as parameters are added and changed.

    Call_Library_Function_parameters.png
    Call Library Function dialog - Parameters tab

  • Once this is complete, click ‘OK’; the library block should appear ready for connecting up as shown below:

    Call_Library_Function_block.png
    Call Library Function Block
    Call_Library_Function_block.png (1.08 KiB) Viewed 6749 times

7. How do I map data types?

The data types specified in the Programmer’s Guide are for the C Programming Language. Examples of data types include:

C data type => LabVIEW equivalent

  • float => 4-byte single
  • short => Signed 16-bit integer
  • unsigned Long => Unsigned 32-bit integer

8. How do I display the values collected in milliVolts on the y-axis?

The data values are returned in ADC Counts from the driver. Using the maximum ADC Count value for the device (refer to the Programmer’s Guide), use the following formula:

Code: Select all
milliVolts = (adc count/ max. adc count) * voltage range


e.g. if adc count = 16256, max. adc count = 32512 and voltage range = 1000, then milliVolts = 500

These values can then be passed through to a chart or waveform display.

The maximum ADC Count value is usually defined in the Programmer’s Guide or also in the C header file in the SDK.

9. How do I run the examples in 64-bit versions of LabVIEW?

Ensure that you are using the 64-bit SDK installed in order to have the correct version of the dll (and wrapper dll for Oscilloscope Streaming) and that the dlls are loaded in for each function call.

Ensure data types are correct:

  • Unsigned 32-bit Integer for PICO STATUS values.
  • Signed 64-bit Integers for pointers to callback functions and void pointers (e.g. for the call to ps3000aRunBlock).
The function name will need to be re-selected - these should not contain an '@' symbol or have a '-2' suffix.

Note: Pointers to callback functions and void pointers will be found in some of the PicoScope driver API functions.

Examples will be updated in due course to include llb and vi files for 64-bit versions of LabVIEW.

I hope this helps :)
Last edited by Hitesh on Wed May 11, 2016 8:58 am, edited 8 times in total.
Reason: Update to include reference to new SDK installer
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 1997
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Using Pico Technology Products with LabVIEW FAQs and Tip

Postby Karunen » Fri Jun 13, 2014 3:30 pm

Hi all,

I have had a few customers ask me about when you are developing the software,
the application stops before the close VI has been called
and LabVIEW has to be forcibly close before you can run another example.

But If you run the SDK example a couple of times to find out the handle values (should be the same every time),
then copy and paste the close VI at the far left of the example(so that it is the first block called)
and pass the handle value to the close VI on the far left.

This will make sure the device is disconnected as the application starts.

I hope this helps :D

Kind Regards,
Karunen

Technical Specialist
Pico Technology
Karunen
Zen Master
Zen Master
 
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am

Re: Using Pico Technology Products with NI LabVIEW FAQs and

Postby Karunen » Thu Sep 18, 2014 12:09 pm

Hi all,

Some of you may have noticed that if you trying to call two VIs simultaneously they will actually run one after the other.

Now if you open the VI and go to File > VI properties.

If you change the drop down 'Category' from 'General' to 'Execution' you should something similar to the image below

LabVIEW Multiple Execution.png
VI Properties


Then change from 'Non-reentrant execution' to 'Shared clone reentrant execution' then it will share a pool of available memory to allow the VI copies run them simultaneously.

Please note 'Preallocated clone reentrant execution' will allocated a section of memory to each VI copy.

For more information about reentrancy please got to http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/reentrancy/

Please note Pico Technology is not responsible for the content of third party sites.

I hope this helps :)
Karunen

Technical Specialist
Pico Technology
Karunen
Zen Master
Zen Master
 
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am


Return to LabVIEW

Who is online

Users browsing this forum: No registered users and 0 guests