Forum Home › Forums › Communicating with Devices › new csv file reder driver
Tagged: csv reader driver
- This topic has 32 replies, 5 voices, and was last updated 5 months, 3 weeks ago by
quintelosky.
-
AuthorPosts
-
May 31, 2024 at 8:11 am #14585
sperate
ParticipantHi 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,0Communicator 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.
May 31, 2024 at 9:20 am #14587Mikhail
ModeratorHi,
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.
May 31, 2024 at 9:21 am #14588Mikhail
ModeratorFor example, switch to RealTime mode and add a new record to the CSV file with the current time.
May 31, 2024 at 1:31 pm #14589sperate
ParticipantReal 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. ?
May 31, 2024 at 1:40 pm #14590sperate
ParticipantI’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
June 3, 2024 at 8:12 am #14616Mikhail
ModeratorDemo 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.
June 4, 2024 at 7:57 am #14622sperate
ParticipantIn 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.
June 4, 2024 at 11:48 am #14625Mikhail
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.
June 17, 2024 at 6:45 am #14705sperate
ParticipantWe’ve lost communication with the distant computer but I’ll try as soon as we get communication back to work 😉 Thanks !
July 1, 2024 at 8:21 am #14823sperate
ParticipantHi, 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.July 1, 2024 at 12:11 pm #14824Mikhail
ModeratorHi,
CSV file must contain UTC time (not local).July 2, 2024 at 8:03 am #14835sperate
ParticipantHi,
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 | | +---+-----------+-----------+-------+---------+
July 2, 2024 at 10:10 am #14839sperate
ParticipantOk, 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 onesecondminute 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.
July 2, 2024 at 10:11 am #14840sperate
ParticipantIllustration 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 | | +---+-----------+-----------+----------------------+---------+
July 2, 2024 at 11:23 am #14848Mikhail
ModeratorThank 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.
-
This topic was modified 1 year, 2 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.