SBA.OpenSocket

NoelineNoeline Member Posts: 54
Hi there

Is it possible to use this to open the com1 port? If so, how do you reference it? Ihave searched the help and Mibuso but not found any example of a com port being opened. If not this any other suggestions?

I need to read the weight from a scale sent through RS232. I have tried nfcomm but could not get it working and mscomm has got licence issues.

Regards - Noeline

Comments

  • todrotodro Member Posts: 117
    Noeline wrote:
    Hi there

    Is it possible to use this to open the com1 port? If so, how do you reference it? Ihave searched the help and Mibuso but not found any example of a com port being opened. If not this any other suggestions?

    I need to read the weight from a scale sent through RS232. I have tried nfcomm but could not get it working and mscomm has got licence issues.

    Regards - Noeline
    Hi,

    sorry, you can not use the socketbusadapter for this task, it can only be used for TCP connectivity.

    You can use the MSCOMM32.OCX automation server to access the com port.

    In case you need an example, I can dig for some sapmle code.
    Torsten
    MCP+I, MCSE NT, Navision MCT (2004,2005)
  • NoelineNoeline Member Posts: 54
    Thanks for the response.

    I have tried mscomm32 but have a license issue on the client computer and don't know how to obtain a license. ](*,)

    Anyhow, I will follow that up now if Navision Automation won't work.
  • todrotodro Member Posts: 117
    Noeline wrote:
    Thanks for the response.

    I have tried mscomm32 but have a license issue on the client computer and don't know how to obtain a license. ](*,)

    Anyhow, I will follow that up now if Navision Automation won't work.
    You are right, MSCOMM32.OCX is part of Visual Studio, you need a valid VS installation for it to be used. Even if a run-time license is installed on the target computer when installing another application, for using it in a developing environment, you need a valid VS.

    So if you do not have VS, this doesn't seem to help. Let me check, I remember a free solution but do not recall it by heart. I'll keep you posted
    Torsten
    MCP+I, MCSE NT, Navision MCT (2004,2005)
  • NoelineNoeline Member Posts: 54
    Me again

    I found a free OCX called NetComm.OCX which basically does what MSComm32 does. I will test it this week when I visit the client and report back if I am sucessful.
  • todrotodro Member Posts: 117
    Noeline wrote:
    Me again

    I found a free OCX called NetComm.OCX which basically does what MSComm32 does. I will test it this week when I visit the client and report back if I am sucessful.
    Hi,

    in case your test fails, I could recompile the automation server I was using long time ago. (Which is simply based on WIN32 API and doesn't need the MSCOMM32 at all)
    Torsten
    MCP+I, MCSE NT, Navision MCT (2004,2005)
  • NoelineNoeline Member Posts: 54
    The NetComm.OCX appears to be working. Still need to set it up properly in the app, but so far so good.

    Thanks for your help though. Much appreciated. :)
  • RachelSoonRachelSoon Member Posts: 202
    Noeline wrote:
    The NetComm.OCX appears to be working. Still need to set it up properly in the app, but so far so good.

    Thanks for your help though. Much appreciated. :)

    Hi Noeline,
    would you like to share the code for the Netcomm?

    i am using the netcomm for the AT command. And my code does not work.
    How can i append the "enter" or the "ctrl+z" at the output command?
    I would like to use SENDKEY, but the NetComm only accept the string, i have to build the string before passing into the Netcomm.Output.

    strSetting := '115200,N,8,1';
    strSetToTextMode := 'at+cmgf=1' + char13;

    NetComm.Settings := strSetting;
    NetComm.CommPort := 12;
    NetComm.PortOpen := TRUE;
    NetComm.Output := strSetToTextMode;

    strOutputText := 'at+cmgs=' + Customer."Phone No." + char26+char13 ;

    NetComm.Output(strOutputText);

    Thank you.

    Regards
    Rachel
  • RachelSoonRachelSoon Member Posts: 202
    Dear All,
    The working code should be :

    ==============================================
    C13 and C26 has been declared as a variable, Char datatype. 13 and 26 is the ASCII for enter and ctrl+Z.
    =========================================

    C13 := 13;
    C26 := 26;

    strSetting := '115200,N,8,1';
    strSetToTextMode := 'at+cmgf=1' + FORMAT(C13);

    NetComm.Settings := strSetting;
    NetComm.CommPort := 12;
    NetComm.PortOpen := TRUE;

    NetComm.Output := strSetToTextMode;

    strOutputText := 'at+cmgs=' + strMobileNo +
    FORMAT(C13) + strSMS + FORMAT(C26) +
    FORMAT(C13);

    NetComm.Output(strOutputText);

    NetComm.PortOpen := FALSE;
Sign In or Register to comment.