Results 1 to 9 of 9

Thread: Questions for Mark Fiechtner about Serial plugin 3.0.18.

  1. #1
    Join Date
    Jun 2003
    Location
    Belarus, Minsk
    Posts
    22

    Default Questions for Mark Fiechtner about Serial plugin 3.0.18.

    Thank you for embed send zero bytes support to Generic Serial Support plugin 3.0.18 it's very good news. Without support hexdecimal numbers in LUA and without support send zero in older version plugin I'm force used script for convert decimal data bytes to hexdecimal chars for send to port :-(

    For increase flexibility and powerful offer:

    1. Add two modes work plugin - exclusive and shared mode use port.
    2. In exclusive mode connect device to port when Girder start and load Serial plugin.
    3. In Shared mode disable connect created devices to ports when Girder start don't choice No Port. It comfortable when Serial plugin use in shared mode with other plugin connected to port.
    4. Mode of work plugin, selected device, used port read from registry. If in registry key be absent then set mode to exclusive, port to No port.

    About GUI of plugin:

    5. Change Set COM port from droplist constants COM1..COMX to LUA variable, like Send data field.
    6. Change exclusive choice operation Set port, Enable/Disable Device, Send data, Detect handshaking to inclusive for execute its to one Girder command. Sequence #1 (Questioning device) executed operation how I write above excluding Disable device. For Disable device use sequence #2 Disable device, Set port (No port). Choice Enable device and Disable device exclusive.
    6.1. Why without Detect handshaking answer on request from connected device don't receive? Example:
    6.1.1 Answer data receive good if use next sequence Girder commands: Set port, Enable device, Send data, Detect handshaking, Wait on answer, check SerialValue.
    6.1.2 SerialValue is empty if command Detect handshaking disable. So SerialValue is empty if use LUA script like:
    ---------------------------
    SERIAL_SendData
    SERIAL_GetHandshaking
    Wait (use GetTickCount)
    Check variable hold SerialValue
    ---------------------------

    About LUA extentions:

    7. If possible add to LUA extention three commands executed sequece #1, #2, #3 = #1 + receive answer + #2.

    P.S. Archive Serial.3.0.18.src.zip don't have few files need for compile - girder.h, lua.h, lauxlib.h, luacomp.h.

    P.P.S. Excuse me for my bad English, I'm speak Russian.

  2. #2
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    You can use the Girder/Enable/Disable device to allow "sharing" of the serial port.

    There are corresponding lua commands

    DisableDevice (dev num)
    EnableDevice (dev num)

  3. #3
    Join Date
    Jun 2003
    Location
    Belarus, Minsk
    Posts
    22

    Default

    I'm use Girder version 3.2.9b, it don't support this coommands. Version 3.X.X don't freeware.

  4. #4
    Join Date
    Feb 2001
    Location
    Plano, TX, USA
    Posts
    3,055

    Default

    I'm glad you like the embedded zero support. There were already two OTHER ways to have the serial plugin do this; but, LUA's weird string definition needed to be supported directly.

    The serial plugin supports commands to disable or enable each device. It also supports a command to change the port to "no port" or another COM port name. These commands cannot be exposed with LUA interfaces (right now) because they have the potential to invoke a LUA event handler script on a different thread. LUA is not re-entrant so doing this would cause a deadlock on the LUA access mutex.

    MOST people don't share COM ports. They have a device attached and use it. If you wish to share the port, the commands mentioned above are there for you to use.

    LUA scripts have not run when the Serial plugin's devices are started, there would be no LUA variables available with serial port names inside.

    Use a multigroup to contain more than one command to execute an enable, send something, disable.

    Some devices and cheap serial ports cause handshaking events all the time. Being able to turn these off allows these broken pieces of hardware to be used by the serial plugin. If you wish to use handshaking events, turn them on in the device properties.

    The SerialValue variable is valid inside a LUA script which is defined as a serial event handler. Otherwise it is nil. If you want to use the value in SerialValue, enable scripting on the handshaking event and define the handshaking event handler.

    Those header files should be availabe on the developer's download page; however, it looks like the lua-devel.zip file disappeared in the site merge. I have attached a .zip file for you to use until the other headers are put back in place.
    Attached Files Attached Files
    Mark F

  5. #5
    Join Date
    Jun 2003
    Location
    Belarus, Minsk
    Posts
    22

    Default Bug

    1. Receive bin mode have bug. If received sequence have zero bytes then SerialValue=strsub(SerialValue,1,(strfind(SerialVa lue,strchar(0))-1). In receive hex mode all work right.
    Example:
    Device send to port next sequence bytes: 03 00 F2 84 ED.
    1.1. Hex mode.
    SerialValue="0300F284ED". All right.
    1.2. Bin mode.
    SerialValue=strchar(03). Wrong!.
    Must be SerialValue=strchar(03,00,242,132,237).

    2. I shall not be able find all source files for building serial.dll. Developer page (http://www.girder.nl/developer.php this it?) have Girder.h only.
    2.1. I place files from stuff.zip to some folder where aarangement files from Serial.3.0.18.src.zip.
    2.2. Create in parent folder lib folder and place there lua.lib from http://www.lua.org/ftp/lua-4.0.1.tar.gz.
    When I try build plugin VC6++ wrote:
    Creating library Release/Serial.lib and object Release/Serial.exp
    cLUA.obj : error LNK2001: unresolved external symbol _lua_settop@8
    cLUA.obj : error LNK2001: unresolved external symbol _lua_dobuffer@16
    cLUA.obj : error LNK2001: unresolved external symbol _lua_gettop@4
    cLUA.obj : error LNK2001: unresolved external symbol _luaL_openlib@12
    cLUA.obj : error LNK2001: unresolved external symbol _luaL_closelib@12
    cLUA.obj : error LNK2001: unresolved external symbol _lua_freebytecode@4
    cLUA.obj : error LNK2001: unresolved external symbol _lua_bytecode@8
    cLUA.obj : error LNK2001: unresolved external symbol _lua_error@8
    cLUA.obj : error LNK2001: unresolved external symbol _lua_pushnumber@12
    cLUA.obj : error LNK2001: unresolved external symbol _lua_tostring@8
    cLUA.obj : error LNK2001: unresolved external symbol _lua_isstring@8
    cLUA.obj : error LNK2001: unresolved external symbol _lua_tonumber@8
    cLUA.obj : error LNK2001: unresolved external symbol _lua_isnumber@8
    cLUA.obj : error LNK2001: unresolved external symbol _lua_strlen@8
    ../Serial.dll : fatal error LNK1120: 14 unresolved externals
    Error executing link.exe.
    Creating browse info file...

    Serial.dll - 15 error(s), 0 warning(s)

  6. #6
    Join Date
    Feb 2001
    Location
    Plano, TX, USA
    Posts
    3,055

    Default

    I have attached the LUA.lib (in a .zip file). This file should be available from the Developer's page along with the .h files.

    Supporting binary data in Event handlers can be done but binary data will fail if passed to Girder as an event string. I'll see if I cna get enough free time to change this behavior.
    Attached Files Attached Files
    Mark F

  7. #7
    Join Date
    Feb 2001
    Location
    Plano, TX, USA
    Posts
    3,055

    Default

    Good news. I'm very close to supporting binary data for the receive event handlers. I have to run some regression tests; but, I hope to release this somewhere around November 9.
    Mark F

  8. #8
    Join Date
    Feb 2001
    Location
    Plano, TX, USA
    Posts
    3,055

    Default

    By the way, Ron added the LUA developers .ZIP file back to the site. See this thread.
    Mark F

  9. #9
    Join Date
    Jun 2003
    Location
    Belarus, Minsk
    Posts
    22

    Default

    Thank you Mark. Very glad what you care for me. Serial.dll build without error used your lua.lib.

Posting Permissions

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