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


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #27 on: May 4th, 2014, 7:34pm » |
|
The are several tools one can find in the internet to make, for example, the 3D printer positioning the extruder somewhere you want it to have at the end of the printing process (for cleaning purposes). You may also want to switch off some fans or so.
Currently, I can achieve this by sending g-code commands via almost any serial communication software.
I wasn't able to do so with LBB until a few hours ago.
But one of you said that if a serial com software can "talk" to my printer, LBB would be able to do it too.
So "yes, it does it.
All I needed was to: - open the COM port - wait around 10 seconds (= I need to wait for the printer to end his start-up procedure and listen to incoming commands) - send the command.
So thanks to all of you for the help....and yes, the solution was rather simple
|
|
Logged
|
Roger
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #28 on: May 4th, 2014, 8:32pm » |
|
on May 4th, 2014, 7:34pm, flotulopex wrote:Currently, I can achieve this by sending g-code commands via almost any serial communication software... I wasn't able to do so with LBB until a few hours ago.... All I needed was to... wait around 10 seconds |
|
Sorry, I still don't properly understand. Are you saying that when sending data from "any serial communication software" it is not necessary to wait ten seconds, but when sending from LBB it is necessary to wait?
Richard.
|
|
Logged
|
|
|
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #29 on: May 4th, 2014, 9:20pm » |
|
When the COM port is opened by LBB or any other com software, the printer sends out several data to the PC. This takes a few seconds (a little less than ten seconds).
During this time, no commands can be sent to the printer - the printer is not "listening" to any incoming command.
Since I always had to type in the g-code command in the serial com software, this took a few seconds giving the time to the printer to be able to "receive" my command.
Unfortunately, when I was using my LBB program, things went much faster not allowing enough time for the printer to be "receive" ready and acknowledge the command.
|
|
Logged
|
Roger
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #30 on: May 5th, 2014, 08:33am » |
|
on May 4th, 2014, 9:20pm, flotulopex wrote:| Unfortunately, when I was using my LBB program, things went much faster not allowing enough time for the printer to be "receive" ready and acknowledge the command. |
|
OK, that makes sense; thanks for the explanation.
However, something still puzzles me. The subject line for this thread is "Serial com in LBB/LB4 - what is different?" which clearly implies that your problem was related to some incompatibility between LB4 and LBB. Indeed, the early exchanges in the thread were about known differences: the need to add a trailing semicolon in LBB, even if the port is opened as BINARY, and the different syntax used to control the handshaking options.
But, surely, LB 4.04 starts sending data as soon as the port is opened, just like LBB does, so why was the need to wait ten seconds not identified before you ported the code to LBB? If the code ran in LB4 without the delay, how?
Richard.
|
|
Logged
|
|
|
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #31 on: May 5th, 2014, 09:22am » |
|
Quote:| ...so why was the need to wait ten seconds not identified before you ported the code to LBB? |
|
Sorry, I don't understand your question.
Or do you mean: why did Roger add ten seconds wait time in the LBB code since it worked in LB4 without that waiting period?
Did I say it worked in LB4 previously? To be honest, I didn't even try under LB4....
|
| « Last Edit: May 5th, 2014, 09:28am by flotulopex » |
Logged
|
Roger
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #32 on: May 5th, 2014, 10:07am » |
|
on May 5th, 2014, 09:22am, flotulopex wrote:Did I say it worked in LB4 previously? To be honest, I didn't even try under LB4.... |
|
I read your subject line "Serial com in LBB/LB4 - what is different?" as asking about differences between LBB and LB4. Was I wrong? Why did you mention LB4 at all if you didn't even try it?
Richard.
|
|
Logged
|
|
|
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #33 on: May 5th, 2014, 1:47pm » |
|
Subject should have been called: Serial com via LBB/LB4 or Terminal Software - what is different? But this is far too long....
|
|
Logged
|
Roger
|
|
|
Rod
Full Member
member is offline


Gender: 
Posts: 110
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #34 on: May 5th, 2014, 1:51pm » |
|
If you are not used to serial comms the first lesson to learn is timing, buffers fill up, printers chunter and the PC flys along at a speed the port can't hope to follow.
http://lbpe.wikispaces.com/AccessingSerialPort
|
|
Logged
|
|
|
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #35 on: May 5th, 2014, 3:52pm » |
|
Thanks Rod,
This is exactly where I started.
|
|
Logged
|
Roger
|
|
|
net2014
New Member
member is offline


Posts: 37
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #36 on: May 5th, 2014, 6:36pm » |
|
on May 5th, 2014, 1:51pm, Rod wrote:
I have to admit my use of serial comms usually involves some fudge of timing to make things work, but in reality shouldn't timing be irrelevant? That's why handshake lines are part of rs232 specification. These lines seem to be disabled in LB4 serial open command. Isn't LB4/LBB able to handle handshaking? If it is capable then perhaps we should put some effort into proper handshake investigation.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #37 on: May 5th, 2014, 8:29pm » |
|
on May 5th, 2014, 6:36pm, net2014 wrote:| I have to admit my use of serial comms usually involves some fudge of timing to make things work, but in reality shouldn't timing be irrelevant? |
|
It's honest of you to admit it, but as you say it shouldn't be necessary.
Quote:| That's why handshake lines are part of rs232 specification. |
|
Not really. You commonly don't need any explicit handshaking or timing fudges.
For example if the communication protocol involves data packets alternately flowing in one direction and then the other (poll-data-poll-data or data-response-data-response) then the only requirement is that the receive buffer is big enough to hold an entire packet.
Even if the communication is one-way you still don't need any handshaking if these conditions are met:
The average rate at which the receiving end can accept and process data exceeds the average transmission rate. There is a receive buffer of sufficient length that it can cope with the worst case fluctuation of transmit rate and receive processing capability. With typical baud rates and processing speeds these conditions can often be easily met.
Since the majority of applications match one or other of these cases, handshaking is rarely necessary. That is fortunate given that many communication paths do not support the additional data channels that are necessary for hardware handshaking.
Quote:| Isn't LB4/LBB able to handle handshaking? If it is capable then perhaps we should put some effort into proper handshake investigation. |
|
Of course they can handle handshaking, but I don't really agree that much investigation is desirable given how unusual it is for it to be needed.
Richard.
|
|
Logged
|
|
|
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #38 on: May 6th, 2014, 1:11pm » |
|
This was my question to the printer's support service: Quote:Hello, I'm trying to send G-code commands to my Witbox via my PC. It works via HyperTerminal but it will not work with other programming languages I use and I can't find what is wrong. May I kindly ask you to give me the serial data protocol you use (baud, parity, data ,stop, flow control and so on)? Is there any CRC or special controlling character used? Thank you for your help. Roger |
|
...here's the answer I got: Quote:Dear Roger, In Witbox, it is baud to 115200. You may know serial port to comunnicate with it. You may use PuTTy, it is software for comunnicate with Witbox. We remain at your disposal for any questions Saludos, |
|
|
|
Logged
|
Roger
|
|
|
Rod
Full Member
member is offline


Gender: 
Posts: 110
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #39 on: May 9th, 2014, 5:44pm » |
|
Having browsed a bit deeper I see that we are asking the wrong questions. The serial link is the serial link and it works and isn't the problem.
The Witbox uses an open source electronics board to drive its stepper motors and extruder. Ramps 1.4. This is an Arduino based microprocessor board that manages all aspects of 3d printing. It is used in a variety of modern 3d printers.
So if you want to take control of the printer you need to research Ramps 1.4
Will this be easy? Well it's kinda like asking me to take my All in One printer scanner, take control of the scanner, move it to 100,100 and scan the next three pixels. Easy? No way.
But I have not researched Ramps 1.4 protocol, that's where you need to spend the time.
Witbox clearly focus on the hardware, which they appear to be superb at. But they have opted for the open source driver software, so you will get bland responses if you query comms when the real focus should be Ramps.
|
|
Logged
|
|
|
|
flotulopex
Junior Member
member is offline


Gender: 
Posts: 94
|
 |
Re: Serial com in LBB/LB4 - what is different?
« Reply #40 on: May 12th, 2014, 12:19pm » |
|
Thanks Rod,
That's effectively THE board (Ramp)!
As you say, the problem is (was) not either on a serial comm level nor on LBB's side, but one has to start somewhere one time and the info I got back in this forum helped me to find the solution, even the one I didn't expect.
|
|
Logged
|
Roger
|
|
|
|