element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
  • Settings
NI LabVIEW Community
  • Products
  • Dev Tools
  • NI LabVIEW Community
  • More
  • Cancel
NI LabVIEW Community
NI Forum Getting error when running with custom firmware on pico with labview
  • Blog
  • LabVIEW Challenge Blogs
  • Forum
  • Documents
  • Quiz
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join NI LabVIEW Community to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 33 replies
  • Subscribers 124 subscribers
  • Views 3933 views
  • Users 0 members are here
  • LabVIEW and Test Automation Course
  • pico
  • labview
Related

Getting error when running with custom firmware on pico with labview

cbohra00627
cbohra00627 over 1 year ago

I am trying to create a labview driver for controlling the pi pico led. I went through the Digital Out Control.vi VI in pico_scpi_usbtmc_labtool and tried to replicate it for the led control. I took the blink example from pico-sdk examples directory and added the function to control led (i.e. gpio_put(LED_PIN, 1)) to the SCPI_DigitalOutput() function of gpio_utils.c file in pico_scpi_usbtmc_labtool. I created a new firmware with this change and loaded on pi pico. Now, whenever I do digital write HIGH, the led is turning on.

But when I tried to create a separate driver for led control with a separate SCPI command, I am getting some error while running the VI. The build was successful with my change and I loaded the firmware on the pico, but when I am trying to run my VI (snip attached below), I am getting the below error.

image

Code for led control:

led_utils.c:

image

led_utils.h

image

I have added the led executable and dir path to Cmakelists.txt and also added the INSTRUMENT_LED_OUTP_COMMANDS macro to scpi commands list in scpi-def.c

Am I missing something? Has anyone seen this error before?

  • Sign in to reply
  • Cancel

Top Replies

  • Andrew J
    Andrew J over 1 year ago +4
    This is failing in the init code, so it’s not even reaching your code. One of the installed tools with LabVIEW is NI I/O Trace. Run that, turn on tracing, then run the VI again and see if that gives you…
  • cbohra00627
    cbohra00627 over 1 year ago in reply to Jan Cumps +3
    Its working now!
  • Jan Cumps
    Jan Cumps over 1 year ago in reply to Andrew J +2
    The init block indeed checks for the IDN* string I haven't exposed the connectors to the button that can turn ID Check off. You can do this yourself, by clicking on the connector location in the…
Parents
  • Andrew J
    0 Andrew J over 1 year ago

    This is failing in the init code, so it’s not even reaching your code.  One of the installed tools with LabVIEW is NI I/O Trace.  Run that, turn on tracing, then run the VI again and see if that gives you a clue to what is happening.  Also, don’t be afraid of putting a breakpoint on a wire and turning on the lightbulb, then single stepping though the code, probing wires to see values.  Sorry, I’m not at home right now so I’m talking from memory rather than with LabVIEW in front of me.

    I have seen his problem myself: the SCPI ID command would work with NI Visa Interactive Panel but not with my own Visa write.  Turned out that the string command I was sending, “*IDN?\n” was treating the “\n” as two characters and not a control character (new line).  The fix was to right click the string constant and make sure the “display \ codes” option was selected.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Andrew J
    0 Andrew J over 1 year ago

    This is failing in the init code, so it’s not even reaching your code.  One of the installed tools with LabVIEW is NI I/O Trace.  Run that, turn on tracing, then run the VI again and see if that gives you a clue to what is happening.  Also, don’t be afraid of putting a breakpoint on a wire and turning on the lightbulb, then single stepping though the code, probing wires to see values.  Sorry, I’m not at home right now so I’m talking from memory rather than with LabVIEW in front of me.

    I have seen his problem myself: the SCPI ID command would work with NI Visa Interactive Panel but not with my own Visa write.  Turned out that the string command I was sending, “*IDN?\n” was treating the “\n” as two characters and not a control character (new line).  The fix was to right click the string constant and make sure the “display \ codes” option was selected.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • Jan Cumps
    0 Jan Cumps over 1 year ago in reply to Andrew J

    The init block indeed checks for the IDN* string

    image

    I haven't exposed the connectors to the button that can turn ID Check off.

    You can do this yourself, by clicking on the connector location in the Icon, then selecting the control

    image

    If you write firmware with a different ID string, you should also create a driver and  adapt that Init block to your ID:

    image

    I'll take care that the PST driver is updated to exposes these 2 connecters (set as  optional):

    image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jan Cumps
    0 Jan Cumps over 1 year ago in reply to Andrew J

    (side note):

    In the next version, the *IDN? will have the unique pico id:

    image

    The LabVIEW driver checks the first two partameters only, so it's backward compatible (and I tested it Slight smile)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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 © 2025 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

  • X
  • Facebook
  • linkedin
  • YouTube