Results 1 to 6 of 6

Thread: serial send action

  1. #1
    Join Date
    Mar 2005
    Posts
    724

    Default serial send action

    hey I have a stupid question how do you do a CR or a LF in the serial send action.

    Thanks,
    Yonu

  2. #2
    Join Date
    Mar 2005
    Posts
    724

    Default

    Ok i figured out to line feed and carriage returns however I am getting a couple of lua errors I don't know what to do with I have no idea what the Incomplete response to last command means

    Serial: Icatcher : Simple Send: 4F 6E 3C 43 52 3E On<CR>
    Serial: Icatcher : Simple Receive: Data Code: 16384
    Serial: Icatcher : ERROR: No response to last command
    Serial: Icatcher : Simple Receive: Data 73 65 6E 73 6F 72 0D sensor. Code: 8192
    Serial: Icatcher : ERROR: Incomplete response to last command

    Thanks,
    Yonu

  3. #3
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,550

    Default

    Incomplete response means that the serial class timed out before. Looks like incorrect termination. Probably it's expecting 0D 0A but only getting 0D from the device. Check that.
    Ron
    No support through PM

  4. #4
    Join Date
    Mar 2005
    Posts
    724

    Default

    how is the best way to check it as the device seems to be outputting the proper data to the comport at leat it appears to be in a termina

  5. #5
    Join Date
    Jan 1998
    Location
    Jupiter, FL
    Posts
    13,550

    Default

    Attach the config for your Icatcher device. Maybe we can see it in there.
    Ron
    No support through PM

  6. #6
    Join Date
    Mar 2005
    Posts
    724

    Default

    sorry for the delay here is the contents of the config

    local Super = serial.Classes.Simple
    local device = Super:New({
    Name = "Icatcher",
    GlobalName = "Icatcher",
    Description = "Icatcher Sensors and Controls",

    LogLevel = 0,-- change this to a higher number or false when the device is working

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

    CallbackType = serial.CB_TERMINATED,
    ReceiveTerminator = '<CR>',

    SendStartByte = '',
    SendTerminator = '<CR>',
    IncompleteResponseTimeout = 100,
    NoResponseTimeout = 1000,

    Initialize = function(self)
    if Super.Initialize(self) then
    -- add your own initializations here
    self.Status = 'Initialized'
    return true
    end
    end,

    ReceiveResponse = function(self, data, code)
    if math.band(code, serial.RXCHAR) > 0 then
    -- add code here to process the data parameter
    end
    Super.ReceiveResponse(self, data, code) -- must call the parent's ReceiveResponse
    end,

    })

    serial.AddDevice(device)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •