Forum Replies Created
-
AuthorPosts
-
manjey73
ParticipantMost PLCs allow you to read data in the form of Int16, and only then remove the required registers in Scada.
manjey73
ParticipantFor example, you can record the maintenance time of some equipment in the calculation channel and then compare it with the current one somewhere and create messages.
myDT(2023, 5, 15, 10, 0)
Year 2023, month 5, 15th, 10 am
manjey73
ParticipantYou can make a general formula, for example, for applying a record in the maintenance time channel.
double myDT(double year, double month, double day, double hours, doble minute) // Without seconds
{
int y = Convert.ToInt32(year);
int mh = Convert.ToInt32(month);
int d = Convert.ToInt32(day);
int h = Convert.ToInt32(hours);
int m = Convert.ToInt32(minute);
return new DateTime(y, mh, d, h, m, 0).ToOADate();
}Then it can be used for different purposes. But you will have to specify the year, month and day every time. For your case, it is simple to specify and set the Time channel format
myDT(2022, 1, 1, Val(6311), Val(6312))
manjey73
Participantdouble myDT(double hours, doble minute)
{
DateTime ddt = DateTime.Now;
return new DateTime(ddt.Year, ddt.Month, ddt.Day, Convert.ToInt32(hours), Convert.ToInt32(minute), 0).ToOADate();
}in channel
myDT(Val(6311), Val(6312))
format channel – Time
But it will show seconds, If you want without seconds, then it will be a text field converted from time, with an indication of the display format and subsequent translation from ASCII to an array of bytes, and the format of the ASCII Text cell
-
This reply was modified 3 years, 8 months ago by
manjey73.
manjey73
ParticipantIt is impossible to make a year, month, day with zeros in this version, I just made a formula in the channel
new DateTime(2022, 1, 1, 2, 3, 0).ToOADate()
Where 2 and 3 are your channels of hours and minutes. Right in the channel they can be written like this
new DateTime(2022, 1, 1, Convert.ToInt32(Val(6311)), Convert.ToInt32(Val(6312)), 0).ToOADate()
manjey73
Participantdouble Dt(double hours, doble minute)
{
return new DateTime(0, 0, 0, Convert.ToInt32(hours), Convert.ToInt32(minute), 0).ToOADate();
}In channel formula Dt(Val(6311), Val(6312))
Format channel – Time
If you transmit only hours and minutes, then in theory this is how it should be
manjey73
Participantdouble dt = new DateTime(Year, Month, Day, Hours, Minute, Seconds).ToOADate()
You need something like this, not sure if the formula is correct, not tested. Where, instead of hours and minutes, you should put your data, as far as I remember, by converting it to int
Year, day, etc. can be specified 0
-
This reply was modified 3 years, 8 months ago by
manjey73.
manjey73
ParticipantI think you can, you need another calculated channel and use the formula to put it in time. If you are satisfied that it will show the time, but here you need to try with formulas depending on how you want to see the view. The simplest thing is to enter the data in DateTime and tell the channel to display only the time
manjey73
ParticipantThey can be displayed as ASCII text by applying time formatting. It seems that there are corresponding formulas in C#.
Show your example how you display time on a mnemonic circuit
-
This reply was modified 3 years, 8 months ago by
manjey73.
manjey73
ParticipantThe formula in the channel – DateTime.Now.ToOADate()
Format channel is Date, Time or Date and Timemanjey73
Participant@Zeus We need to put up some kind of protection. It won’t save 100%, but still 🙂
manjey73
Participantpublic double SetBit(double n, int index, double setvalue) { long nn = Convert.ToInt64(n); return setvalue > 0 ? nn | (1 << index) : nn & ~(1 << index); }
I do not know, is this what you need or not? Just writing a bit to a number. You need to add Formulas to the Reference Books
manjey73
Participant$(document).ready(function () { $("#txtUsername").val("operator"); $("#txtPassword").val("1234S"); sleep(20000).then(() => { document.getElementById("btnLogin").click(); }) }); function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
Strange, I have double quotes and it works. Maybe the quotation marks code is from the Russian language, but it seems they should be the same.
If you look in HEX format, the quote code is 0x22 everywhere
-
This reply was modified 3 years, 8 months ago by
manjey73.
manjey73
ParticipantExactly, this forum is slightly spoiling some characters when inserting.
manjey73
ParticipantThe script is located in the file /scada/ScadaWeb/js/autologin.js where you specify your user and his password. It may be necessary to reboot the web to update the scripts in the browser, for example by Ctrl+F5
-
This reply was modified 3 years, 8 months ago by
-
AuthorPosts