Author |
Topic: Serial com in LBB/LB4 - what is different? (Read 2285 times) |
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #4 on: Apr 25th, 2014, 4:27pm » |
|
Well...still not working either ways.
I need to trap what serial data I'm sending to the printer via LBB or the com software.
Any idea how to do so?
|
|
Logged
|
Roger
|
|
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #6 on: Apr 25th, 2014, 5:21pm » |
|
How can I modify/set the serial data flow control type in LBB (Xon/Xoff - Hardware - None)?
|
|
Logged
|
Roger
|
|
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #7 on: Apr 25th, 2014, 5:33pm » |
|
The syntax for serial port parameters is slightly different. The basic options are the same, so for example this works:
open "COM1:9600,n,8,1" for random as #comm
but when specifying 'handshaking' parameters the syntax accepted by LBB is as follows:
open "COMn: [baud=b] [parity=p] [data=d] [stop=s] [to=on|off] [xon=on|off] [odsr=on|off] [octs=on|off] [dtr=on|off|hs] [rts=on|off|hs|tg] [idsr=on|off]"
I don't get it.
What would the correct syntax be in my case please?
|
|
Logged
|
Roger
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #8 on: Apr 25th, 2014, 9:55pm » |
|
on Apr 25th, 2014, 4:27pm, flotulopex wrote:| How can I modify/set the serial data flow control type in LBB (Xon/Xoff - Hardware - None)? |
|
Code:OPEN "COM3: baud=115200 parity=n data=8 stop=1 xon=on odsr=off octs=off" FOR RANDOM AS #PRINTER However I'm not sure whether Xon/Xoff handshaking is always available in Windows; it may depend on your serial port driver. Personally I would prefer to implement it in my own code because that way you know it will always work.
Richard.
|
|
Logged
|
|
|
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #9 on: Apr 26th, 2014, 12:49pm » |
|

Still won't work.
Since the beginning of this thread, when I send the data to the printer , I can see on its LCD some kind of "reset" since it will show up the "start screen" just as when I switch it on. That means, all changes I made to the data sent as in my first post don't modify anything.
If there is no difference in the data itself, no obvious flow control issue, what is still to be investigated?
|
|
Logged
|
Roger
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #10 on: Apr 26th, 2014, 5:04pm » |
|
on Apr 26th, 2014, 12:49pm, flotulopex wrote:| If there is no difference in the data itself, no obvious flow control issue, what is still to be investigated? |
|
You say the data is correct, but what about the baud rate, parity bit (if any) and number of stop bits? If any of those are wrong it is entirely likely that the receiving device will not respond correctly. An oscilloscope is an invaluable tool to investigate those issues.
There are not that many ways in which the serial signal could be wrong, so if you have appropriate monitoring facilities it should be relatively simple to debug the problem. You are far better placed to do that than I am!
Richard.
|
|
Logged
|
|
|
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #11 on: Apr 28th, 2014, 10:01am » |
|
...yup!
The oscillo is on my table already but I can't still point the problem.
I'll check some more....
|
|
Logged
|
Roger
|
|
|
Rod
Full Member
member is offline


Gender: 
Posts: 110
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #12 on: Apr 28th, 2014, 3:25pm » |
|
If you say that you can issue the commands via HyperTerminal like software then it can be achieved with LBB.
Couple of guesses, COM3 does not sound right. If you are using a USB based serial module its likely to be a higher number.
Use the Control Panel to double check what Com number and parameters the HyperTerminal like software is using.
Are you sure it just terminates with a CR? Some of these modules use a check digit routine appending a character to the end of the message.
Is the printer home made? who makes the HyperTerminal like software and can you post a link to their support pages?
|
|
Logged
|
|
|
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #13 on: Apr 30th, 2014, 05:50am » |
|
Thanks Rod,
I checked these points already: COM ports, speed and other parameters all are fine.
The com tool lets me choose between different terminators; I just needed to test them one by one to find the correct one, the only one that works is "CR".
The printer is this one http://www.bqreaders.com/gb/products/witbox.html.
I use the "Serial Communicator" software utility coming with this editor http://www.mecanique.co.uk/shop/index.php?route=product/category&path=20_62.
Until now, I sniffed the com port with this tool http://www.eltima.com/products/serial-port-monitor/. But it doesn't shows up any kind of special control er checking character.
I need to look into the transmitted data packet with my oscillo and maybe find if there is a difference.
But I don't have any protocol analyzing tool so if there is a difference, I'll still need to find out what exactly it is.
|
|
Logged
|
Roger
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #14 on: Apr 30th, 2014, 08:33am » |
|
on Apr 30th, 2014, 05:50am, flotulopex wrote:| The com tool lets me choose between different terminators; I just needed to test them one by one to find the correct one, the only one that works is "CR". |
|
Evidently you don't have a detailed specification of the data format accepted by the printer, otherwise you would not have needed to perform that experiment. Can you not obtain such a specification from the printer manufacturer?
Richard.
|
|
Logged
|
|
|
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #15 on: Apr 30th, 2014, 08:40am » |
|
I did open a ticket at their support center.
Wait and see
|
|
Logged
|
Roger
|
|
|
Rod
Full Member
member is offline


Gender: 
Posts: 110
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #16 on: Apr 30th, 2014, 10:34am » |
|
Having had a browse and I search I find very little on line help or discussion. Everyone seems to use the bundled software.
What I do see is that the software uses parameter files which would suggest that you just cant start printing to the printer you have to give it the setup info first.
I also see that DTR is part of the serial setup so you will need to take note of that. It seems to be used to force a reset. So it is one handshaking line that you may need to manage.
I don't understand why you are using this microprocessor serial tool. I would have thought that you just open the g code file in LBB and print it to the serial com port.
When you look at how the working software works, look at how it opens the port, what it does with the handshaking lines and what preliminary data it sends to the printer.
Of course proper technical help or documentation would ease the journey.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #17 on: Apr 30th, 2014, 1:46pm » |
|
on Apr 30th, 2014, 10:34am, Rod wrote:| I also see that DTR is part of the serial setup so you will need to take note of that. It seems to be used to force a reset. So it is one handshaking line that you may need to manage. |
|
You can initialise the DTR line when the port is opened; for example to set it 'on':
Code: OPEN "COM3: baud=115200 parity=n data=8 stop=1 dtr=on" FOR RANDOM AS #PRINTER If you need to control DTR 'actively', after the port has been opened, LBB makes that easy because it exposes the native file handle via the HWND() function. For example to set DTR:
Code: handle = hwnd(#PRINTER)
calldll #kernel32, "EscapeCommFunction", handle as ulong, _SETDTR as long, r as long Richard.
|
|
Logged
|
|
|
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #18 on: May 1st, 2014, 7:18pm » |
|
My printer is normally connected directly to my PC via an USB cable. In the printer, there is a FTDI USB to RS232 converter.
Unfortunately, I can't reach the RS232's RX pin on the printer's board (it is inaccessible).
As I have a FTDI USB-RS232 cable http://www.ftdichip.com/Products/Cables/USBRS232.htm, I have connected my probe directly on the TX pin of this cable and this is what I can see.
Message sent is (without quotes) "G28".
Leaving/changing/removing any termination character (with Serial Communicator) will not change anything to the "Serial Com sent data" image and that confuses me.
LBB sent data

Serial Com sent data
|
|
Logged
|
Roger
|
|
|
|