Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Turbo TURTLE

#1
Hi everyone,

I see the topic is very old, but i'm in great need to communicate with an Arduino via USB.
I tried to apply the code in post #1, but it gives an error. The output of the compiler:
_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.10.053 SN:61acac25 - 3D, NET
Wordcount:25 commands
compiling:
C:\Users\OLUSUM~1\AppData\Local\Temp\glbasic\gpc_temp1.cpp: In function `__GLBASIC__::DGStr __GLBASIC__::COM_Read_Str(DGNat, DGNat)':
C:\Users\OLUSUM~1\AppData\Local\Temp\glbasic\gpc_temp1.cpp:1057: error: invalid token
C:\Users\OLUSUM~1\AppData\Local\Temp\glbasic\gpc_temp1.cpp:1057: error: non-lvalue in unary `&'
C:\Users\OLUSUM~1\AppData\Local\Temp\glbasic\gpc_temp1.cpp:1057: error: stray '\' in program
C:\Users\OLUSUM~1\AppData\Local\Temp\glbasic\gpc_temp1.cpp:1057: error: invalid token
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Elapsed: 1.1 sec. Time: 15:11
Build: 0 succeeded.
*** 1 FAILED ***

I also downloaded an older version of glbasic (12.308) but it didn't work.
#2
" Re: serial port access
« Reply #4 on: 2010-Apr-15 »QuoteTry this - Gernot hasn't tested it though SerialPort.rar (4.16 kB - downloaded 40 times.)"

Hi... Everybody
I should create connection via RS232. I found and tested following .zip file in Forum.

Actually GLBasic has compiled it without any error. When I run it, screen appears as attached screen shot. All functions returns without error. But there is not real communication. I have added 1 sec delay between com_write() and com_read to allow enough time for real communication. I have already tested com port at DOS. It works good.  Is there anybody who tested this code? Or can you offer something different.

Thanks in advance
#3

"I'm unable to compile my application to Android.  I have installed Java 1.6 32 bit SDK as well as the Android dev tools"

I have similar problem too. First of all I downloaded and installed "java_ee_sdk-6u3-jdk7-windows-ml.exe" from 

"http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-ee-sdk-6u3-jdk-7-downloads-439818.html"

Is this right software to install? I have a doupt. Because it has been installed to

"c:\glassfish3\jdk7" instead of  "C:\Program Files (x86)\Java\jdk1.6.0_41"

Bigtunacan, where did you download Jawa from?
#4
"Humor > grammar. Thank for the feedback TT. I test for you good."

Are you still at grammar? Ok... No problem. Stay there...
#5
Here is the shortcut of an emulator of a legend "CASIO FX-602P". 

https://play.google.com/store/apps/details?id=net.sourceforge.uiq3.fx602p&hl=tr

While I was dreaming this programmable calculator, my father gave me a "CASIO FX-5200P" (basic programmable calculator) as a gift on my birth day. It was the gate to computer world for me. 

#6

"Yes, you can pack binary data in a string and send it. Theres a function on the forums that does what netwebget does. "

Thank you Kity Hello...

I undestood that we have to convert binary data to ASCII codes to send. But we can not send it as it is. For example we can not send an exe file.

But to do this, I have to create a socket connection first. Of course without error 10035.
#7
Thank you so much Moru. Actuall my English is not so bad. I sent this post very early morning after spending four hours on Socket programing.

Anyway there is stil no success and I need help. I have also a question. Does GLBASIC allow binary communication via network?

Thanks in advance...


#8
Hi... Everybody...

I am very new on writing software with GLBASIC. Actually I am trying to write a TCP based software. But I have some complaints.

I found a test routine on forum for socket programing. But when I try it I face with an ERROR coded 10035. When I debug it, I saw that   SOCK_TCPACCEPT() command creates this error code. On the other hand there is no error on the client side. It sends message without any problem. I need help.

Here is TEST routine.

Code (glbasic) Select

SYSTEMPOINTER 1;
SETSCREEN 480,320,1;

GLOBAL mx%,my%,mb1%,mb2%,clicked%;
GLOBAL server%,client%,lastip%=2852037848,socktcp%,sock%;
GLOBAL ip$="169.254.164.216";
GLOBAL port%=21851;
GLOBAL msg%,readmsg%,mssg$="HELLO WORLD",length%,connect%;
GLOBAL rv%,readport=0;
LOADFONT "smalfont.png", 1
SETFONT 1


WHILE NOT KEY(1)
MOUSESTATE mx%,my%,mb1%,mb2%;

//create server or client
IF server=0 AND client=0
IF mb1>=1
IF mx<200//touch left side of screen to create server
CreateServer();
ELSEIF mx>280//touch right side of screen to create client
CreateClient();
ENDIF
ENDIF
ENDIF

TcpListen();

IF server=1
PRINT "ACTING AS SERVER",10,10,1;
ENDIF
IF client=1
PRINT "ACTING AS CLIENT",10,10,1;
ENDIF
IF connect=1
PRINT "CLIENT CONNECTED",10,50,1;
ENDIF

IF mb1=0
clicked=0;
ENDIF

DEBUG "SERVER="+ server +     "CLIENT="+client + "CONNECT=" + connect + "    ";

IF server=1
// rv% = SOCK_RECV(socktcp, mssg$,100)
// PRINT "SOCK TCP="+ socktcp + "   MESAJ DURUMU="+rv%,0,200
// IF rv% > 0
// PRINT mssg$,200,200
// ELSE
// mssg$ = NETGETLASTERROR$()
// DEBUG mssg$
// ENDIF
ENDIF

IF client=1
MOUSESTATE mx%,my%,mb1%,mb2%
IF mb2% = 1
rv% = SOCK_TCPSEND (socktcp, mssg$)
PRINT "LENGTH OF MESSAGE=" + rv%,0,220;
ENDIF
ENDIF



SHOWSCREEN
WEND
SOCK_CLOSE(socktcp)
END

FUNCTION TcpListen:
IF server=1//server checks for messages
readmsg=SOCK_TCPACCEPT(socktcp,lastip);
mssg$ = NETGETLASTERROR$()
DEBUG "    SENT SOCKET2 NO=" + socktcp + "    RECEIVED SOCKET NO=" + readmsg + "    ERROR=" + mssg$
IF readmsg>=1

//client has connected
connect%=1;
ENDIF
ENDIF
ENDFUNCTION

FUNCTION CreateServer:
sock=SOCK_INIT();
IF sock
socktcp=SOCK_TCPLISTEN(port%);
DEBUG "SERVER:sock=ok " + "    SENT SOCKET1 NO=" + socktcp;
IF socktcp>=0
server=1;
DEBUG "SERVER:socktcp=ok ";
ELSE
DEBUG "SERVER:could not create sock ";
ENDIF
ENDIF
ENDFUNCTION

FUNCTION CreateClient:
sock=SOCK_INIT();
IF sock
socktcp=SOCK_TCPCONNECT(ip$,port,5000);
DEBUG "CLIENT:sock=ok ";
IF socktcp>=0
client=1;
DEBUG "CLIENT:socktcp=ok ";
ELSE
DEBUG "CLIENT:could not create sock ";
ENDIF
ENDIF
ENDFUNCTION


I have also a question does GLBASIC allows binary communication via network?
Thanks in advance.

Edit: Oh lookie, code-tags! (please use them for code, makes easier reading) /Moru