Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: cd_edwards on October 28, 2011, 09:09:26 AM
-
I purchased a LCD Smartie recently which I hope to use for DRO display as well as other information. Here is the code I'm having trouble with
It seems that I need to send raw characters to the device in order to drive it. The example I found in one of the other boards here, does not work for me. The block that I've been working on is in the "If init-=0 .... endif" section.
I'm working from the driver software for the matrix DLL which works using LCD Smartie
procedure TLCD_MO.setPosition(x, y: Integer);
begin
writeDevice(Chr($0FE)+'G'+Chr(x)+Chr(y));
inherited;
end;
Chr(254) is 0xFE
cnt=getVar(1000)
init=getVar(1001)
If init=0 Then
SendSerial _
Chr(254)"G"Chr(0)Chr(0)" X:" & _
Chr(254)"G"Chr(0)Chr(1)" Y:" & _
Chr(254)"G"Chr(0)Chr(2)" Z:" & _
Chr(254)"G"Chr(0)Chr(3)" A:" & _
setVar(1001, init+1)
setVar(1000, 0)
end if
if cnt=10 then
setVar(1000, 0)
SendSerial _
"¦30" & Format (Getdro(0) , "+000.0000;-000.0000") & _
"¦31" & Format (Getdro(1) , "+000.0000;-000.0000") & _
"¦32" & Format (Getdro(2) , "+000.0000;-000.0000") & _
"¦33" & Format (Getdro(3) , "+000.0000;-000.0000")
else
setVar(1000, cnt+1)
End If
-
IS this device serial,modbus,usb, ????????????
IS Mach running the LPT SS or some other motion device??
Are you running pokeys??
(;-) TP
-
It's a USB serial device. The device shows up as Com5. Mach was actually seeing the device and sending information to it. I just need to be able to send the proper string's to it.
-
From What I can see the LCD Smartie is SOFTWARE used to drive a lcd display.
SO what LCD display are you using???
Can you post a link to a manual for the display???
What about the other code on here did not work for you?
(;-) TP
-
Got it from Sure Electronics. It's called a LCD Smartie Kit. There's a couple of versions of it, I got version II of it.
http://www.sureelectronics.net/goods.php?id=969
I need to send raw char strings to the device instead of waht the other code from here uses. I might have solved the problem, I'll see what happens after this reboot. Currently my serial port is in "use" according to winblows.
-
If init=0 Then
SendSerial Chr(254) & "X"
SendSerial Chr(254) & "G" & Chr(1) & Chr(1) & " X:"
SendSerial Chr(254) & "G" & Chr(1) & Chr(2) & " Y:"
SendSerial Chr(254) & "G" & Chr(1) & Chr(3) & " Z:"
SendSerial Chr(254) & "G" & Chr(1) & Chr(4) & " A:"
setVar(1001, init+1)
setVar(1000, 0)
end if
-
YOu are going to have to start small and work your way UP and their is no garrentee that Mach can talk to it.
First make sure that Mach3 and the device is setup proper in the serial side. They have to be exact in configuration.
Start by sending 1 line of 20 charectors to it and see what that does.
Sendserial "abcdefghijklmnopqrst"
(;-) TP