Wonderware Case statements

Join Date
Jan 2003
Location
Michigan
Posts
490
Does anyone know if wonderware scripting supports the case statement? It doesnt seem to, but maybe im missing something. Have a function with 24 If statements, and it could very easily be a case statement. Thanks

Matt
 
Well that stinks. And I cant call scripts from within scripts can I? Can quick functions do this? Ie, be called inside a condition script and return a value inside the script? Never used quick functions before.

matt
 
Matthias von Zorn said:
Well that stinks. And I cant call scripts from within scripts can I? Can quick functions do this? Ie, be called inside a condition script and return a value inside the script? Never used quick functions before.

matt
I think you can call scripts inside the scripts. Should not be a problem. Although I used WW almost 5-6 years back, But I feel it works.
 
Last edited:
To clarify, im not asking about the scripts, but the quick functions. Scripts wouldnt work, as the calling script wouldnt wait for the return on the other script., correct? They all run independently of each other. What im curious about, and what I havent used before, are the quick functions. They seem to be real functions, and they are called, run, and returned into the running script which can use the data on following line of the same script (ie, just like calling a function in C ). Is this correct?

matt
 
Matt...a QuickFunction should work fine just make sure it's configured as 'synchronous' and use the RETURNRESULT/RETURN mechanism to write your value back to the calling script.


Kevin H
 
Ive tried it out, and they do work nicely. Normally I do most everything in the PLC, but there is a very large amount of database work on this project, and breaking it down into functions made life much easier. I noticed in the help files that it says never to use SQL statements in asyncronous scripts. Anyone ever verify this? Just curious, I dont plan on using it that way.

matt
 
Though I try to avoid SQL in WW scripts as much as possible, WW help files are usually pretty good. If it says to not use them in asynch scripts, I'd be inclined to believe them.
 
How else do you call sql functions in WW if you dont use scripts? As far as I know, its the only way to call sql functions is with scipts, be it action, condition, change, etc.

matt
 
Do not use the asynch option for your SQL scripts. In fact last time I tried using asynch scripts in general they caused issues (memory leaks that would eventually lock up the application). After removing the asynch option everything worked fine & I have not tried them since (V7.x and V8).

To me the setup of SQL with WW is a pain, but after you get it debugged it actually works quite well.

Darren
 
Thanks, ive actually found wonderware's sql to be very powerful. Far more than something like RSView. The one thing that does burn me up is the text string length limit and the need to use those damn sql append functions to write a select statement with any kind of complexity or length.

Anyone ever use InSQL? Ive always used ODBC to link into an MDB (access) database. Are there any advantages to using inSQL? My "frontend" is always based in intouch, so does it matter what the DB is? Just curious. Thanks

matt
 
The first thing you need to do is get a copy of SQL Server Express (basically free SQL Server with some limitations, but MUCH MUCH better than Access). Get away from doing your SQL code in embedded statements in the WW scripts and do stored procedures. This will get rid of most of your hated append statements.

Get the one with advanced services and you can easily create web based interactive reports that your users can query from within a web browser.

General SQL Express info here: http://www.microsoft.com/sql/editions/express/default.mspx


Get the database here: http://msdn.microsoft.com/vstudio/express/sql/download/
 
Last edited:
Ok, so by stored procedure you mean that the sql statement is stored in the SQL express package and you call it using wonderware then? Never tried that before. There is no problem with dynamic calls then? Just pass them is as arguments? Will have to try that on the next job. Thanks.
 

Similar Topics

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
83
Hola chicos. Tengo un problema con el driver de comucicacion dasabcip 5, y un plc controllogix v34, ya realice la comunicacion pero en ciertos...
Replies
2
Views
77
Hi, I am upgrading a Wonderware SCADA form version 9.5 to version 23. I am able to migrate all the graphic, but when to activate the runtime this...
Replies
8
Views
291
Hi all, I am using OI.GATEWAY.2 to communicate to the PLC using an OPC UA. I can see the tags using an OPC explorer connecting to the...
Replies
0
Views
106
A project recently went through to replace an old computer that was running Wonderware with a new computer. After a bit of work I was able to get...
Replies
7
Views
390
Back
Top Bottom