Coder Social home page Coder Social logo

fluisgirardi / pascalscada Goto Github PK

View Code? Open in Web Editor NEW
31.0 7.0 12.0 18.11 MB

PascalSCADA for Lazarus

Home Page: http://www.pascalscada.com

License: GNU Lesser General Public License v2.1

Pascal 100.00%
scada siemens modbus modbus-tcp modbus-rtu pascal lazarus object-pascal west-ascii tags

pascalscada's Introduction

PascalSCADA 1.0 - A multiplatform SCADA framework for Lazarus

These components allow stabilish communications with Modbus RTU, Modbus TCP, Siemens PLC and Mitsubish Melsec devices in a easy way (this means: without write code), through window controls (buttons, sliders, animations), tags, protocol drivers and port drivers, without lose advanced features that you can implement using code.

This code is a entire rewrite of PascalSCADA hosted at https://sourceforge.net/projects/pascalscada. The main goal of this initiative is:

  1) Fix some design shortcomings of the actual version of PascalSCADA (0.7.3). A example is the low number of tags that can be inserted in a project form in design time. For more then 1000 tags per form or datamodule, you should create tags in runtime, via source code.
  2) Performance, performance and more performance.
  3) Split some interfaces that has more than one function. By example IHMIInterface, that handles security for HMI controls and serves as Tag interface.
  4) Improve the translation, using .PO files instead of language defines;
  5) Improve the project modularization
  6) Extend the security system to all standard controls of Lazarus
  

This code is under modified LGPL (see LICENSE.modifiedLGPL.txt). This means that you can link this library inside your programs for any purpose. Only the included part of the code must remain LGPL.

If you make some improvements to this library, please create a new issue and attach the patch of your changes.

Contact : fabio at pascalscada.com

pascalscada's People

Contributors

fluisgirardi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pascalscada's Issues

install pascalscada.db error

Warning: other unit files search path (aka unit path) of "zcomponent 8.0" contains "C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\zeosdbo\src\component", which belongs to package "zcomponentdesign"
编译软件包pascalscada_db 0.7.7: 退出代码1,错误: 1
ZPropertyEditor.pas(70,5) Fatal: 不能找到PropEdits 由 ZPropertyEditor 使用. 确保员工软件包的所有ppu文件在它的输出目录中。 ppu在错误目录=d:\lazarus\components\ideintf\units\x86_64-win64\win32\propedits.ppu. 清理软件包"IDEIntf"..

SCALE PROCESSORS

Do you have demo of SCALE PROCESSORS ?
userScale : input aways is 0 .

Bug or logical oversight

I am trying to get PascalSCADA to compile with both D7 and Tokyo. Except for the HMI stuff, I have managed the rest to compile.

While doing that, Tokyo highlighted a potential bug, or a logical error in 2 routines.

Namely,

in function TMelsecDriver.DoRead()

        if FRemainingBytes > 0 then begin
          res := PCommPort.IOCommandSync(iocRead, 0, nil, FRemainingBytes, DriverID, 0, @IOResult2, starts, ends);

          if res <> 0 then begin
            IOResult1.BufferToRead := ConcatenateBytes(IOResult1.BufferToRead, IOResult2.BufferToRead);
            IOResult1.Received := IOResult1.Received + IOResult2.Received;
            if IOResult2.ReadIOResult <> iorOK then IOResult1.ReadIOResult := IOResult2.ReadIOResult;
          end else Result := ioDriverError;
        end;
        Result := DecodePkg(IOResult1, values);

shouln't it be

        if FRemainingBytes > 0 then begin
          res := PCommPort.IOCommandSync(iocRead, 0, nil, FRemainingBytes, DriverID, 0, @IOResult2, starts, ends);

          if res <> 0 then begin
            IOResult1.BufferToRead := ConcatenateBytes(IOResult1.BufferToRead, IOResult2.BufferToRead);
            IOResult1.Received := IOResult1.Received + IOResult2.Received;
            if IOResult2.ReadIOResult <> iorOK then IOResult1.ReadIOResult := IOResult2.ReadIOResult;
            Result := DecodePkg(IOResult1, values); <<<---- HERE
          end else Result := ioDriverError;
        end;

similarly

in function TMelsecDriver.DoWrite()

        if FRemainingBytes > 0 then begin
          res := PCommPort.IOCommandSync(iocRead, 0, nil, FRemainingBytes, DriverID, 0, @IOResult2);

          if res <> 0 then begin
            IOResult1.BufferToRead := ConcatenateBytes(IOResult1.BufferToRead, IOResult2.BufferToRead);
            IOResult1.Received := IOResult1.Received + IOResult2.Received;
            if IOResult2.ReadIOResult <> iorOK then IOResult1.ReadIOResult := IOResult2.ReadIOResult;
          end else Result := ioDriverError;
        end;
        Result := DecodePkg(IOResult1, tempValues);
      end else Result := ioEmptyPacket;

shouln't it be

        if FRemainingBytes > 0 then begin
          res := PCommPort.IOCommandSync(iocRead, 0, nil, FRemainingBytes, DriverID, 0, @IOResult2);

          if res <> 0 then begin
            IOResult1.BufferToRead := ConcatenateBytes(IOResult1.BufferToRead, IOResult2.BufferToRead);
            IOResult1.Received := IOResult1.Received + IOResult2.Received;
            if IOResult2.ReadIOResult <> iorOK then IOResult1.ReadIOResult := IOResult2.ReadIOResult;
            Result := DecodePkg(IOResult1, tempValues);  <<<---- HERE
          end else Result := ioDriverError;
        end;
      end else Result := ioEmptyPacket;

LockList/UnLockList

in unit 'pascalscada.protocols.customprotocol.pas'

procedure TpSCADACustomProtocol.TagScanTick;
var
  list: TpSCADAThreadTagAddressInfoList.TpSCADAGenericThreadListType;
  i: Integer;
begin
  if Assigned(FTagList) then begin
    list:=FTagList.LockList;
    try
      {irrelevant code}
    finally
      FTagList.LockList; {<--- this should be UnLockList}
    end;
  end;
end;

Displayed when an exception is encountered

SerialPortDriver1 -> ModBusRTUDriver1 -> PLCTagNumber1 -> HMILabel1 .
It can be work , but when com1 is error , for example : other program use this com1 .
my code is below :
try
SerialPortDriver1.ComPort := cbbComName1.Text
except
on E:Exception do
begin
PLCTagNumber1.AutoRead := False;
PLCTagNumber1.Write(-1);
end;
end;

PLCTagNumber1 always show last number , not 0.0 or -1 ;
why ?

install pascalscada_db. & pascalscada_full error

消息(&M),警告:10,提示:8
Warning: other unit files search path (aka unit path) of "zcomponentdesign 8.0" contains "C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\zeosdbo\src\component", which belongs to package "zcomponent"
Warning: other unit files search path (aka unit path) of "zcomponent 8.0" contains "C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\zeosdbo\src\component", which belongs to package "zcomponentdesign"
Note: 重复单元 "" 在 "pascalscada_db 0.7.7", ppu="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\usrmgnt_login.ppu", source="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\usrmgnt_login.lfm"
Note: 重复单元 "usrmgnt_login" 在 "pascalscada_hmi 0.7.7", ppu="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\usrmgnt_login.ppu", source="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\src\hmi\usrmgnt_login.pas"
Note: 重复单元 "" 在 "pascalscada_db 0.7.7", ppu="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\unumerickeyboard.ppu", source="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\unumerickeyboard.lfm"
Note: 重复单元 "unumerickeyboard" 在 "pascalscada_hmi 0.7.7", ppu="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\unumerickeyboard.ppu", source="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\src\hmi\unumerickeyboard.pas"
Note: 重复单元 "" 在 "pascalscada_db 0.7.7", ppu="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\ualfakeyboard.ppu", source="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\ualfakeyboard.lfm"
Note: 重复单元 "ualfakeyboard" 在 "pascalscada_hmi 0.7.7", ppu="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\ualfakeyboard.ppu", source="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\src\hmi\ualfakeyboard.pas"
Note: 重复单元 "" 在 "pascalscada_db 0.7.7", ppu="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\tagstatuslist.ppu", source="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\tagstatuslist.lfm"
Note: 重复单元 "tagstatuslist" 在 "pascalscada_hmi 0.7.7", ppu="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\tagstatuslist.ppu", source="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\src\hmi\tagstatuslist.pas"
Warning: Duplicate file "tagstatuslist.lfm" in "pascalscada_db 0.7.7", path="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\tagstatuslist.lfm"
Warning: Duplicate file "tagstatuslist.lfm" in "pascalscada_hmi 0.7.7", path="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\src\hmi\tagstatuslist.lfm"
Warning: Duplicate file "ualfakeyboard.lfm" in "pascalscada_db 0.7.7", path="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\ualfakeyboard.lfm"
Warning: Duplicate file "ualfakeyboard.lfm" in "pascalscada_hmi 0.7.7", path="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\src\hmi\ualfakeyboard.lfm"
Warning: Duplicate file "unumerickeyboard.lfm" in "pascalscada_db 0.7.7", path="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\unumerickeyboard.lfm"
Warning: Duplicate file "unumerickeyboard.lfm" in "pascalscada_hmi 0.7.7", path="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\src\hmi\unumerickeyboard.lfm"
Warning: Duplicate file "usrmgnt_login.lfm" in "pascalscada_db 0.7.7", path="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\lib\x86_64-win64-win32\usrmgnt_login.lfm"
Warning: Duplicate file "usrmgnt_login.lfm" in "pascalscada_hmi 0.7.7", path="C:\Users\kerwin\AppData\Local\lazarus\onlinepackagemanager\packages\PascalSCADA\src\hmi\usrmgnt_login.lfm"
编译软件包pascalscada_db 0.7.7: 退出代码1,错误: 1
ZPropertyEditor.pas(70,5) Fatal: 不能找到PropEdits 由 ZPropertyEditor 使用. 确保员工软件包的所有ppu文件在它的输出目录中。 ppu在错误目录=D:\lazarus\components\ideintf\units\x86_64-win64\win32\propedits.ppu. 清理软件包"IDEIntf"..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.