Hi,
I use IWBSENDBYTE and IWBSENDPORT to transfer data over a serial port. But I now have a device which needs binary data and that isn't a problem I simply create a string such as mydata$=CHR$(1)+CHR$(5) etc. and it works perfectly but I have to send a byte with all 8 bits set to zero but it is impossible to put CHR$(0) into the string, I suspect it is the end of string marker. Even using IWSENDBYTE will not send a CHR$(0) byte. I tried various things without success. Does anyone have an idea how I can get this byte with all 8 bits set to zero sent to the com port.
I don't have or use the serial port software, so have no experience of it, but maybe you could just send a NULL?
Brian
Hi Brian,
thanks for the answer though unfortunately as far as I can see IWB doesn't recognise null as any sort of keyword, unlike some languages.
Ian
That's funny, because my current program has a few references to NULL:
hIcon=NULL
IF pDB<>NULL THEN dbDisconnect(pDB)
IF dbName[0]=NULL
IDE Version: 3.05
Compiler Version: 2.095
Brian
My ASCII chart shows zero (0) for NULL.
The command to use is IWSendByte( port, char).
The help example uses:
int port = 5
char oc = 63 'could be 0 instead of 63
if IWSendByte(port,char)
print "success"
end if
This should work. I use to use this library all the time and I too needed to send chr$(0).
Later,
Clint
Hi, thanks for the replies yes I agree null is 0 and I have tried to make a variable equal to it but again it can't be put into any form of string because it is the end of string marker.
I thought I had tried using the IWSendByte and it worked fine for all values other than 0 but I will try it again.