SysCom Library Usage

abrarsk
2024-08-05
2024-08-10
  • abrarsk - 2024-08-05

    Hello all,

    I am facing issues with using SysCom library. With SysCom23 library things were simple but since we are migrating to 64bit systems, I am writing a Porting program.

    With SysCom23, opening the comport was as simple as providing the ComPort no. which returns the Handle as a DWORD.

    dwHandle:=SysComOpen(Port);
    

    But the new library is a bit different. It is asking for 2 input parameters to open the Com Port - Port Number and POINTER to RTS_IEC_RESULT

    IF hCom = 0 THEN
                    hCom := SysComOpen(ComSettings.sPort, ADR(pResult));
    

    How should I use the RTS_IEC_Result? I can find RTS_IEC-REUSLT under SysType2Interfaces of SysCom library.

    Also, can someone give me a general understanding of this RTS_IEC_REULT and RTS_IEC_HANDLE, etc.?

     
  • abrarsk - 2024-08-10

    Update:

    I was able to successfully use the SysCom.lib. I had to install SysTypes2Interface library as well and wrote following code.

    Declaration

    hCom : RTS_IEC_HANDLE; 
    pResult : POINTER TO RTS_IEC_RESULT;
    

    Implementation

    hCom := SysComOpen(ComSettings.sPort, ADR(pResult));
    
     

Log in to post a comment.