element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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
  • Settings
On the Line
  • Challenges & Projects
  • Design Challenges
  • On the Line
  • More
  • Cancel
On the Line
Forum Green Brain - Part V - LabView visualisation
  • News
  • Projects
  • Forum
  • DC
  • Leaderboard
  • Files
  • Members
  • More
  • Cancel
  • New
Join On the Line to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 0 replies
  • Subscribers 36 subscribers
  • Views 36 views
  • Users 0 members are here
  • NI LabVIEW
  • On The Line
  • json
  • http
  • uno q
Related

Green Brain - Part V - LabView visualisation

saramic
saramic 4 days ago

 had never heard of NI LabVIEW before this challenge but after watching some overviews and tutorials it is clearly an industry standard, so I thought I would give it a go.

Recap

Green Brain Herb is the idea of tracking plant nodes via an industrial CAN bus

  • Green Brain - Part I - CAN bus introduction
  • Green Brain - Part II - Dev setup
  • Green Brain - Part III - Water Cannon Chaos
  • Green Brain - Part IV - Nodes Well That Ends Well

Connecting to LabVIEW

The UNO Q already runs a Python Flask REST API that serves the live sensor readings as JSON at pollyanna.local:8080/.../nodes:

[{"node":2,"temp":24.5,"hum":61.0,"seq":42,"ok":true,"age":3},
 {"node":3,"temp":23.1,"hum":58.0,"seq":38,"ok":true,"age":1}]

That means LabVIEW just needs to poll an HTTP endpoint — no new code on the hardware side at all.

What I tried — HTTP GET with JSON parsing

LabVIEW has a built-in HTTP Client GET VI under Data Communication → Protocols → HTTP Client. Getting the raw JSON string back from the API worked fine.

The stumbling block was parsing it. LabVIEW’s Unflatten From JSON needs a type input — an array-of-clusters constant whose structure exactly matches the JSON. You build it outside-in: place an Array Constant shell first, then drop a Cluster Constant inside it, then add typed constants for each field with labels matching the JSON keys exactly.

image

I got as far as the HTTP response but hit a type mismatch error:

LabVIEW: (Hex 0xFFFA4723) Type mismatch between JSON and LabVIEW.

The debug approach suggested on the NI forums is to wire the cluster-array constant to Flatten To JSON first and compare its output to the real API response — whatever differs is the mismatch. I ran out of time to track mine down fully, but it is close.

Other ways to connect sensors to LabVIEW

For reference, here is how the options compare — from simplest to most capable:

Approach How Good for
VISA Serial Arduino → USB → LabVIEW VISA Read VI Quick bench work, no network needed
TCP stream UNO Q opens a socket, streams CSV Low latency, one-to-one
HTTP REST LabVIEW polls a URL (what I used) Already have a server running
MQTT UNO Q publishes, LabVIEW subscribes Multiple consumers, buffered
NI DAQmx NI hardware plugs straight in Precision timing, industrial use

For temperature monitoring the timing requirements are relaxed, so all of these work in practice. HTTP polling was the natural fit here since the REST API already existed.

Next

Green Brain - distributed greenhouse control platform

Source

https://github.com/saramic/green-brain

  • Sign in to 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 © 2026 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube