Jump to content


Photo

Rs232 Dll Question


  • Please log in to reply
2 replies to this topic

#1 lordtez

lordtez

    GMC Member

  • GMC Member
  • 24 posts

Posted 27 September 2009 - 02:04 PM

Hi all. I've tried using the rs232 dll  by andbna. I've created 2  virtual com ports com3 and com4 using a virtual serial emulator. The rs232example that comes with the gex works fine when receiving byte data, but always returns a single letter or number  when reading string data. Any ideas as to what may be causing this problem.
Thanks.

Edited by lordtez, 27 September 2009 - 03:15 PM.

  • 0

#2 deformed thought

deformed thought

    GMC Member

  • GMC Member
  • 104 posts
  • Version:GM7

Posted 30 January 2010 - 07:21 AM

This is not the right forum to be posting questions. Please read the rules of the DLL section.
  • 0

#3 nick1965

nick1965

    GMC Member

  • New Member
  • 88 posts

Posted 17 March 2010 - 10:04 PM

Hi all. I've tried using the rs232 dll by andbna. I've created 2 virtual com ports com3 and com4 using a virtual serial emulator. The rs232example that comes with the gex works fine when receiving byte data, but always returns a single letter or number when reading string data. Any ideas as to what may be causing this problem.
Thanks.


Hey,

I have an idea, though my knowledge of Serial and Ethernet connections is limited.
Probably what is happening is that serial ports are unable to send a large packet, maybe they can only send lets say a single byte. Therefore in your instance, the virtual serial emulator is simulating this, and so won't let you send more than a byte - as you said it worked for perfectly. Therefore try sending the strings as individual bytes, because each character in the string is a single byte. So if you were sending the string "Hello World!" then do the following.

Send a byte with the value 72 which corresponds to the letter "H", then send a byte with the value 101, which corresponds to the letter "e", etc etc. The only problem with this is that you may not be able to distinguish between regular byte values and strings in the form of characters.

And to make this easier, here is a piece of code that would split your string into these bytes.

-------------------
Make this a script, and have argument0 as the string you want to send.
------------------
var a;
a=string_length(argument0);

for(i=0; i<a; i+=1){
SENDPACKET(string_char_at(argument0,i));
}
-----------------
Just replace SENDPACKET with whatever script Andrew's dll is using to send the packets over the serial port.


Hope I helped!
~Nick
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users