You are not logged in.
If I would like to use special signals to enable/disable database reading/writing - how do I do that?
I see proper signals in documentation, but what is the proper string defining my db action (for example archive, alarm)?
It starts from DB__ - what is next? The "Items" field from .rio config file?
Hubert
Offline
If the signal is "DB__temperature", then the signal to disable reading/writing is "DB__temeperature_Disable". Bring TRUE to its input and reading/writing will stop. See the database driver manual.
Best regards,
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Hi Jaroslav,
problem is, that I don't have any groups with name like 'DB__temperature' - I only save data from archives.
So in ODBC config window I have set up only 'Archives' tab - there are columns: 'mode', 'archiveID', 'Items' - there is no name of the signal..
Regards
Hubert
Offline
Hi Hubert,
thanks for the explanation, now I understand. In this mode the database driver copies all the contents of the archives to the database as soon as the connection is established. Therefore in this case it is necessary to prevent data from being stored in the archives.
Can you please describe your application in more detail? Why do you need to disable database writing? What function blocks are you using (ALB, ACD, TRND)? I should be able to give you some hints then.
Kind regards
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Hi Jaroslav,
reason is the same like with me previous topic - disable modbus reading and enable them again.
It happened once for now, some errors shows up:
severity message
Warning DBDRV: Archive read underflow(idx=0, arcID=1)
Error DBDRV: SQL request failed (idx=0, result=-1, sql='INSERT INTO TrndArchiveInstant (Time, GroupID, Value1, Value2, Value3) VALUES("2017-02-06 08:50:00.309934", 1206, -25.5349, -157.562, 672.131)')
Error DBDRV: SQL error detail (code=0, state='08S01', string='[FreeTDS][SQL Server]Communication link failure')
Error DBDRV: SQL request failed (idx=0, result=-1, sql='INSERT INTO TrndArchiveInstant (Time, GroupID, Value1, Value2, Value3) VALUES("2017-02-06 08:50:00.309934", 1209, 7.38731, 11.8283, 10.3945)')
Error DBDRV: SQL error detail (code=0, state='08S01', string='[FreeTDS][SQL Server]Communication link failure')
Error DBDRV: SQL request failed (idx=0, result=-1, sql='INSERT INTO TrndArchiveInstant (Time, GroupID, Value1, Value2, Value3) VALUES("2017-02-06 08:50:00.309934", 1208, 0, 0, 0)')
Error DBDRV: SQL error detail (code=0, state='08S01', string='[FreeTDS][SQL Server]Communication link failure')
and nothing is stored in my database. No archives no alarms.
I would like to monitor for such issues and in case of errors restart saving to db to fix this.
And I'm using TRND and ALNI blocks.
Regards
Hubert
Offline
Hi Hubert,
thanks for the update. I checked this with our developers and I have no workaround for you other than restarting RexCore in such a case.
This is a serious problem and we'll improve that. Thanks for pointing it out!
Kind regards,
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Hi Jaroslav,
OK, thank you for info. I'm waiting for improvements
Regarding restarting RexCore - is there some other way doing it (from the project level) than using 'External program call'?
Regards
Hubert
edit:
Is there some general DB__ flag for checking for any errors? Right now I can't find any way to detect that there is some problem with database writing.
AND unfortunately previous error happened again - so it was not just one time issue.
Last edited by hubc (2017-02-21 14:17:27)
Offline
Hi Hubert,
I'm sorry to hear you are having such troubles.
At the moment the EPC block is the only mechanism to restart RexCore from your algorithm.
No general DB__ flag is available in the current version. The only workaround I can think of is to add some auxiliary signal to write to the database. If you write it directly from the algorithm, not through the archiving subsystem, you can use special flags, e.g. _Fresh, as described in section 3.2 of the DbDrv manual. This is quite similar to the special flags of the Modbus driver you are already using.
What type of connection to the database server are you using. Is it some potentially unstable connection (wifi, 3G cellular etc.)? I'd like to investigate the root cause of this issue.
Hope this helps, let me know.
With kind regards,
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Hi Jaroslav,
My RexCore device is connected by wire (ethernet) to the same local network as the MS SQL server. They are on different subnets, so traffic goes through router and that's all.
I have no idea what is the cause of this issue. Is it possible to tell something from RexCore Errors?
Error messages always looks the same:
SQL error detail (code=0, state='08S01', string='[FreeTDS][SQL Server]Communication link failure')
Regards
Hubert
Offline
Hi Hubert,
thanks for the information. I cannot tell what is the problem. We have added the possibility to monitor database connection status and force reinitialization of the connection from the algorithm. Both will be available in nearest release.
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Hello Jaroslav,
I'm glad to hear that!
When do you plan this release?
Regards
Hubert
Offline
Hi Hubert,
no specific date can be provided at the moment. Thanks for understanding and patience.
Best regards
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Hello Jaroslav,
any updates on this topic?
Hubert
Offline
Hi Hubert,
yes, since version 2.50.4 the database driver supports "DB__Connect" output flag which you can use to reinitialize connection to the database server. Bring it to OFF and after a while back to ON and it will reconnect.
The "DB__Connected" input flag tells you the status of the connection to the server.
Hope this helps, let me know.
Kind regards
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Hi Jaroslav,
I'm happy to hear that!
Already updated my rex and put some rule to monitor DB__Time_Age flag.
I'll let you know if that will solve my issues!
Hubert
Offline
Hi everybody,
I am running my rex project with new DB__Connect flag for a few days now, and it seems to work exactly as supposed.
I noticed some DB errors (probably during backup tasks), but everything got back to working state, just as it supposed.
So I can say that my problem is solved!
Thanks!
Hubert
Offline