Re: [Gambas-user] Serial port data being changed ????

2009-12-09 Thread Les Hardy
Benoît Minisini wrote:

 
 I'm not a serial port user at all, and I find that behaviour a bit strange.
 
 Would it be useful to make a property for that? Or maybe it does already 
 exist 
 in the SerialPort class, and I didn't see it.
 

Nothing strange really. Its been like that as long as I can remember.
It is not possible to tranfer binary data correctly without setting the
icrnl and ocrnl flags off.

Its been a long time since I was near C, but I'm fairly sure they are
included in termios.h, and are the c_iflag and c_oflag.

(sent this twice. mail is bouncing back)








--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial port data being changed ????

2009-12-08 Thread Les Hardy


mike wrote:
 I'm having trouble with Gambas and the serial ports.
 Something is changing binary h0d to h0a when received
 from a serial port. I noticed it in a program that I've
 been working on that receives packets of binary data
 from a microprocessor. I wrote a little test program to
 demonstrate the problem and have included it below. I also
 reprogrammed the micro to simply send h0d as long a
 pushbutton is held depressed. I have verified that the
 correct data is indeed being sent using CuteCom to display
 the binary data.
 An interesting thing that I noticed when I ran CuteCom to
 test the data being received is that if I close CuteCom without
 closing the serial port first then run my Gambas program, it works
 fine until I restart the system. If I close the port before closing
 CuteCom then my Gambas program fails.
 
 
 This is the code for the test program.
 
 ' Gambas class file
 ' Using Gambas 2.18 on a system running
 ' Fedora Kernel (26.30.9-102.fc11.x86_64)
 ' It also fails running Gambas 2.11
 ' on my laptop running
 ' Fedora Kernel (2.6.27.25-78.2.56.fc9.i686)
 
 PUBLIC SUB Form_Open()
 
ME.Center
 
 ' Setup the serial port - 9600,8,N,1
 
 '  SerPort1.PortName = /dev/ttyS0 ' Both ports fail
SerPort1.PortName = /dev/ttyUSB0' This the port I'll eventually use
SerPort1.Speed = 9600   ' because the laptop has no 
 serial port.
SerPort1.DataBits = 8
SerPort1.Parity = 0
SerPort1.StopBits = 1
SerPort1.Open
 
TextArea1.Text = SerPort1.PortName  Chr$(10)
 END
 
 PUBLIC SUB SerPort1_Read()
 
 ' A microprocessor is connected to the serial port and
 ' continuously sends h0d (CR) as long a push button is held down.
 
 DIM InByte AS Byte
 
READ #SerPort1, InByte
TextArea1.Insert(Hex$(InByte)   )
 ' The textarea displays a series of A  (LF) instead of D  (CR)
 END
 
 PUBLIC SUB ExitBtn_Click()
 
SerPort1.Close
QUIT
 END
 
 PUBLIC SUB ClearBtn_Click()
 
TextArea1.Clear
 END



This is a Linux thing. Not Gambas. The icrnl flaf is set as standard.
Easiest way is to use stty to change it.

SHELL stty -F   SerPort1.PortName   -icrnl



--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial port data being changed ????

2009-12-08 Thread Kadaitcha Man
2009/12/8 Les Hardy l...@webmayo.com:

 This is a Linux thing. Not Gambas.

Linux has a lot of things. I learned the hard way that localhost
TCP/IP ports below 1024 are protected. Sheesh. I lost a full day to
that. Today I lost several hours to Gambas behaviour that is expained
by bugs in Qt3.

Nevertheless your point is valuable. I'm going to mark your Linux
thing for inclusion in the documentation. Of course, I first have to
figure out if icrnl flaf is a typo or an esoteric command line :)

--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial port data being changed ????

2009-12-08 Thread Les Hardy
Kadaitcha Man wrote:
I first have to figure out if icrnl flaf is a typo or an esoteric 
command line :)
 
Yes, esoteric, makes me feel special. Only a few know about flafs.

Then again, it could just be flag.


--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial port data being changed ???? -- Solved

2009-12-08 Thread mike
Ahh, Thank you. Now I can move on to finish my project.

snip

 This is a Linux thing. Not Gambas. The icrnl flaf is set as standard.
 Easiest way is to use stty to change it.

 SHELL stty -F   SerPort1.PortName   -icrnl



 --
 Return on Information:
 Google Enterprise Search pays you back
 Get the facts.
 http://p.sf.net/sfu/google-dev2dev
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user



--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial port data being changed ????

2009-12-08 Thread Benoît Minisini
 mike wrote:
  I'm having trouble with Gambas and the serial ports.
  Something is changing binary h0d to h0a when received
  from a serial port. I noticed it in a program that I've
  been working on that receives packets of binary data
  from a microprocessor. I wrote a little test program to
  demonstrate the problem and have included it below. I also
  reprogrammed the micro to simply send h0d as long a
  pushbutton is held depressed. I have verified that the
  correct data is indeed being sent using CuteCom to display
  the binary data.
  An interesting thing that I noticed when I ran CuteCom to
  test the data being received is that if I close CuteCom without
  closing the serial port first then run my Gambas program, it works
  fine until I restart the system. If I close the port before closing
  CuteCom then my Gambas program fails.
 
 
  This is the code for the test program.
 
  ' Gambas class file
  ' Using Gambas 2.18 on a system running
  ' Fedora Kernel (26.30.9-102.fc11.x86_64)
  ' It also fails running Gambas 2.11
  ' on my laptop running
  ' Fedora Kernel (2.6.27.25-78.2.56.fc9.i686)
 
  PUBLIC SUB Form_Open()
 
 ME.Center
 
  ' Setup the serial port - 9600,8,N,1
 
  '  SerPort1.PortName = /dev/ttyS0 ' Both ports fail
 SerPort1.PortName = /dev/ttyUSB0' This the port I'll eventually
  use SerPort1.Speed = 9600   ' because the laptop has no
  serial port.
 SerPort1.DataBits = 8
 SerPort1.Parity = 0
 SerPort1.StopBits = 1
 SerPort1.Open
 
 TextArea1.Text = SerPort1.PortName  Chr$(10)
  END
 
  PUBLIC SUB SerPort1_Read()
 
  ' A microprocessor is connected to the serial port and
  ' continuously sends h0d (CR) as long a push button is held down.
 
  DIM InByte AS Byte
 
 READ #SerPort1, InByte
 TextArea1.Insert(Hex$(InByte)   )
  ' The textarea displays a series of A  (LF) instead of D  (CR)
  END
 
  PUBLIC SUB ExitBtn_Click()
 
 SerPort1.Close
 QUIT
  END
 
  PUBLIC SUB ClearBtn_Click()
 
 TextArea1.Clear
  END
 
 This is a Linux thing. Not Gambas. The icrnl flaf is set as standard.
 Easiest way is to use stty to change it.
 
 SHELL stty -F   SerPort1.PortName   -icrnl
 

I'm not a serial port user at all, and I find that behaviour a bit strange.

Would it be useful to make a property for that? Or maybe it does already exist 
in the SerialPort class, and I didn't see it.

-- 
Benoît Minisini

--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial port data being changed ????

2009-12-08 Thread Ron
Benoît Minisini schreef:
 mike wrote:
 
 I'm having trouble with Gambas and the serial ports.
 Something is changing binary h0d to h0a when received
 from a serial port. I noticed it in a program that I've
 been working on that receives packets of binary data
 from a microprocessor. I wrote a little test program to
 demonstrate the problem and have included it below. I also
 reprogrammed the micro to simply send h0d as long a
 pushbutton is held depressed. I have verified that the
 correct data is indeed being sent using CuteCom to display
 the binary data.
 An interesting thing that I noticed when I ran CuteCom to
 test the data being received is that if I close CuteCom without
 closing the serial port first then run my Gambas program, it works
 fine until I restart the system. If I close the port before closing
 CuteCom then my Gambas program fails.


 This is the code for the test program.

 ' Gambas class file
 ' Using Gambas 2.18 on a system running
 ' Fedora Kernel (26.30.9-102.fc11.x86_64)
 ' It also fails running Gambas 2.11
 ' on my laptop running
 ' Fedora Kernel (2.6.27.25-78.2.56.fc9.i686)

 PUBLIC SUB Form_Open()

ME.Center

 ' Setup the serial port - 9600,8,N,1

 '  SerPort1.PortName = /dev/ttyS0 ' Both ports fail
SerPort1.PortName = /dev/ttyUSB0' This the port I'll eventually
 use SerPort1.Speed = 9600   ' because the laptop has no
 serial port.
SerPort1.DataBits = 8
SerPort1.Parity = 0
SerPort1.StopBits = 1
SerPort1.Open

TextArea1.Text = SerPort1.PortName  Chr$(10)
 END

 PUBLIC SUB SerPort1_Read()

 ' A microprocessor is connected to the serial port and
 ' continuously sends h0d (CR) as long a push button is held down.

 DIM InByte AS Byte

READ #SerPort1, InByte
TextArea1.Insert(Hex$(InByte)   )
 ' The textarea displays a series of A  (LF) instead of D  (CR)
 END

 PUBLIC SUB ExitBtn_Click()

SerPort1.Close
QUIT
 END

 PUBLIC SUB ClearBtn_Click()

TextArea1.Clear
 END
   
 This is a Linux thing. Not Gambas. The icrnl flaf is set as standard.
 Easiest way is to use stty to change it.

 SHELL stty -F   SerPort1.PortName   -icrnl

 

 I'm not a serial port user at all, and I find that behaviour a bit strange.

   

Me too.

I have build serial support for about 10 different hardware devices in 
my Gambas project both binary and ASCII and didn't stumble upon this 
strange behavior (yet?)

Regards,
Ron_2nd.


--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial port data being changed ????

2009-12-08 Thread Doriano Blengino
Ron ha scritto:
 Benoît Minisini schreef:
   
 mike wrote:
 
   
 I'm having trouble with Gambas and the serial ports.
 Something is changing binary h0d to h0a when received
 from a serial port. I noticed it in a program that I've
 been working on that receives packets of binary data
 from a microprocessor. I wrote a little test program to
 demonstrate the problem and have included it below. I also
 reprogrammed the micro to simply send h0d as long a
 pushbutton is held depressed. I have verified that the
 correct data is indeed being sent using CuteCom to display
 the binary data.
 An interesting thing that I noticed when I ran CuteCom to
 test the data being received is that if I close CuteCom without
 closing the serial port first then run my Gambas program, it works
 fine until I restart the system. If I close the port before closing
 CuteCom then my Gambas program fails.


 This is the code for the test program.

 ' Gambas class file
 ' Using Gambas 2.18 on a system running
 ' Fedora Kernel (26.30.9-102.fc11.x86_64)
 ' It also fails running Gambas 2.11
 ' on my laptop running
 ' Fedora Kernel (2.6.27.25-78.2.56.fc9.i686)

 PUBLIC SUB Form_Open()

ME.Center

 ' Setup the serial port - 9600,8,N,1

 '  SerPort1.PortName = /dev/ttyS0 ' Both ports fail
SerPort1.PortName = /dev/ttyUSB0' This the port I'll eventually
 use SerPort1.Speed = 9600   ' because the laptop has no
 serial port.
SerPort1.DataBits = 8
SerPort1.Parity = 0
SerPort1.StopBits = 1
SerPort1.Open

TextArea1.Text = SerPort1.PortName  Chr$(10)
 END

 PUBLIC SUB SerPort1_Read()

 ' A microprocessor is connected to the serial port and
 ' continuously sends h0d (CR) as long a push button is held down.

 DIM InByte AS Byte

READ #SerPort1, InByte
TextArea1.Insert(Hex$(InByte)   )
 ' The textarea displays a series of A  (LF) instead of D  (CR)
 END

 PUBLIC SUB ExitBtn_Click()

SerPort1.Close
QUIT
 END

 PUBLIC SUB ClearBtn_Click()

TextArea1.Clear
 END
   
 
 This is a Linux thing. Not Gambas. The icrnl flaf is set as standard.
 Easiest way is to use stty to change it.

 SHELL stty -F   SerPort1.PortName   -icrnl

 
   
 I'm not a serial port user at all, and I find that behaviour a bit strange.

   
 

 Me too.

 I have build serial support for about 10 different hardware devices in 
 my Gambas project both binary and ASCII and didn't stumble upon this 
 strange behavior (yet?)
   
Could it be that some other process is using the port (getty, mgetty)? 
And that that process programs the serial driver? Because those stty 
things should be related, I think, to terminal devices, not general 
serial drivers as used by pppd, for example.

Just put this way - I really don't know.
Regards,

-- 
Doriano Blengino

Listen twice before you speak.
This is why we have two ears, but only one mouth.


--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial port data being changed ????

2009-12-08 Thread nospam.nospam.nospam
Les Hardy wrote:
 Kadaitcha Man wrote:
 I first have to figure out if icrnl flaf is a typo or an esoteric
 command line :)
 
 Yes, esoteric, makes me feel special. Only a few know about flafs.

lol

 Then again, it could just be flag.

Nah. That'd ruin the whole effect.

--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Serial port data being changed ????

2009-12-08 Thread Mike

   Benoît Minisini wrote:
   snip

This is a Linux thing. Not Gambas. The icrnl flaf is set as standard.
Easiest way is to use stty to change it.

SHELL stty -F   SerPort1.PortName   -icrnl



I'm not a serial port user at all, and I find that behaviour a bit strange.

Would it be useful to make a property for that? Or maybe it does already exist 
in the SerialPort class, and I didn't see it.

  

   If not property setting then at least a reference in the docs to the stty
   thing would have been very helpful.
--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Serial port data being changed ????

2009-12-07 Thread mike
I'm having trouble with Gambas and the serial ports.
Something is changing binary h0d to h0a when received
from a serial port. I noticed it in a program that I've
been working on that receives packets of binary data
from a microprocessor. I wrote a little test program to
demonstrate the problem and have included it below. I also
reprogrammed the micro to simply send h0d as long a
pushbutton is held depressed. I have verified that the
correct data is indeed being sent using CuteCom to display
the binary data.
An interesting thing that I noticed when I ran CuteCom to
test the data being received is that if I close CuteCom without
closing the serial port first then run my Gambas program, it works
fine until I restart the system. If I close the port before closing
CuteCom then my Gambas program fails.


This is the code for the test program.

' Gambas class file
' Using Gambas 2.18 on a system running
' Fedora Kernel (26.30.9-102.fc11.x86_64)
' It also fails running Gambas 2.11
' on my laptop running
' Fedora Kernel (2.6.27.25-78.2.56.fc9.i686)

PUBLIC SUB Form_Open()

   ME.Center

' Setup the serial port - 9600,8,N,1

'  SerPort1.PortName = /dev/ttyS0 ' Both ports fail
   SerPort1.PortName = /dev/ttyUSB0' This the port I'll eventually use
   SerPort1.Speed = 9600   ' because the laptop has no 
serial port.
   SerPort1.DataBits = 8
   SerPort1.Parity = 0
   SerPort1.StopBits = 1
   SerPort1.Open

   TextArea1.Text = SerPort1.PortName  Chr$(10)
END

PUBLIC SUB SerPort1_Read()

' A microprocessor is connected to the serial port and
' continuously sends h0d (CR) as long a push button is held down.

DIM InByte AS Byte

   READ #SerPort1, InByte
   TextArea1.Insert(Hex$(InByte)   )
' The textarea displays a series of A  (LF) instead of D  (CR)
END

PUBLIC SUB ExitBtn_Click()

   SerPort1.Close
   QUIT
END

PUBLIC SUB ClearBtn_Click()

   TextArea1.Clear
END

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user