Variable Passing from One POU to another

musman

Member
Join Date
Nov 2014
Location
Munich
Posts
20
Hello, I am writing a program for WAGO 750-880. I have made three POU,s. One is PLC_PRG (PRG) in which two other POU's are called. One is Power Measurement (FB) and other is SQL (FB). Power Measurement calculates the real time data, send the data to PLC_PRG which then passes the data to SQL so that data can be saved in SQL Database. The problem is that in SQL Program, I am using the following query

'INSERT IGNORE INTO buchloe (current_1,current_2) VALUES (IL_3 , 30.9)'

I am trying to send the value through variable IL_3 but query is not accepting it.

Any suggestions how to do it? What am I missing? I have already tried 'IL_3', $'IL_3$'. It didn't work....
 
The problem is, IL_3 is a variable name so it cannot be inserted directly into the SQL command literal string - the system thinks it is a vaue of "IL_3".

Try the following:

strSQL := 'INSERT IGNORE INTO buchloe (current_1,current_2) VALUES (';
strSQL := CONCAT(strSend, IL_3);
strSQL := CONCAT(strSend, ' , 30.9)');

Of course your IL_3 variable must be of STRING data type.
 

Similar Topics

Hi All, I am trying to pass a variable from Genie to Supergenie. I created a supergenie page with a whole lot of texts, custom genies and numeric...
Replies
4
Views
2,806
Hello again good people of the forum, Today's challenge should you choose to accept it, is to explain to me the best/easiest way to send a...
Replies
1
Views
1,672
Just wandering, is it possible to send the values in a couple of InTouch tags directly to a VBScript I’m currently writing. Thanks
Replies
1
Views
2,083
I'm upgrading an existing machine with a Honeywell HC900 controller, and I'm trying to do some data processing in the controller. I have variables...
Replies
0
Views
56
dear all.. i am designing the Sea Water Intake pump which the 4 pumps will be operated parallel, and 1 pump will be as stand by pump The pump data...
Replies
3
Views
157
Back
Top Bottom