Read/Write Access DB

georgesh

Member
Join Date
May 2016
Location
KOP
Posts
5
I am fairly new on this forum & PLC's, usually i read and get tips from here.
I use a RsLogix 5000 PLC software.

I am currently working on a project at home that requires me to read from a Access DB.

What type of Instruction or method do i go about, initially reading from Access? I know Excel is possible

Thank you in advance...
 
Is this an existing system or something being designed from scratch? If it's newer, I'd avoid Access and work with SQL. SQL Interaction is going to be easier and more sustainable as MS hardly support Access and doesn't even include it with O365 - it's an add-on package.

What is the SCADA / Visualization / HMI package being used? What version of PLC are you using with RSLogix 5000?
 
It's an existing system. Add on functionality/feature. I am using a barcode scanner that will link up to a Access DB to verify the barcode is legit and send this info to a different system via PLC/Ethernet

The access DB is used because its a older system, it uses that.

So it is possible? and guessing from what your stating, its is more involved to get the system working eventually?

PLC = A&B 1769-L23-QB1 CompactLogix Controller
 
We have done it in VBA from a SCADA platform with ADO. But it's not pretty.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms676795(v=vs.85).aspx

http://www.functionx.com/vbaccess/Lesson26.htm

Those are some links to get you started.

Do you have visualization software? As far as doing it right from the PLC I don't know. If it were a ControlLogix, then I've used OLDi module (now called SOFTING) that works well to get data between controllers and SQL DBs or iSeries Mainframes.

http://www.softing.us/ra/product/1/eatm-tmanager/
 
I've recently set up the OLDi module that xC0MMAND0x mentioned above, and it was very simple and straightforward. But as he mentioned, it needs a control logix chassis and it's a very expensive solution for one task.

If it were me, I'd be looking at whether your SCADA package (if there is one) has any such capability to do it - many can do it with VBA or VB.net as Archie mentioned above, even if it's not "natively" supported.

I don't know of any way to do it directly from the PLC, but I'm going to hang around in case someone knows of one, I always like learning new things ;)
 
I am using FactoryTalk View Studio as HMI, do not have SCADA.
I have a control logix chassis.

Just a terminology clarification here...

FactoryTalk View Studio is the development software that develops applications.

The ME (machine edition) version develops applications for both PanelView Plus HMI's and FactoryTalk View Machine Edition Stations.

The SE (site edition) version develops applications for SCADA stations/servers/clients.

So, you are not using FactoryTalk View Studio as a HMI, though you are likely developing your HMI/SCADA/operator interface using FactoryTalk View Studio.

If I had to guess, I would suggest that you've got a PanelView Plus HMI, running an application created in FactoryTalk View ME, am I correct?
 
Archie's free AdvancedHMI has to be the best free, open-source, HMI software that is available. I currently use it for a Home Automation system to pass data back and forth to SQL as a communication bridge between the PLC and the home automation network. It is very robust. I will soon be using it to set up data collection & reporting for a customer. They are thrilled because there is no licensing cost associated.
 
I have to ask...what sort of home automation system do you run that includes an SQL database?!
 
I'm running HomeSeer with Z-wave components, but that does not use SQL natively. I read/write to SQL from HomeSeer VB.net scripts.
 
Just a terminology clarification here...

FactoryTalk View Studio is the development software that develops applications.

The ME (machine edition) version develops applications for both PanelView Plus HMI's and FactoryTalk View Machine Edition Stations.

The SE (site edition) version develops applications for SCADA stations/servers/clients.

So, you are not using FactoryTalk View Studio as a HMI, though you are likely developing your HMI/SCADA/operator interface using FactoryTalk View Studio.

If I had to guess, I would suggest that you've got a PanelView Plus HMI, running an application created in FactoryTalk View ME, am I correct?


Thank you for the clarification. Yes i am using the ME edition. I first wanted to acess the Access DB and confirm whether the Bar code is within the DB and later on output the notification when success read, then display on HMI
 
No problem. As you have a Control Logix chassis but no SCADA, the OLDi module is a good bet if you can justify the cost. Expensive hardware, but super easy - if time is money you may find it ends up being the most cost effective solution despite the upfront cost.

Or else you'll likely have to look at a PC and a SCADA application to do the trick. If you go that way, I'd be hinting towards Archie's Advanced HMI - I've not used it myself yet, but from what I hear it's pretty good, and the support is good, and it's free. I'm actually thinking about setting it up for my own home automation project on a Raspberry Pi :)
 
RSBizWare and FactoryTalk Metrics

Is there a better solution for the issue i have? from what i researched so far, RSBizWare and FactoryTalk Metrics is the additional software package for this functionality.

is there any other method for me to get this working?
i.e Retrieve data from Microsoft Access DB?
 
I don't know if you ever resolved this, I've done a bit of programming in both Access and the FactoryTalk HMI, just not together. Within the VBA project window of the Display you are working with, if you set a reference (Tools, References) to the Microsoft Access xx.x Object library, you should be able to use the Access objects.

You'll need to create an Access object, then refer to it. After that, it is pretty much like programming in any Microsoft VBA environment.

This is some Access code I use, outside of FTView:

Public Sub BuildInventoryHistory()
On Error GoTo Proc_Error

Dim ws As Workspace
Dim dbCurr As Database
Dim rstHistory As Recordset
Dim rstProduct As Recordset
Dim rstPeriods As Recordset
Dim rstBeginningBal As Recordset

Dim arrHistory As Variant
Dim arrProduct As Variant

Dim strSQL As String
Dim intRow As Integer
Dim intProdRow As Integer
Dim intMinProd As Integer
Dim intMaxProd As Integer
Dim dblMinPeriod As Double
Dim intCurrPeriod As Integer
Dim strCurrDate As String
Dim bolHasData As Boolean
Dim intPrecision As Integer
'
' Set up
'
' Set dbCurr = CurrentDb ' Replace this with the set dbCurr below, put the appAccess above it
'
' Load History from qryInventoryCalc (monthly net tons by product)
'
Set rstHistory = dbCurr.OpenRecordset("qryInventoryCalc")
rstHistory.MoveLast
rstHistory.MoveFirst
arrHistory = rstHistory.GetRows(rstHistory.RecordCount)
'
' Load Product with list of all products
'
strSQL = "SELECT CodeID " _
& "FROM tblCodes " _
& "WHERE CodeTypeID = 1 ORDER BY CodeID;"
Set rstProduct = dbCurr.OpenRecordset(strSQL)
rstProduct.MoveLast
rstProduct.MoveFirst
arrProduct = rstProduct.GetRows(rstProduct.RecordCount)


once the data gets into the array, you can use it as you want. The first instance uses a pre-built query, the second create an sql query; both return a recordset and then move the recordset into the array.

You will first need to create a reference to the Access application, after creating the application object:

dim appAccess as Application

then in the code below, create an instance of it:

Set appAccess = New Access.Application

use the application object to open your database:

Set dbCurr = appAccess.OpenAccessProject("\\MyServer\MyPath")

and go from there.
 

Similar Topics

Is it possible to partially restrict the types of communications allowed through a ControlLogix communications module? Ideally I'd like something...
Replies
7
Views
3,319
When using multiple controller systems I used to using either produced/consumed tags or messaging functions to transfer data between controllers...
Replies
4
Views
8,562
I have been using dotnet and OPC servers (NI and Kepware) to communicate with Allen Bradley Micrologix 1400 PLC on different environmental...
Replies
2
Views
5,794
Hi everyone, I am working on a project that needs to expose the SV (Set Value) of a temperature controller to a SCADA system. SCADA <-...
Replies
4
Views
160
Thank you for any and all responses/help. I have an RSLogix 5000 v20 and a Cognex In-Sight v5.9 spreadsheet (8502P). I can not figure out how to...
Replies
0
Views
129
Back
Top Bottom