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

    Serail ID of /dec/tttACM0 using io.openport

    Mervis
    2
    2
    789
    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áček 1 Reply Last reply Reply Quote 0
      • Martin Kudláček
        Martin Kudláček administrators @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
        • First post
          Last post