new csv file reder driver

Forum Home Forums Communicating with Devices new csv file reder driver

Viewing 15 posts - 1 through 15 (of 33 total)
  • Author
    Posts
  • #14585
    sperate
    Participant

    Hi Mikhail,

    I’m struggling with this new driver. Trying to display Tags data with the csv file format from the git repo but can’t make it work.

    csv data :
    Timestamp,TagA,TagB,TagC
    2023-11-04 00:00:00,1.1,1,0
    2023-11-04 00:01:00,1.2,0,1
    2023-11-04 00:02:00,1.3,1,0

    Communicator device log :

    Current Data
    +---+-----------+-----------+-------+---------+
    | # | Code      | Name      | Value | Channel |
    +---+-----------+-----------+-------+---------+
    | **************** Main Data **************** |
    +---+-----------+-----------+-------+---------+
    | 1 | Tag1      | TagA      |   --- |         |
    +---+-----------+-----------+-------+---------+
    | 2 | Tag2      | TagB      |   --- |         |
    +---+-----------+-----------+-------+---------+
    | 3 | Tag3      | TagC      |   --- |         |
    +---+-----------+-----------+-------+---------+
    | ************* Reading Status ************** |
    +---+-----------+-----------+-------+---------+
    | 4 | Timestamp | Timestamp |   --- |         |
    +---+-----------+-----------+-------+---------+
    | 5 | Position  | Position  |    56 |         |
    +---+-----------+-----------+-------+---------+

    I’ve tried with RealTime and Demo but don’t understand exactly how thes two modes work.

    Thanks for your help,
    regards

    • This topic was modified 1 year, 2 months ago by sperate.
    #14587
    Mikhail
    Moderator

    Hi,

    In Demo mode the driver reads data from the CSV file repeatedly. In Real time mode the driver reads the last record having the current timestamp. Which mode is needed in your case?

    You need to continue the CSV file to make it work. Data depend on the mode.

    #14588
    Mikhail
    Moderator

    For example, switch to RealTime mode and add a new record to the CSV file with the current time.

    #14589
    sperate
    Participant

    Real time mode : what about the seconds in the current timestamp ? Do they need to match exactly ?

    I don’t know wich mode is the best for me.

    I just want to read one value for each tag. This value would be updated with a script. I think it’s real time usage but I don’t want to depend on the timestamp, or at least have a little margin.

    In Demo mode the values of the tags are updated at each read cycle on the last hour/day/month. Is that correct ?

    In this case I should use the Demo (monthly) mode with one single data line having a tiemstamp within last month for ex. ?

    #14590
    sperate
    Participant

    I’ve tried that in Demo mode and one month demo period :

    Timestamp,TagA,TagB,TagC
    2024-05-31 10:00:00,1.1,31,0
    2024-05-31 11:00:00,1.1,31,0

    But the result is always the same, and tag values in the log table are empty (—) :

    2024-05-31 15:38:44 Session with the device [3]
    No new data available
    
    2024-05-31 15:38:49 Session with the device [3]
    No new data available
    
    2024-05-31 15:38:54 Session with the device [3]
    No new data available
    #14616
    Mikhail
    Moderator

    Demo mode always use the same data. Therefore, you need Real time mode. Seconds don’t need to match exactly. Data considered up to date for 1 minute.

    #14622
    sperate
    Participant

    In Demo mode the driver reads data from the CSV file repeatedly

    How is it done on a file like this one for ex. ?

    
    Timestamp,           TagA
    2024/06/04 09:00:00, 10
    2024/06/04 09:01:00, 11
    2024/06/04 09:02:00, 12
    2024/06/04 09:03:00, 13

    What data is read repeatedly for TagA in Demo mode ?

    • This reply was modified 1 year, 2 months ago by sperate.
    #14625
    Mikhail
    Moderator

    > How is it done on a file like this one for ex. ?
    Open the file in Notepad, add a new line and save. The driver should read new data.

    > What data is read repeatedly for TagA in Demo mode ?
    Data from the CSV file is read cyclically according the timestamps. If DemoPeriod=OneHour, you should fill the file for the entire hour.

    • This reply was modified 1 year, 2 months ago by Mikhail.
    #14705
    sperate
    Participant

    We’ve lost communication with the distant computer but I’ll try as soon as we get communication back to work 😉 Thanks !

    #14823
    sperate
    Participant

    Hi, communication with the site is back and working.
    I’ve made many tries in realTime mode but still no data read from teh .csv file.

    CSV file :

    Timestamp,Day/Night
    2024-07-01 10:16:00,Day
    2024-07-01 10:17:00,Day
    2024-07-01 10:18:00,Day
    2024-07-01 10:19:00,Day
    2024-07-01 10:20:00,Day

    Log file :

    [3] Ephemerides Soleil
    ----------------------
    Driver       : DrvCsvReader 6.0.0.0
    Status       : Normal
    Session time : 01/07/2024 10:17:00
    Command time : Undefined
    
    Sessions (total / errors) : 30 / 0
    Commands (total / errors) : 0 / 0
    Requests (total / errors) : 30 / 0
    
    Current Data
    +---+-----------+-----------+-------+---------+
    | # | Code      | Name      | Value | Channel |
    +---+-----------+-----------+-------+---------+
    | **************** Main Data **************** |
    +---+-----------+-----------+-------+---------+
    | 1 | Tag1      | Day/Night |   --- |         |
    +---+-----------+-----------+-------+---------+
    | ************* Reading Status ************** |
    +---+-----------+-----------+-------+---------+
    | 2 | Timestamp | Timestamp |   --- |         |
    +---+-----------+-----------+-------+---------+
    | 3 | Position  | Position  |   144 |         |
    +---+-----------+-----------+-------+---------+

    As you can see in the csv file i’m trying to have data on the same timestamp as the read session and even data that anticipates the next read sessions.

    Do you think there may be a problem with the timestamp format ?
    I’ve used the same format as the one in the file from the git repo.

    #14824
    Mikhail
    Moderator

    Hi,
    CSV file must contain UTC time (not local).

    #14835
    sperate
    Participant

    Hi,
    I’ve tried with UTC time (-2h00 here in Fr.) but it didn’t worked either.

    Timestamp,Day/Night
    2024-07-02 08:00:00,Day
    ----------------------
    Driver       : DrvCsvReader 6.0.0.0
    Status       : Normal
    Session time : 02/07/2024 10:00:00
    Command time : Undefined
    
    Sessions (total / errors) : 2876 / 0
    Commands (total / errors) : 0 / 0
    Requests (total / errors) : 2876 / 0
    
    Current Data
    +---+-----------+-----------+-------+---------+
    | # | Code      | Name      | Value | Channel |
    +---+-----------+-----------+-------+---------+
    | **************** Main Data **************** |
    +---+-----------+-----------+-------+---------+
    | 1 | Tag1      | Day/Night |   --- |         |
    +---+-----------+-----------+-------+---------+
    | ************* Reading Status ************** |
    +---+-----------+-----------+-------+---------+
    | 2 | Timestamp | Timestamp |   --- |         |
    +---+-----------+-----------+-------+---------+
    | 3 | Position  | Position  |    46 |         |
    +---+-----------+-----------+-------+---------+
    
    #14839
    sperate
    Participant

    Ok, I’ve managed to make the real-time mode work now.
    The problem was finally yhat I wasn’t adding new lines to the csv file but just modifying the last line.
    As you said, the time must be UTC and the added data timestap must match the current time within one second minute more or less ..

    Is it possible to get rid of this mathcing time constraint ?
    For example to have the last data and timestamp added to the file read by the driver but without having the timestamp matching the current time ?

    I’m also trying the demo mode with one hour period but struggling to make data appear.
    Could you tell me what is wrong in my csv file or provide a csv example file based on this simple format :

    Timestamp,TagA
    2024/07/02 10:00:00,2000
    2024/07/02 10:01:00,2000
    2024/07/02 10:02:00,2000
    2024/07/02 10:03:00,2000
    2024/07/02 10:04:00,2000

    String Tag data values doesn’t seem to be supported, aren’t them ?

    • This reply was modified 1 year, 1 month ago by sperate.
    #14840
    sperate
    Participant

    Illustration of the real-time mode working !! 🙂

    ----------------------
    Driver       : DrvCsvReader 6.0.0.0
    Status       : Normal
    Session time : 02/07/2024 12:09:30
    Command time : Undefined
    
    Sessions (total / errors) : 219 / 0
    Commands (total / errors) : 0 / 0
    Requests (total / errors) : 219 / 0
    
    Current Data
    +---+-----------+-----------+----------------------+---------+
    | # | Code      | Name      |                Value | Channel |
    +---+-----------+-----------+----------------------+---------+
    | *********************** Main Data ************************ |
    +---+-----------+-----------+----------------------+---------+
    | 1 | Tag1      | Day/Night |              123.000 |         |
    +---+-----------+-----------+----------------------+---------+
    | ********************* Reading Status ********************* |
    +---+-----------+-----------+----------------------+---------+
    | 2 | Timestamp | Timestamp | 7/2/2024 11:57:00 AM |         |
    +---+-----------+-----------+----------------------+---------+
    | 3 | Position  | Position  |                  397 |         |
    +---+-----------+-----------+----------------------+---------+
    #14848
    Mikhail
    Moderator

    Thank you for providing a solution.
    New line is required. Also you can delete the existing file and create a new one. It should work.

    Is it possible to get rid of this mathcing time constraint ?

    This is possible to make a time difference as a parameter. I’ve made a note in the back log. If you need it in time, we can do that on paid basis.

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