You are not logged in.
Pages: 1
Topic closed
Hi,
Is there an example available (or could one be made), showing how to insert data into a database but using a OUTQUAD block rather than a GOTO block? I am getting a compilation error ' Invalid driver's item name', which I don't seem to be able to get round.
Cheers,
Adam
Offline
Hi Adam,
please find the example attached: db_multiflag.zip
If you need additional explanation, I'll be happy to help.
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Hi,
Jaroslav, can you please clarify naming conventions and connections between items in .rio file and block/elements in task?
In your example, in .rio file there are items i2 - i9.
In task there are:
- block named DB__i2'
- values (constants, generators) named from i2 to i9
which one from above two is important? Name of the block? (i2) Or name of the constants?
So if, for example I name my block: DB__someBlock10
then I should use in my .rio file: someBlock10, someBlock11, someBlock12 etc?
What about "i" - is it somehow connected with data type? (integer)
And btw about data types: am I reading user guide correctly and there is no way to write FLOAT type to the database?
Regards
Hubert
Offline
Hi Hubert,
it's always the string after the two underscores, which is important for the I/O driver. If you name your block DB__someBlock10, then you should use in .rio file "DB__someBlock10, i3, i4, ..., i9). In fact, the 7 remaining signals can be named arbitrarily, they just need to correspond with a column in the database table).
All the remaining blocks (constants, generators, etc.) can be named arbitrarily (though it's highly recommended to keep the block type part of the name).
As for data types, you are right, the 'i' is related to integer numbers (type long).
The column in the database table can be of type FLOAT, the value will be converted automatically on write from double to float (you might loose some precision, of course).
If you need further information, I'll be happy to help.
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Pages: 1
Topic closed