• Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Serail ID of /dec/tttACM0 using io.openport

    Scheduled Pinned Locked Moved Mervis & Mervis SCADA
    2 Posts 2 Posters 1.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Steve Vandenbussche
      last edited by Steve Vandenbussche

      Hi,

      I've got an Arduino Uno connected to the USB1 port of my Neuron M203, which is identified as /dev/ttyACM0. How do I open a connection to this device with io.openport(). This function needs a string argument containing the communication parameters: 'serial:6:9600,8,N,1'. Does anyone know where I can find the correct serial ID ?

      edit

      I've connected an usb to serial adapter and then it works with serial ID 10 for /dev/ttyUSB0.
      My code is based on the custom serial protocol example:

      def := 'serial:10:9600,8,N,1';
      handle := io.openport(def);
      
      IF handle >= 0 THEN
         state := 1;
      END_IF;
      

      handle is of type: io.commhandle which is an int. Whether or not io.openport works, it seems that the value of handle is always 0, so testing it makes no sense ?

      Thanks,
      Steve

      Martin KudláčekM 1 Reply Last reply
      Reply Quote 0
      • Martin KudláčekM
        Martin Kudláček @Steve Vandenbussche
        last edited by

        Hello @steve-vandenbussche,
        the serial ID for dynamic ports starts with 100.

        The return value of io.openport() is indeed type io.commhandle and you should be able to get the information whether the port has been opened or not. I will investigate the actual functionality as this looks like it's broken.

        Martin

        1 Reply Last reply
        Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post