Using Pico Technology Products with NI LabVIEW FAQs and Tips

Post your LabVIEW discussions here
Locked
Hitesh

Using Pico Technology Products with NI LabVIEW FAQs and Tips

Post by Hitesh »

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.

Our topic29591.html">GitHub repository groups examples according to driver and whether they are 32-bit or 64-bit examples. All drivers listed there have 32-bit examples and some 64-bit examples have been added (see also point 9).

3. What files do I need?

For all devices:
  • The dynamic link library (dll) files installed by the PicoSDK (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 create entries for the location of the driver files in the Windows PATH Environment Variable, avoiding the need to copy dll files elsewhere unless it is necessary.

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
    Selecting Call Library Function Node
    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 dialog - Function tab
    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 dialog - Parameters tab
    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
    Call Library Function Block
    Call_Library_Function_block.png (1.08 KiB) Viewed 41770 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 be able to detect 32-bit or 64-bit LabVIEW and automatically call RunBlock functions correctly.

10. How do I handle status code messages?

The driver functions will return status codes (please also refer to this topic42107.html post and API topic26031.html post), some of which indicate an error and some which indicate that a further action is required (e.g. indicating whether USB power or a USB 2.0 connection is being used). Our LabVIEW examples prefix the number with a 5 in a sub-vi so the status code 282 (PICO_POWER_SUPPLY_NOT_CONNECTED) would be shown as 5282. The exception is the status code 0 which is PICO_OK and therefore should not cause an error message to be displayed.

In the above case, check the example to see if the appropriate button has been enabled in order to tell the driver to use USB power or that the device is on a USB 2.0 connection (this will be for USB 3.0 devices).

In other cases, it is worth checking the parameter values being passed to the driver function call and that where appropriate, a button to indicate that a 4-channel device is connected is enabled.

I hope this helps :)
Last edited by AndrewA on Thu Jun 21, 2018 3:58 pm, edited 14 times in total.

Karunen
Advanced User
Advanced User
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am

Re: Using Pico Technology Products with LabVIEW FAQs and Tip

Post by Karunen »

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
Advanced User
Advanced User
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am

Re: Using Pico Technology Products with NI LabVIEW FAQs and

Post by Karunen »

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
VI Properties
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 ... eentrancy/

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

I hope this helps :)
Karunen

Technical Specialist
Pico Technology

Locked