Search
  • Sign Up
  • Sign In

Grasshopper

algorithmic modeling for Rhino

  • Home
    • Members
    • Listings
    • Ideas
  • View
    • All Images
    • Albums
    • Videos
    • Architecture Projects
    • Installations
    • Add-ons
  • Download
    • Rhino 7 w/Grasshopper
    • Add-ons
  • Forums/Support
    • Current Discussions
    • Legacy Forum
  • Learn
    • Getting Started
    • Online Reference
    • API documentation
    • Video Tutorials
    • Common Questions
    • Scripting and Coding
    • Books and Articles
  • Attend
  • My Page

Search Results - 福建体育彩票11选5『9TBH·COM』双色球红球图谜 排行榜2023年3月19日5时19分26秒.H5c2a3.cb8rgr5wb

Comment on: Topic 'Appending data to DA.SetDataList()'
complicated than it seems as I have an event and a subscriber method receiving data from a serial port. In the code below, the strings received within myReceivedLines appear when connecting with the serial port (when connecttodevice is true). However they disapear when I launch another command (when homeallis true).   As you recommended in your reply, I have added the field called myReceivedLineswithin the class so that I could use the method String.Add() to all the feedback received and commands sent.   Why does the feedback dispear when a command is sent? Is the string going to myReceivedLine disappearing because they happen within a subscriber method or is it related to the DA.SetDataList() method used to assign myReceivedLinesto the output?   Many thanks!     public class SendToPrintComponent : GH_Component { //Fields List<string> myReceivedLines = new List<string>(); SerialPort port; //subscriber method for the port.DataReceived Event private void DataReceivedHandler(object sender, System.IO.Ports.SerialDataReceivedEventArgs e) { SerialPort sp = (SerialPort)sender; while (sp.BytesToRead > 0) { try { myReceivedLines.Add(sp.ReadLine()); } catch (TimeoutException) { break; } } } protected override void SolveInstance(IGH_DataAccess DA) { //Opening the port if (port == null) { string selectedportname = default(string); DA.GetData(1, ref selectedportname); int selectedbaudrate = default(int); DA.GetData(2, ref selectedbaudrate); //Assigning an object to the field within the SolveInstance method() port = new SerialPort(selectedportname, selectedbaudrate, Parity.None, 8, StopBits.One); //Enables the data terminal ready (dtr) signal during serial communication (handshaking) port.DtrEnable = true; port.WriteTimeout = 500; port.ReadTimeout = 500; } //Event Handling Method bool connecttodevice = default(bool); DA.GetData(3, ref connecttodevice); if (connecttodevice == true) { if (!port.IsOpen) { port.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler); DA.SetDataList(0, myReceivedLines); port.Open(); } } else if (port.IsOpen) { port.DataReceived -= new SerialDataReceivedEventHandler(DataReceivedHandler); port.Close(); } if (port.IsOpen) { DA.SetData(1, "Port Open"); } //If the port is open do all the rest if (port.IsOpen) { bool homeall = default(bool); DA.GetData(5, ref homeall); //Home all sends all the axis to the origin if (homeall == true) { port.Write("G28" + "\n"); myReceivedLines.Add("G28" + "\n"); DA.SetDataList(2, myReceivedLines); } } else { DA.SetData(1, "Port Closed"); } }}…
Added by Arthur Mamou-Mani at 8:58am on October 16, 2012
Page: Example files
edit 29/04/14 - Here is a new collection of more than 80 example files, organized by category: KangarooExamples.zip This zip is the most up to date collection of examples at the moment, and collects t
Added by Daniel Piker to Kangaroo at 10:33am on July 2, 2011
Blog Post: VisualARQ to Studio 3DX by Parametricos

This tutorial is to explain the ease of exporting VisualARQ's BIM designs from Rhino 3D and uploading them to …

Added by Marios Messios at 11:27am on April 4, 2020
  • 1
  • 2
  • 3
  • 4
  • 5

About

Scott Davidson created this Ning Network.

Welcome to
Grasshopper

Sign Up
or Sign In

Translate

Search

Photos

  • SubD TriRemesh

    SubD TriRemesh

    by Parametric House 0 Comments 0 Likes

  • Scaled Voronoi

    Scaled Voronoi

    by Parametric House 0 Comments 0 Likes

  • optimized ruins

    optimized ruins

    by lost in wires 1 Comment 1 Like

  • optimized ruins

    optimized ruins

    by lost in wires 0 Comments 0 Likes

  • Random Vector Lines

    Random Vector Lines

    by Parametric House 0 Comments 0 Likes

  • Add Photos
  • View All
  • Facebook

Videos

  • SubD TriRemesh

    SubD TriRemesh

    Added by Parametric House 0 Comments 0 Likes

  • Scaled Voronoi

    Scaled Voronoi

    Added by Parametric House 1 Comment 0 Likes

  • Image-to-3d Workflow using OpenAI Shap-E and Rhino

    Image-to-3d Workflow using OpenAI Shap-E and Rhino

    Added by kgm 0 Comments 1 Like

  • Random Vector Lines

    Random Vector Lines

    Added by Parametric House 0 Comments 0 Likes

  • Text-to-3d-to-AR Workflow using OpenAI Shap-E and Rhino AR

    Text-to-3d-to-AR Workflow using OpenAI Shap-E and Rhino AR

    Added by kgm 0 Comments 0 Likes

  • Pufferfish Net On Surface

    Pufferfish Net On Surface

    Added by Parametric House 0 Comments 0 Likes

  • Add Videos
  • View All
  • Facebook

© 2023   Created by Scott Davidson.   Powered by Website builder | Create website | Ning.com

Badges  |  Report an Issue  |  Terms of Service