Page 1 of 1

Connet Mysql with Raspberry Pi OPC UA server

Posted: 17 Jun 2014, 21:16
by samboy
Hello every, hello support team,

now I have some mySQl tables with history data and I am trying to connect one OPC UA server with mysql database. The goal is to using UaExpert to visit the OPC UA server on Raspberry Pi and get the history data from the database.

My idea is to write some codes about connecting database in the uaserver main function and then use mysql command such as SELECT ....FROM ....WHERE...IP=....

I did try to write one connection in the uaserver in the folder: examples\piface\applications\uaserverc_piface\linux but it didn't work. In the other topic I have asked about if this uaserver.c is the right one to work with.(the topic: http://forum.unified-automation.com/topic1284.html)

Here in this topic, I would like to see, if someone has any ideas about this design. Could anybody give me any suggestions or advice? Actually I am new in this field. I am not sure if this design is right or not. Besides, I haven't found a Variable type suitable to this work, for example array. Maybe because I am too fresh :-)

Thanks a lot for your answers and advice in advance.

samboy


the code I wrote in uaserver.c

Re: Connet Mysql with Raspberry Pi OPC UA server

Posted: 24 Jun 2014, 17:47
by Support Team
Hello samboy,

the ANSI C Demoserver already has some simple example for demonstrating how to build up historic data in a "file". You should digg into that example and attach the mysql database instead of the file based storage used by our example, this functionality is capsulated in the so called "datalogger module".

To understand the concepts please make yourself familiar with:
http://documentation.unified-automation ... rted7.html
and
http://documentation.unified-automation ... Server_HDA

Best Regards
Support Team