PDA

View Full Version : NEW-B: Serial Plugin



jts193
February 2nd, 2006, 04:52 PM
GIRDER 4.0 - SERIAL PLUGIN

This one should be simple... Ive read the manual and spent quite a bit of time experimenting ... still stymied.

I'm trying to send one 8-character serial string to an LCD screen. I created a simple plugin (below) and assigned it to the proper comm port. Communication OK. Then I enter my command string in the "send ASCII" global cache window. No Joy. No errors, nothing, except acknowl that the global cache command is being sent.

Are there additional elements required in my plugin?

I've tested the string from the computer, using the command prompt. Works every time.

Thanks in advance for the lesson!

=========


local device = serial.Classes.Simple:New({

Name = "sharp LCD",
Description = "sharp lcd",

BaudRate = 9600,
Parity = 0,
StopBits = 0,
DataBits = 8,
FlowControl = 'N',


Initialize = function (self)


gir.LogMessage(self.Name, 'Communications OK',3)
self.Status = "Communication OK"

return serial.Classes.simple.Initialize (self)

end,


})

serial.AddDevice (device)


========================

danward79
February 2nd, 2006, 05:20 PM
What code are using to try and send the command?

jts193
February 2nd, 2006, 05:30 PM
the command is "POWR0___(CR) . That's 5 characters, followed by three spaces and a CR.

The manual is @ http://www.sharpusa.com/files/tel_man_LC45GD4U.pdf Pgs 96 and 97 refer to serial spec and commands.

Thanks.

Rob H
February 2nd, 2006, 05:44 PM
Then I enter my command string in the "send ASCII" global cache window.

Umm... are you sure that's what you're doing? Because that doesn't sound right to me.

Try dragging a Serial Devices\Serial Send action to your GML - select your device from the drop down and type the command you want to send in there.

jts193
February 2nd, 2006, 07:45 PM
Took me a while to get the Serial Device/Serial Action set up correctly.... but this doesn't seem to work either. Any other suggestions?

jts193
February 2nd, 2006, 08:17 PM
UPDATE.....

Closed down Girder and restarted . works fine!!

Many thanks for your assistance.

Promixis
February 3rd, 2006, 08:17 AM
UPDATE.....

Closed down Girder and restarted . works fine!!

Many thanks for your assistance.

Hi, would you mind uploading you gml and .lua file in a zip to the G4 downloads?

From the front web page/developer/upload