Results 1 to 6 of 6

Thread: COMM Module?

  1. #1

    COMM Module?

    There is a reference to a COMM module in the TB version history at the end of 2005
    but I cannot find any other information about it and nothing in the help file.

    COMMs are a particular interest of mine and I would like to know if this module
    exist and where can I find any info about it? Any other way to handle comms
    in TBasic other than raw API?

    Thanks in advance for any info on this subject

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: COMM Module?

    Yes, there is a COMM module with the below functions already developed but we had some problems with PB owner.
    To make it short PB is saying we have violated compiler licence so we cannot use PB communication fuctionalities in a thinBasic module.
    After reading again and again the few lines of PB compiler licence we didn't found any limitation but, you know, our project is a free project and we are not in a condition (at the moment) to try to go against.

    What do you need COMM module for?
    We can try to develop something in another way.

    Let me know.
    Eros

    _________________________________________________

    List of already supported COMM functionalities:
    [code=thinbasic]
    COMM_Get, COMM_Close, COMM_Line,
    COMM_Open, COMM_Print, COMM_Recv,
    COMM_Reset, COMM_Send, COMM_Set,
    COMM_FreeFile, COMM_EOF[/code]

    List of COMM equates:
    [code=thinbasic]
    %COMM_BAUD, %COMM_BREAK, %COMM_BYTE,
    %COMM_CD, %COMM_CTSFLOW, %COMM_DSRFLOW,
    %COMM_DSRSENS, %COMM_DTRFLOW, %COMM_DTRLINE,
    %COMM_NULL, %COMM_PARITY, %COMM_PARITYCHAR,
    %COMM_PARITYREPL, %COMM_PARITYTYPE, %COMM_RING,
    %COMM_RLSD, %COMM_RTSFLOW, %COMM_RXBUFFER,
    %COMM_RXQUE, %COMM_STOP, %COMM_TXBUFFER,
    %COMM_TXQUE, %COMM_XINPFLOW, %COMM_XOUTFLOW
    [/code]

    A little test modem script:
    [code=thinbasic]
    uses "Console"
    uses "COMM"

    dim nModems as long = 9
    dim Count as long
    dim CountATI as long
    dim hComm as long
    dim nBytes as long
    dim sBuffer as string

    for count = 1 to 9
    hComm = comm_freefile
    console_writeline("Opening COM" & Count & " as hComm=" & hComm)
    comm_open("COM" & Count, hComm)
    if err = 0 then
    console_writeline("...open ok.")

    for CountATI = 1 to 5
    console_writeline("Now sending ATI" & CountATI)
    comm_print(hComm, "ATI" & CountATI)
    SLEEP 1000 ' delay for modem to respond
    nBytes = COMM_Get(hComm, %comm_RXQUE)
    COMM_recv(hComm, nBytes, sBuffer)
    console_writeline(sBuffer)
    next

    console_writeline("...closing port COM" & Count)
    comm_close(hComm)
    else
    console_writeline("Error: " & err)
    end if
    next

    console_writeline("----------------------------------------")
    console_writeline("End testing. Press any key to finish.")
    console_writeline("----------------------------------------")
    [/code]
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3

    Re: COMM Module?

    OK to know the reason for my interest in COMM module you need the background.

    My main work is using computers for industrial applications, control and testing etc. I was attracted to ThinBasic because it is aimed at automation and is simple for users to use and understand. I want to investigate how far I can take this. My current project is developing functionallity in a hardware device called The Mule. The Mule is a unique device which allows one computer to control another computer. Using the Mule you can interface to any existing application or process even if not originally intended for automated control.

    Thin Basic is exciting because many of the people I work with are busy engineers who understand computer technology but do not have the time to learn new systems they just want to get the job done. Thin Basic is good for them because it is easy to learn at the basic level yet provides a host of functionality at a higher level when needed. To help them all I need do is link TB and The Mule.

    I have already developed a low level DLL for basic control. It contains COMMs and a specialised command interpreter for a scripting language we call Bray. Bray does a good job of simplifying communications with The Mule but lacks many of the basic functions of regular computer language like loops, decision making, calculation etc.

    Rather than spend my time building these functions into Bray I decided a better way would be to hook into existing languages. We have already started to develop interfaces with a number of computer languages including Thin Basic (see link below).

    To control the Mule hardware we work through the COMM port or USB port. I was interested to know what COMMs facility might already be available through TB. I can use API functionality if necessary but always look for the easist way first !

    Reference web links...
    Mule hardware: http://www.barcodeman.com/altek/mule/
    Bray script interface: http://www.barcodeman.com/altek/mule/bray/braydll.php


  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: COMM Module?

    Lee,

    it is very interesting and I also see you did a great job with thinBasic. We are honored to see a thinBasic dedicated page in your web site.
    For us the best feedback is discovering that our language is used for real life applications. Even if now thinBasic can be considered a general scripting language, its development started some years ago exactly for that: automation in real everyday problems.

    Well, back to the issue. Because you already seems a PB customers, you can consider the option to write a new thinBasic module using thinBasic SDK for Power Basic. As PB customer you will not have licence problems on this. SDK is included into thinBasic installation and you will find it in SDK directory under thinBasic installation path. Just in case I've sent you a mail with SDK attached. All thinBasic modules are developed using thinBasic SDK for Power Basic so I suppose you will have enough interfaces to start. We can support you step by step in this development and, if needed, we can also add new interfaces to thinBasic Core. More, TBGL and TBDI modules have been developed respectively by Petr and Mike using SDK so I'm quite confident you will have no problems with SDK for PB.

    Let me know what do your think about it: thinBasic_Mule.dll module.
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #5
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: COMM Module?

    Interesting links and site. I am glad Eros mentioned the thinBasic page on your site. I dug around and see you already have a nice example.

    I am remember reading about thinBasic's history in other posts and I remember Eros saying that thinBasic started just for this type of automation control. Looks like a perfect match!!
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  6. #6

    Re: COMM Module?

    Thanks for your encouragement guys. I will take a close look the SDK to see what can be done.

Similar Threads

  1. Comm Module Comm_Recv
    By GKeely in forum COMM (Serial communication)
    Replies: 13
    Last Post: 13-03-2008, 19:01

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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