Menu

pascalscada siemens s7 1200 modbus tcp

Help
ambako
2019-02-02
2023-08-30
  • ambako

    ambako - 2019-02-02

    Hello Gentlemen

    Help my

    I want to use pascalscada for siemens s7 1200 communication using TCP_UDPPort and ISOTCPDriver, the connection is established but I cannot read the value of DB32.DBD244, the PLCTagNumber property
    memfile_db = 32
    Memaddress = 244
    memreadfunction = 3

    plcrack = 0
    plcslot = 1
    plcstation = 1

    I can not like the value

    I tried to find an error in the source in the s7family.pas file in the function
    TSiemensProtocolFamily.CreatePLC (iRack, iSlot, iStation: LongInt): LongInt;
    FPLCs [Result] .DBs is not initialized
    Does this mean that I will not be able to read DB32.DBD244?

    sorry for my english

     
  • ambako

    ambako - 2019-02-02

    Very sorry Gentleman
    I figured it out
    everything works great
    Memreadfunction=4

     
  • ambako

    ambako - 2019-02-02

    Many Thanks Mister Fabio

     
  • Fabio Luis Girardi

    Sorry for reply to late. This forum is unusable via smartphone.

    I see that you have fixed the problem. Another point that requires attention, is to disable symbolic access to created DB's. Otherwise, it can't be read.

     
  • ambako

    ambako - 2019-02-03

    Hello Fabio
    Yes i disable symbolic access
    Works perfect

    Big thanks for such work

    How can I support you, donate? How can I

     
    • Fabio Luis Girardi

      I have a paypal account. The e-mail is papelhigienico at gmail dot com
      But if you have some hardware that you are not using anymore. such as Siemens, Rockwell or Phoenix Contact, they are welcome.

       
  • ambako

    ambako - 2019-02-03

    One question
    I use plctagnumber in service but not working

     
  • ambako

    ambako - 2019-02-03

    No fire event AsyncValueChange

     

    Last edit: ambako 2019-02-03
  • ambako

    ambako - 2019-02-03

    Sorry Fabio event AsyncValueChange never fired in windows service
    I moved the code that runs the desktop application but event AsyncValueChange not fired

    Is there an example of a service? Maybe I'm doing something wrong.

    PS: If i drop timer an ontimer event call plctagnumber.read work

     

    Last edit: ambako 2019-02-03
  • ambako

    ambako - 2019-02-04

    So, i using this code for create service https://www.gocher.me/Daemon
    and work fine
    SOLVED

     
  • Fabio Luis Girardi

    Strange... This is the same implementation of LazDaemon. Another strange point is the AsyncValueChange don't work a desktop app. You really need the AsyncValueChange or you can use the OnValueChange event?

    I'll verify this later. The AsyncValueChange is usefull when you do heavy tasks that will slow down the tag updater if this tasks are fired through OnValueChange.

     
  • ambako

    ambako - 2019-02-04

    Thanks you,
    I have many tags
    When you look, when you have time, let me know if it works

     
  • Fabio Luis Girardi

    Hi ambako!

    I make a small GUI app and the AsyncValueChange works. At least one tag fires the AsyncValueChange of the tag

    Maybe on the service project you have to define CONSOLEPASCALSCADA. To define that, open menu Project -> Project options. Add -dCONSOLEPASCALSCADA as showed in attached screenshot.

     
  • ambako

    ambako - 2019-02-05

    Hi Fabio

    In GUI application works fine

    I will try your offer later and let you know

    Many Thanks

     
  • Fabio Luis Girardi

    Hi ambako!

    Improving the AsyncValueChange I discovered why it (and any other events) doesn't work on Daemons/Services, but works on Console apps:

    The TThread.Queue queues a procedure to be executed in the main Thread. How your service is running over new thread (other than MainThread) the queued procedures are fired on the main thread, not in your Service thread.

    I'll check for a solution for that, since that this support wasn't done by me, but by a contributor.

     
  • ambako

    ambako - 2020-03-04

    Hello Fabio
    I try -dCONSOLEPASCALSCADA not work
    not fired events

     
  • PHess

    PHess - 2023-08-29

    Hi Gentlemen, sorry for picking up that old topic but it fit´s to my problem.
    I´ve dowloaded "pascalscada-code-r1352-trunk-examples-laz_isotcp_demonstration" project and
    I´m trying to establish an connection to S7-1212C but without success. I have a basic question. What connection does PascalScada use to communicate with the CPU. Is the PG connection used here or do I have to generate a connection partner in my project?

    I am pretty sure that my PLC configuration is probably wrong.

    I have checked the following things.
    Symbolic addressing is disabled

    CPU can be pinged.

    DB1 with 10 double words should be ok.
    What is unclear to me is whether I have entered slot number and PLC number correctly.

    Any help is appriciated

     
    • Fabio Luis Girardi

      Do you have to enable an option on your PLC hardware settings called "Permit access with PUT/GET communication from remote partner". Together you have to disable "optmized block access" on each datablock that do you want access from PascalSCADA.

       

      Last edit: Fabio Luis Girardi 2023-08-30
  • PHess

    PHess - 2023-08-30

    Hi Fabio,
    thank you very much for your hints. I made a big step forward. I´m now able do connect to PLC, read Inputs, Outputs and Tags as well but still in trouble do get access to DB1. I´m working with TIA_PortalV13 and there is no Option in DataBlock Attributes accessabel via Webserver. So as a workaround i tried to add a read/writable Watchtable of DB1 in the Webserver Settings but that didn´t work out so far.
    What i noticed is a illegal Memory Address error in the property grid of DataModule1.DB1. I can see when I start the application MemAddress 3 although I configured in TPLCBlock MemAddress 0 that´s weird.
    Anyway i guess the solution is to get access to DB1 over Webserver but i don´t now how.

    Regards
    Peter

     
  • PHess

    PHess - 2023-08-30

    Hi Fabio,
    my bad, I´m so stupid. I had a force request to some variables in DB1 which forced them to 0.

    How can I support you ? Is your paypal account mentioned above still correct ?

     

    Last edit: PHess 2023-08-30
  • PHess

    PHess - 2023-08-30
    Post awaiting moderation.

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.