IonicWind Software

IWBasic => IWB3.x Bug Reports => IW2.0 Bug Reports => Topic started by: RitchieF on September 05, 2012, 07:27:55 AM

Title: IW Serial Lib issue
Post by: RitchieF on September 05, 2012, 07:27:55 AM
Running the example that comes with the serial lib makes no problem.
But adding the IWSetProperties command gives the following message :



Compiling...
IWComtest.iwb
No Errors

Linking...
IWBasic Linker v1.11 Copyright © 2011 Ionic Wind Software
Unresolved external IWSetProperties
Error: G:\AppDATA\IWBasic\ComPort\IWComtest.o - Unresolved extern IWSetProperties
Error(s) in linking G:\AppDATA\IWBasic\ComPort\IWComtest.exe

Anybody having the same issue out there ?

Thanks

Richard
Title: Re: IW Serial Lib issue
Post by: LarryMc on September 05, 2012, 09:03:13 AM
The help file is wrong.
IWSetProperties should be IWSetPort.
It is correct in the help file TOC.

It is also incorrect in the \bin\IWComLib.incc file

$command IWSetProperties(int port_number, int bits, int parity, int stopbits),intshould be
$command IWSetPort(int port_number, int bits, int parity, int stopbits),int
Title: Re: IW Serial Lib issue
Post by: RitchieF on September 05, 2012, 09:16:29 AM
But autocomplete shows only IWSetProperties... and the color changes to blue.

With IWSetPort... nothing happens. Unknown to the lib.
Title: Re: IW Serial Lib issue
Post by: LarryMc on September 05, 2012, 09:36:07 AM
QuoteBut autocomplete shows only IWSetProperties... and the color changes to blue.
That's because of the entry in the incc file.

QuoteWith IWSetPort... nothing happens. Unknown to the lib.
Did you try compiling it with  IWSetPort?
That's what the lib file has in it.

I'm in the process of fixing it and should have a new installer done sometime today.
Title: Re: IW Serial Lib issue
Post by: RitchieF on September 05, 2012, 09:38:46 AM
Tried to compile

Compiling...
IWComtest.iwb
File: C:\Users\Public\Documents\IWBasic\projects\IWComtest.iwb (34) Error: Undefined function IWSetport
Error(s) in compiling C:\Users\Public\Documents\IWBasic\projects\IWComtest.iwb
Title: Re: IW Serial Lib issue
Post by: LarryMc on September 05, 2012, 10:54:46 AM
You would have had to change the incc file first because that is where the command is defined.

Anyway, a moot point since I have just uploaded a new installer and will post an announcement.
Title: Re: IW Serial Lib issue
Post by: TGN on September 23, 2012, 03:17:13 PM
But even that, there are no success

IF IWSetport(ComPort,7,2,1)
    print "success"
end if
Title: Re: IW Serial Lib issue
Post by: LarryMc on September 23, 2012, 05:45:04 PM
Quote from: TGN on September 23, 2012, 03:17:13 PM
But even that, there are no success

IF IWSetport(ComPort,7,2,1)
    print "success"
end if
Define "there are no success "
do you mean it doesn't print "success" or it doesn't compile, or what.
what value is assigned to 'ComPort' ?
show me your code?
Did you download the updated installer?
Title: Re: IW Serial Lib issue
Post by: TGN on September 24, 2012, 03:00:06 AM
No I have only made change ind IWComLib.incc

ComPort=1
IWSetport(ComPort,7,2,1) does not return 1

And Serial communication stays on default
Title: Re: IW Serial Lib issue
Post by: LarryMc on September 24, 2012, 08:17:52 AM
Are you sure you actually have a comp port on your computer?

I don't have any on my computer.

Maybe someone else will test like RitchieF.
Title: Re: IW Serial Lib issue
Post by: TGN on September 24, 2012, 03:10:51 PM
HAHA

Yes I am sure  ;D

But I made a mistake, IWSetport must occur after IWOpenPort, then bits and parity works.
IWSetport still return 0

But my Electricity meter optical probe works fine now
-----------------------------
/ISK5\2MT372-3107
1.8.0(00830.442*kWh)
2.8.0(00627.659*kWh)
0.9.1(220703)
0.9.2(120924)
-----------------------------
I can only download Serial Lib v 1.0  :'(

Thanks Larry
Title: Re: IW Serial Lib issue
Post by: LarryMc on September 24, 2012, 03:20:42 PM
Quote from: TGN on September 24, 2012, 03:10:51 PM
But I made a mistake, IWSetport must occur after IWOpenPort, then bits and parity works.

Things like that is why I said
Quoteshow me your code?

Glad you got it working.
Title: Re: IW Serial Lib issue
Post by: RitchieF on September 24, 2012, 04:12:14 PM
Here is my code, working correct if I add 'NOT' in front of 'IWSETPORT'

Richard

$use "IWComlib.lib"
int comport = 3

OPENCONSOLE

if IWOpenPort(comport,150)
'IWSetport(ComPort,7,2,1)
print:print "success opening"
ELSE
PRINT "open failed"
end if

'IF NOT IWSetport(ComPort,7,2,1)
IF IWSetport(ComPort,7,2,1)
print "success setting"
ELSE
PRINT "setting failed"
end if

IWClosePort(comport)

DO
UNTIL INKEY$ <> ""
CLOSECONSOLE
END