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