element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Test & Tools
  • Technologies
  • More
Test & Tools
Forum MULTICOMP PRO MP750065 Function Generator - Programming Pt5: LabVIEW Driver Lib Read, Write and Close blocks
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Test & Tools requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 0 replies
  • Subscribers 207 subscribers
  • Views 278 views
  • Users 0 members are here
  • MP750065
  • function_generator
  • labview
  • scpi
Related

MULTICOMP PRO MP750065 Function Generator - Programming Pt5: LabVIEW Driver Lib Read, Write and Close blocks

Jan Cumps
Jan Cumps 4 months ago

In this 5th post in this Program the Device series I develop a Virtual Instrument Read, Write and Close block.
It's the follow up of MULTICOMP PRO MP750065 Function Generator - Programming Pt4: LabVIEW Driver Lib Init block.
For the MP750668, UTG900C-II, UTG1010 owners: this will very likely work for you too.

       

I'm designing LabVIEW Virual Instrument blocks (Init, Close, basic Read and Write, and some advanced blocks to set and get favourite values, e.g. Set Freq, Get Freq, Set Waveform, ...)
The previous post, with the first block, was detailed. In this one I'm flying over the designs.

Read block design

Read a setting from the instrument.

In post #2 I used the raw uci_ReadX() api call. This block does the same, and transforms the dll errors into LabVIEW errors.

The inputs are the same:

  • session in: handle to an open device session
  • timeout in

The outputs have one signal less. The DLL error handling is no longer a status you have to check for.
It's encapsulated and becomes part of the error signal. It's separately handled in the Error block that I describe below.

  • session out: a pass-through of to the UCI session. 
  • data out: the raw 8 bit 
  • timeout out: a pass-through of the input value.


In a design, this is how you'd use this (The double out block will be documented in the next post, but you can see how it works in post #2):

All rp@ calls return a 8 bit array that represents a double.
Some other calls (such as IDN? that returns a 54 char string) return a different output.

Write block design

Change a setting on the instrument.

In post #2 I used the raw uci_WriteSimple() api call. This block does the same, and transforms the dll errors into LabVIEW errors.

The inputs are the same:

  • session in: handle to an open device session
  • command string that includes channel, parameter and value, all correctly formatted please
  • timeout in

The outputs have one signal less. The DLL error handling is no longer a status you have to check for.
It's encapsulated and becomes part of the error signal. It's separately handled in the Error block that I describe below.

  • session out: a pass-through of to the UCI session.
  • timeout out: a pass-through of the input value.

In a design, this is how you'd use this:

Close block design

Close the active instrument session, close all handles and release memory.
Call this at the end of your flow, to allow other programs to use the instrument.

In post #2 I used the raw uci_Close() api call. This block does the same, and transforms the dll errors into LabVIEW errors.

The input is the same:

  • session in: handle to an open device session

In a design, this is how you'd use this:

What you can see in each of these blocks, is that I was able to reuse the dll-to-LabVIEW error handling block in all of my new blocks.
This is an efficiency booster during design and test. Once that block is known to work correctly, you can just rely on it and save brain space.

Here's a flow that uses all of these blocks:

Next post: the high level functional blocks that know how to talk to a channel and understand the instrument's registers.

Related blog:

MULTICOMP PRO MP750065 Function Generator - 1st impressions
Programming Pt1: SDK Demo
Programming Pt2: LabVIEW tryout (a)
Programming Pt3: LabVIEW tryout (b)
Programming Pt4: LabVIEW Driver Lib Init block
Programming Pt5: LabVIEW Driver Lib Read, Write and Close blocks
Programming Pt6: LabVIEW Driver Lib: High Level Functional blocks
  • Reply
  • Cancel
  • Cancel
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube