Trying out Serial comm

Coding + IDE + Code-Editor + Syntax + User-Functions + Anything else

Trying out Serial comm

Postby Henning » Mon Dec 31, 2012 12:18 am

Hi,

The Q7bSerialPort is really hard to deal with...
The goal is a Formless app running as a service.

Code: Select all
Declare Signal "Q7BSerialPort" void OnEvent();

Public Dim sp As Q7BSerialPort

Sub OpenComm()
  sp.SetBaudRate("BAUD19200")
  sp.setDataBits("DATA_8")
  sp.SetFlowControl("FLOW_HARDWARE")
  sp.SetParity("PAR_NONE")
  sp.SetStopBits("STOP_2")
  sp.SetPortName("COM1")
  sp.Open   'if I add the parens() I get a Syntax Error..
End Sub

Event Init()
  OpenComm()
'  MsgBox("Init")

End Event


This is the error, both in Q7b and QrCreator:

Q7bError.JPG
Q7bError.JPG (226.94 KiB) Viewed 787 times


/Henning
Henning
 
Posts: 523
Joined: Fri Aug 13, 2010 6:29 pm

Re: Trying out Serial comm

Postby Slowdown » Mon Dec 31, 2012 7:47 am

Henning,
Have had this one in the past.
Take the Global.ccp file and navigate to the lines mentioned.
(now from my head from some time ago)
in each line there is a part beginning with Q7BS place a ';' before it and this error will disappear.
I had this while i was trying Q7B to compile on OpenSuse 64bit.
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 465
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: Trying out Serial comm

Postby berndnoetscher » Mon Dec 31, 2012 10:22 am

Looks like a regression bug. When a C++ (native) is used the compiler forgets to place a character. sorry
berndnoetscher
Site Admin
 
Posts: 344
Joined: Thu Mar 25, 2010 9:57 am

Re: Trying out Serial comm

Postby Henning » Mon Dec 31, 2012 2:26 pm

@Slowdown, That makes it inpossible to compile using Q7b... :(

@Bernd, project suspended... ;)

/Henning
Henning
 
Posts: 523
Joined: Fri Aug 13, 2010 6:29 pm

Re: Trying out Serial comm

Postby Slowdown » Mon Dec 31, 2012 2:38 pm

Slowdown, That makes it inpossible to compile using Q7b...

i know, but you can test it till B will correct the error 8-)
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 465
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: Trying out Serial comm

Postby Henning » Wed Jan 09, 2013 9:34 pm

Hi again,

This misspelling is what triggered this Error:
sp.setDataBits("DATA_8")
Changing to:
sp.SetDataBits("DATA_8")
And that error was corrected.

Also while I'm on. What is the prefered place to store and access the "Q7BSerialPort" .cpp and .h files, so the stay thru a Clean and Rebuild? I've copied them to the Build directory, but that is lost after a Clean and Rebuid.

FORGET the above.... they are in the cpp directory...

/Henning
Henning
 
Posts: 523
Joined: Fri Aug 13, 2010 6:29 pm

Re: Trying out Serial comm

Postby Henning » Thu Jan 10, 2013 2:26 pm

Me again,

As soon as I change something, and klick on Run, all the SerialPort .cpp and .h files are removed from the gcc directory... :(

What to do???

Is it not possible to create and run a 'console' app. without any GUI?

/Henning
Henning
 
Posts: 523
Joined: Fri Aug 13, 2010 6:29 pm

Re: Trying out Serial comm

Postby Slowdown » Thu Jan 10, 2013 3:37 pm

If i understand it correctly the files from the ccp directory (and if present from the Copy directory) are copied to the gcc/build directory each time you compile.
If i read U correctly they are removed from the gcc directory and not replaced ?
Is it not possible to create and run a 'console' app. without any GUI?

didn't tried that yet.
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 465
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: Trying out Serial comm

Postby Henning » Thu Jan 10, 2013 5:37 pm

Solved the lost SerialPort .cpp and .h files from gcc directory by making then ReadOnly.. :)

!!CAUTION TO ALL WHO INTEND TO USE Q7BSerialPort!!
DO NOT! Copy the file Q7BSerialPort\main.cpp to the gcc directory, it will screw things up.

Got it Compiling AND Running (partly) now. :)

/Henning
Henning
 
Posts: 523
Joined: Fri Aug 13, 2010 6:29 pm

Re: Trying out Serial comm

Postby Slowdown » Thu Jan 10, 2013 8:38 pm

Hi Henning,
DO NOT! Copy the file Q7BSerialPort\main.cpp to the gcc directory

Don't understand you here.
You have,
Code: Select all
Project directory TCU -> cpp -> Serialport sources and headers
                      -> your Q7B files

Q7B will copy the files from cpp to gcc if you compile the project or do i miss something ?
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 465
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Next

Return to Questions & Answers

Who is online

Users browsing this forum: No registered users and 0 guests

cron