Wonderware Guru's Please

You need to just dig in a learn it. The hardest part is scripting; if you've had any HMI experience, you'll have to search around to find out what Wonderware has and doesn't have. If you can make a box you can animate it in all sorts of ways.

It isn't high tech... I'm still wondering why it's the HMI of choice. Other than running on Windows! :D

Make a practice system and play around with it. I think you might find that easy enough to do, what with their licensing system and all, hint hint.

Disclaimer: "Don't copy your license!" :p
 
I actually find the scripting to be pretty easy. I took a training class that helped me get the basics, then the rest was mostly learning on the fly by seeing what people did in other projects. Im not an expert by any means, but can do pretty well with wonderware.

Id recommend trying to find a few projects from some colleagues or on the web somewhere to help you learn.
 
how to view ms access data in sheet format in ww window

Ive developed over 100 apps in 4 different versions of wonderware, and would be happy to answer any questions you may have. Unfortunetly, ive never used the PLCs your using. So ill help ya where I can.

Matt

Please tell the step-by-step method of viewing Data From Microsoft Access & how to show it in Excel format in wonderware window. I am able to store data into Access table through ODBC acces table. Using SQLInsert() statement but not able to retrive it using ResultCode=SQLSelect(). More over i want this retrival in excel format as i want to daily report from the access database recorded. Plz help thanks in advance.
 
Look up bindlists in the wonderware help. They are basically a list that ties a database column on a table with a tag name. ODBC is set up in the administrator section of the control panel in windows under ODBC. Simply create a DSN name in the ODBC setup and point it to your database. Then the SQLConnect command is pointed to this DSN created in the ODBC. Google windows ODBC setup if you need more help.
So,

Create ODBC DSN entry in windows pointing to your database
Create bindlist in wonderware linking your column names to your tag names
In a script at some time (I usually do it in the app script) run a SQLConnect command to create a database connection to that DSN
Then, when you want to record data, run a script with an SQLInsert command with the bindlist and DB Connection. See the wonder help on these commands.

Matt

Hello Matt, I am having difficulties to use the SQLSelect command in Wonderware. Whenever I attemp to run my application a get an "Invalid Pointer" error.

I know that the ODBC DNS entry is OK, and I can successfully connect to the database using the SQLConnect command. So, my guess is that I am not configuring properly the bind list.

What I did was to create a Memory Integer tag and match it with the column name that I am trying to retrieve, but apparently there is something wrong in it.

Could you explain a little bit further on this matter?

Thanks
 
Serafin,
First thing I would do is check the wonderware log in the system management console to make sure WW did throw an error on the sqlconnect. It may also have some more info on the failed insert.

Here is the insert command

[ResultCode=]SQLInsert(ConnectionID,TableName, BindList);


Result code is optional.


ConnectionID is the int tag you used in creating the conenction.

TableName is the name of the table in the database. This is a tag value or, if not, since its a string, put it in " "s.

Bindlist is the same.


So, for example


SQLInsert(ConnectionID,"MyDBTable","MyWWBindList");


That should stamp into the database the values in the bindlist. This works if you used the int tag ConnectionID as the tag name in your connect command. Like this


SQLConnect(ConnectionID, "DSN=MAIN");


Hope it helps.



Matt
 
Thanks for the information Matt,

I have tried to connect to the database without applying any other command, and I have no problems with that.

But when I use the SQLSelect command i get this output in the logger:

Code:
VIEW   Loading Script DLL: WWSQL.DLL
WWSQL  7,1,008,0917
WWSQL  -1: Invalid Pointer
WWSQL  Error>> Select SELECT MyColumn FROM MyTable WHERE MyPrimaryKey = 1
WWSQL  -1011: No Rows were selected

I have tried exactly the same query from an external connection (not from wonderware) to the database and successfully retrieved the data.

What caught my attention is that the word "Select" is repeated in the logger (with different capitalization)...


This is the code that I am using in Wonderware:

Code:
ResultCode = SQLConnect(ConnectionID, "DSN=MyDSN");

IF ResultCode == -1 THEN
     texto = SQLErrorMsg(ResultCode);
ENDIF;

ResultCode = SQLSelect(ConnectionID, "MyTable", "MyBindList", "id = 1", "");

IF ResultCode == -1 THEN
     texto = SQLErrorMsg(ResultCode);
ENDIF;

ResultCode = SQLEnd(ConnectionID);
ResultCode = SQLDisconnect(ConnectionID);

Any thoughts?
 
For now I am just using two fields of the table:

FIELD NAME --- TYPE --- LENGTH --- NULL? --- PK
id_entrada --- int --- 11 --- NO --- X
consecutivo --- int --- 11 --- NO ---

I made a simple bindlist to try to retrieve the "consecutivo" field given a hard-coded or user input "id_entrada" field.

I had attached the bindlist image for your reference

Bindlist.jpg
 
Serafin,

A couple of things:

1. Your field name is 'id_entrada', so I would think that your where expression should read "id_entrada = 1", not "id = 1"

2. Try a SQLFirst(ConnectionID) statement immediately after your SQLSelect.

Just a couple of things to try. Please try them one individually to see if either will solve your issue.
 
My first thought is your primary key. Normally, thats not something you select for. So, if remove the where part and just do the select on the column. See if it returns results.

try this is and see what happens

SQLSelect(ConnectionID, "MyTable", "MyBindList", "", "");


Heh, cross post!

Try what jshiepe said above.
 
Last edited:
Matt, jshiepe,

Sorry for the confusion. The where part is OK, I used two different names here, but I actually used the correct primary key in the application. The problem isn't there.

I have actually tried both recommendations before and got the same result: an "Invalid Pointer" error returned by MySQL. I believe that the query is not even sent to the database because I don't find it within "myodbc.log", and the error is in another part of the communication between my computer and the db server.

When I try the SQLFirst command I get the "No rows selected" error (it is expected since the select didn't work). When I try to perform the select command without WHERE clauses I get the same and annoying "Invalid Pointer" error.

Did you have a chance to take a look to the bindlist. There is no much science in it, but just wanna make sure that I am not missing anything.

The other suspicious element here is my ODBC driver. I am using the 2.50.19 MySQL version from TCX DataKonsult AB (do you know by any chance which boxes need to be checked in "Options that affects the behavior of MyODBC"?), which is quite old, but I wasn't able to install a newer driver under Windows NT. I have to mention that my application is running in a virtual machine.

Please refer to this thread for further information:

http://www.plctalk.net/qanda/showthread.php?t=70389


Thanks a lot for your help!
 
Im guessing here but I seem to recall an issue with MySQL and wonderware in ODBC. Try using sqlexpress or access as a test database. The select statement, without a where argument should return rows. Ive also used firebird successfully as well.


Who knows what issues NT is throwing at you. Its SO old. If this is virtualized, cant you run a new os then NT??
 
Last edited:

Similar Topics

Some upgrading questions.... I have clients that want to upgrade to the latest Wonderware 2012 R2 aka 10.6 version, running on windows 7. Some of...
Replies
8
Views
8,015
Hi guys, I have experience with PLC to Excel etc...just starting on using intouch scada screens. I have an Excel sheet that uses mainly...
Replies
1
Views
138
Hello everyone, Recently, my Archestra IDE shut down while I was editing. After restarting the IDE, I noticed warning symbols under my opened...
Replies
1
Views
101
Good morning all. I'm working on a rehab where they had a standalone InTouch 2014 HMI that they called a SCADA, but it's really basic stuff. The...
Replies
4
Views
181
Hi, We are setting up an Aveva Plant SCADA node with the intention to connect it to a Wonderware Historian node. Everywhere I look online I see...
Replies
1
Views
171
Back
Top Bottom