RapidGate

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #14402
    kcks66
    Participant

    Hi Mikhail,

    I finally managed to setup another PC with Rapid SCADA configuration exactly same with the target PC Rapid SCADA. I managed to login target PC via RapidGate. The next step is pls advice for which part I should configure?

    https://ibb.co/L00KSv0
    This Historical Data Transfer Option?

    https://ibb.co/GtXdzWb
    This Achieve Replication Option?

    FYI, all channels from Target PC and RapidGate PC are configured exactly same Channel ID. Target PC was configured with Archives set at ModArcPostgreSql.

    Thank you.

    #14411
    Mikhail
    Moderator

    Hi,

    Historical Data Transfer Options is needed when you can get historical data from your device, such as electricity meter. A driver should support reading historical data.

    Achieve Replication Options allow to synchronize archives between 2 instances of Rapid SCADA. It can be done manually by a command or automatically. For unknown reason, Upload options are not displayed in your screenshot.

    #14418
    kcks66
    Participant

    Hi Mikhail,

    For my case which I want to convert historical data from DAT format to store in PostgreSql database which option should I use?

    What should I do to make the Upload options that no display in my RapidGate to reappear back?

    #14422
    kcks66
    Participant

    Hi Mikhail,

    I re-setup another PC with RapidGate module. The Upload options appear in this PC.

    https://ibb.co/Zc8yNgD

    Pls advice for how should I configure to upload all historical data in DAT format from this PC to store in PostgreSql database at target PC?

    Thank you.

    #14424
    Mikhail
    Moderator

    Hi,
    Archive Replication Options are enabled. That’s correct.

    Do the following:
    1. Create a new channel of the Output type. Set tag code to GateCmd and Format to String.
    2. Set Command code of the gate to GateCmd
    3. Create a table view that helps to send commands using that channel.

    Try sending command like

    cmd=UploadArchive
    startDT=2022-07-01 10:00:00
    endDT=2022-07-01 11:00:00
    

    Watch for the Rapid Gate log files. You should see how data are uploading.

    #14428
    kcks66
    Participant

    Hi Mikhail,

    That’s great I can see historical data uploading status in the RapidGate log files. However, there is problem occur at the Target PC side:

    https://ibb.co/6HBfX7G

    Error message:

    2024-04-17 17:48:23 Error writing to database:
    Npgsql.PostgresException (0x80004005): 23514: no partition of relation “min_historical” found for row

    DETAIL: Detail redacted as it may contain sensitive data. Specify ‘Include Error Detail’ in the connection string to include this information.
    at Npgsql.Internal.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|223_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
    at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
    at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
    at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
    at Npgsql.NpgsqlCommand.ExecuteNonQuery(Boolean async, CancellationToken cancellationToken)
    at Scada.Server.Modules.ModArcPostgreSql.Logic.PointQueue.ProcessItems()
    Exception data:
    Severity: ERROR
    SqlState: 23514
    MessageText: no partition of relation “min_historical” found for row
    Detail: Detail redacted as it may contain sensitive data. Specify ‘Include Error Detail’ in the connection string to include this information.
    SchemaName: mod_arc_postgre_sql
    TableName: min_historical
    File: execPartition.c
    Line: 335
    Routine: ExecFindPartition

    Pls advice and thank you.

    #14434
    Mikhail
    Moderator

    Hi,
    Note that Rapid Gate status is written in ModRapidGate*.* log files on the machine where Rapid Gate is running.

    #14435
    Mikhail
    Moderator

    The cause of the error is that there is no partition for old data. You should create it manually using pgAdmin. SQL example:

    CREATE TABLE mod_arc_postgre_sql.min_historical_20240101_20240201 PARTITION OF mod_arc_postgre_sql.min_historical
        FOR VALUES FROM ('2024-01-01 03:00:00+03') TO ('2024-02-01 03:00:00+03')
    

    Set your own dates for the partitions. By default 1 partition covers 1 month.

    #14436
    Mikhail
    Moderator

    Use the existing partitions as examples. pgAdmin can show their SQL.

    #14440
    kcks66
    Participant

    Hi Mikhail,

    I manually create partition in pgAdmin as your advice. It’s worked.

    https://ibb.co/XzTPsHG

    Looks like my data is huge. It takes long hours to transfer few days data. I have data from 2020 to 2024 to transfer, I wonder how long will it takes to finish them.

    #14441
    kcks66
    Participant

    Hi Mikhail,

    However, I found there is data lost after upload and convert into Postgresql data.

    Below is data from DAT files before upload:

    https://ibb.co/6b9DWpD

    Below is data from PostgreSql after upload:

    https://ibb.co/gtBcMD8

    Pls advice for did I miss any steps or wrong setting?
    Thank you.

    #14443
    Mikhail
    Moderator

    Hi,
    Check ModRapidGate_XXX.txt if there are skipped records in Historical Data section.

    #14445
    kcks66
    Participant

    Hi Mikhail,

    I found many similar of this:

    2024-04-18 16:28:18 Error transferring historical data:
    System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond..
    —> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
    — End of inner exception stack trace —
    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
    at Scada.Client.ClientBase.ReceiveResponse(DataPacket request)
    at Scada.Client.ScadaClient.WriteChannelData(Int32 archiveMask, ICollection`1 slices, WriteDataFlags flags)
    at e.j()

    #14449
    kcks66
    Participant

    Hi Mikhail,

    I checked all the Calculated Channels data were not uploaded into Target PC.

    Below is data from DAT files before upload:

    https://ibb.co/8PdLRyF

    Below is data from PostgreSql after upload:

    https://ibb.co/jMzv84S

    Is this normal?
    Thank you.

    #14451
    kcks66
    Participant

    Hi Mikhail,

    After I several test and retest, I found out data lost is due to weak wifi signal from PC with RapidGate. I move the PC next to router and use LAN cable instead of wifi, problem solved.

    As for why calculated channels always 0 is due to I enable the formula with 0. I disable the formula and problem solved.

    Looks like the “converting DAT files to PostgreSql database” is success. Right now I just need to keep perform the uploading command and wait patiently until all done.

    Thanks you for the support.

Viewing 15 posts - 1 through 15 (of 23 total)
  • You must be logged in to reply to this topic.