Sunteți pe pagina 1din 4

Problem with send data from Vijeo citect to SQL By triger - Modicon / T... http://forums.mrplc.com/index.php?/topic/30849-problem-with-send-data...

Home Forums Store Downloads Articles Contact

  Existing user? Sign In  

Browse

Forums

Home PLCs and Supporting Devices Modicon / Telemecanique / Schneider Electric

Problem with send data Sign in to follow this  

from Vijeo citect to SQL By triger


Started by moamed, 12 Jun 2016

2 posts in this topic

moamed Posted 12 Jun 2016

Newbie
Hi Guys 
I tray to write Cicode that send data from Vijeo citect to SQL
Automatic or i mean By triger
this is the code but it didn't work 
Please any one can help me
{{

MrPLC Member FUNCTION excel()


0
6 posts INT hSQL;
Egypt STRING sSQL;
IF report_Triger=1 THEN
hSQL = SQLConnect("Provider=SQLOLEDB.1;Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=ias;Data
Source=ABDELWAHED-PC\WINCC");
SQLExec(hSQL, sSQL);
sSQL = "INSERT INTO dbo.test1 (level1,level2,
level3,level4,Final_level) 
              VALUES("level1","level2","level3","level4","level")";

1/4 14.01.2020 13:56


Problem with send data from Vijeo citect to SQL By triger - Modicon / T... http://forums.mrplc.com/index.php?/topic/30849-problem-with-send-data...

END
END

}}

moamed Posted 13 Jun 2016

Newbie

it work

this the final code

{{

MrPLC Member
0 FUNCTION Report_time()
6 posts INT hSQL;
Egypt INT result_Report;

STRING sssdate;
STRING ssstime;
STRING ssslevel11;
STRING ssslevel21;
STRING ssslevel31;
STRING ssslevel41;
STRING ssslevel;

//sssdate = Date();
sssdate =TimeToStr(TimeCurrent(),1);
ssstime =TimeToStr(TimeCurrent(),3);
ssslevel11=level1;
ssslevel21=level2;
ssslevel31=level3;
ssslevel41=level4;
ssslevel =level;

hSQL = SQLConnect("DSN=Abdelwahed");

2/4 14.01.2020 13:56


Problem with send data from Vijeo citect to SQL By triger - Modicon / T... http://forums.mrplc.com/index.php?/topic/30849-problem-with-send-data...

result_Report = SQLExec(hSQL, "INSERT INTO level_time_2


(time,date,level1, level2,level3, level4, Final_level)
VALUES ('" + sssdate + "','" + ssstime + "','" + ssslevel11 +
"', '" + ssslevel21 + "','" + ssslevel31 + "','" + ssslevel41 +
"','" + ssslevel + "')");

SQLDisconnect(hSQL);

END

}}

to move new line to table i create push button and write in it's
input command

function name -> Report_time()

every time i press the push button new line create in table
with new values

last thing i want to do


instead of this push button i need to use trigger

certain variable when it's value change from 0 to 1 new line


create in table with new values

3/4 14.01.2020 13:56


Problem with send data from Vijeo citect to SQL By triger - Modicon / T... http://forums.mrplc.com/index.php?/topic/30849-problem-with-send-data...

Create an account or sign in to comment


You need to be a member in order to leave a comment

Create an account Sign in


Sign up for a new account in our Already have an account? Sign in here.
community. It's easy!

GO TO TOPIC LISTING
Modicon / Telemecanique / Schneider
Electric

Home PLCs and Supporting Devices Modicon / Telemecanique / Schneider Electric

Contact Us

© 2020 MrPLC.com  |  Terms of Use    Privacy Policy Wake Industrial PDF Supply AX Control Do Supply Home Forums

4/4 14.01.2020 13:56

S-ar putea să vă placă și