Datalink + MySQL


#1

I’ve been setting up a MySQl database to work with one of our strategies. Initially I was hoping to pull a series of records into a corresponding series of tables, configuring a list of similar devices. Does Datalink support this in any way ?

I have seen that it will iterate through the records in the table one after another and eventually loop back but there is no mention of this in the manual, or at least i did not see it mentioned. (Is this a bug or a feature ?) I would expect that a non zero flag indicates a read and that any positive value indicates a read from a specific record, but this may not be the best implementation and would require the database to have a sequential primary key at all times. I can understand the need to prevent one from accidentally importing a long table into a PAC controller but this is limited by the length of the tables in the strategy in the first place and the onus would be on the coder to control the values pulled.


DataBase                           
+----+----+----+    
|Vals|Strs|Flts|    
+----+----+----+  
|   3| "a"| 3.0|        
|   4| "b"| 2.5|        
+----+----+----+    

Result hoped for
Vals = [3,4]
Strs = ["a","b"]
Flts = [3.0,2.5]

Results returned : 
Vals = 3, Strs = "a", Flts = 3.0
and
Vals = 4, Strs = "b", Flts = 2.5

The next thing I noticed was my test server was being bombarded by Datalink, well the connections made by datalink were not being dropped by data link after the transfer was complete. I’m limiting the timeouts for datalink’s account but was curious if there is a config file or something that controls this ? Does Datalink set the interactive_timeout flag for these databases ? I haven’t tried scrounging through the runtime.xml file yet but suspect this to be the place.

I am aware of the PHP trick at https://www.internetio.com and will probably try this out later.

The cleanest solution would surely be to execute a query directly from the controller ? Has anyone tried streaming between a port opened on the server and a com handle on the controller ?


#2

Hello Carel,

Re: your last question on a direct query using a comm handle, see this post.

For these other issues/questions, I’d encourage to you contact product support, but first I’d strongly recommend getting the [URL=“http://www.opto22.com/site/documents/doc_drilldown.aspx?aid=4329”]latest-and-greatest PAC Project because it does include some improvements to ODL (R9.3d) which may be helpful to you.

Would you happen to be using (or considering using) [I]groov[/I] for this project? Because that might also change the options you’d want to consider for accessing your database.

-OptoMary