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 Pt3: LabVIEW tryout (b)
  • 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 2 replies
  • Subscribers 211 subscribers
  • Views 600 views
  • Users 0 members are here
  • MP750065
  • function_generator
  • labview
  • scpi
Related

MULTICOMP PRO MP750065 Function Generator - Programming Pt3: LabVIEW tryout (b)

Jan Cumps
Jan Cumps 5 months ago

The 3rd post in this Program the Device series talks about initial LabVIEW integration. An unstructured test to see if I can set up a meaningful conversation with the instrument.
It's the follow up of Programming Pt2: LabVIEW tryout (a).
For the MP750668, UTG900C-II, UTG1010 owners: this will very likely work for you too.


image: 2nd half of the functional flow. Click to enlarge

In this I resume where the previous one ended, showing how to read the current frequency and close the session. 

In a next post, I'll break this flow up in the traditional 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, ...)

Full LabVIEW Flow (part b)

You can see the full process in the header of the previous post. There are two remaining activities

Read Current Frequency

API function: uci_ReadX()


image: read the frequency that the instrument is currently set to

The left block is again a Call Library Function block on the right side, now configured for dll function uci_ReadX(). I will not repeat the inputs and outputs we see in each block.
The two parameters I want to highlight are the command string and return value size.
The command is a literal constant now. The same one I used in post 1, to read channel 0's frequency. When I build the driver, I will parameterise the channel number. Some UCI capable instruments have two channels.
The response size is set to 8. That's the number of bytes returned by this call, in the documentation.

On the output side, you see a construct to translate the 8 bytes reply array to a double.
First the array is flattened, so that it becomes a 4 byte string. Then the byte order is swapped for endianness.
Finally, this reversed byte string is type-cast into a double that you can show on the LabVIEW front panel.


image: front panel, with the frequency that we just read in orange

Close the Session

API function: uci_Close()

image: session and resource cleanup

The tail end of this test flow closes the session. This releases the USB handle we're using.
DLL resources are freed, and other programs can now access the instrument again.
The only input is the active session, that's been passed through the flow from the very first block on.
The session is no longer valid  after this call. If you want to submit new commands, you need to reopen the instrument.

In action:

You don't have permission to edit metadata of this video.
Edit media
x
Upload Preview

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
  • Jan Cumps
    Jan Cumps 5 months ago

    youtube isn't collaborating. I can see the video in my creator console, but playback proper fails.

    Here's a direct upload:

    You don't have permission to edit metadata of this video.
    Edit media
    x
    Upload Preview

    • Cancel
    • Vote Up 0 Vote Down
    • Reply
    • Cancel
  • Jan Cumps
    Jan Cumps 5 months ago

    next post creates the first Virtual Instrument blocks:  MULTICOMP PRO MP750065 Function Generator - Programming Pt4: LabVIEW Driver Lib Init block

    • Cancel
    • Vote Up 0 Vote Down
    • Reply
    • Cancel
element14 Community

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