in reply to Re: Win32 Serial Read input from device
in thread Win32 Serial Read input from device

Hello roboticus, I get a n Un-implemented error when I test ran your code. I am using a windows OS win32 modules etc.
  • Comment on Re^2: Win32 Serial Read input from device

Replies are listed 'Best First'.
Re^3: Win32 Serial Read input from device
by roboticus (Chancellor) on Mar 29, 2018 at 04:29 UTC

    PilotinControl:

    Can you give a bit more detail about the error message and/or the changes you made to the code?

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      Exact Error: Time::HiRes::alarm(): unimplemented in this platform at line 87.

        PilotinControl:

        I see, I didn't expect that Time::HiRes was going to vary between platforms. It was just a toy thing anyway. Just remove the "use Time::HiRes" line, and change the setup_serial_interface subroutine to:

        sub setup_serial_interface { #my $seconds_per_transmission = 0.567; my $seconds_per_transmission = 1; $SIG{ALRM} = sub { push @serial_data, rand; alarm $seconds_per_transmission; }; # First packet of data should occur in a couple seconds #alarm 2.5; alarm 3; }

        and it should work just fine for you. (I just made those changes to my local copy and tried it out, it still works here, and shouldn't give you the error you reported.)

        The Time::HiRes was included simply so I could use fractional seconds for the alerts, it wasn't really important.

        ...roboticus

        When your only tool is a hammer, all problems look like your thumb.

      That's the point... I made no changes to the code....copied and pasted the code into notepad....saved it as a perl file...opened in Perl ran the code and got the error