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
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),int
should be
$command IWSetPort(int port_number, int bits, int parity, int stopbits),int
But autocomplete shows only IWSetProperties... and the color changes to blue.
With IWSetPort... nothing happens. Unknown to the lib.
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.
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
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.
But even that, there are no success
IF IWSetport(ComPort,7,2,1)
print "success"
end if
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?
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
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.
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
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.
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