This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

guidance on databases in logic machine
#1
Hello, Sorry for asking a lot, but you do not find many
things about the logical machine, like on this site


When working with MySQL database in logic machine, what user,
database name, server, and password should I connect to? A logic machine? How
do I know what it is?

After

When I want to select a table like I know the name of the table that I have to select? With their respective fields or columns, a serious example would be: select the database the group address with its data type, current value, and date on which current value update of that group address
 

Then I could send that data obtained from outside the logic machine,
from the application of the logic machine and take it to my application to read
those data from the database of the logic machine?

 
 
Reply
#2
In most cases you don't need to access internal database directly but use provided functions instead. To get all objects you can use grp.all(): http://openrb.com/docs/lua.htm#grp.all

Here's an example that logs group address, name and current value for first 5 objects:
Code:
objects = grp.all()

for i, object in ipairs(objects) do
  log(object.address, object.name, object.value)
  if i == 5 then
    break
  end
end
Reply
#3
(07.09.2017, 06:04)admin Wrote: In most cases you don't need to access internal database directly but use provided functions instead. To get all objects you can use grp.all(): http://openrb.com/docs/lua.htm#grp.all

Here's an example that logs group address, name and current value for first 5 objects:
Code:
objects = grp.all()

for i, object in ipairs(objects) do
 log(object.address, object.name, object.value)
 if i == 5 then
   break
 end
end
Hi,thank you very much if it works for me
Reply


Forum Jump: