Forum Replies Created
-
AuthorPosts
-
October 10, 2018 at 1:08 pm in reply to: Modbus TCP – One Element value gives 4 Digital Inputs, #4385
manjey73
ParticipantGetBit (a,b)
a – channel data number from which you want to check the required bit
b – is the number of the bit to be checked from 0 to 64 considering that the database always has a double representation. But in fact, if you read one register, you can actually check only from 0 to 15 for example> 0 ? 0; 1 this entry you do the inversion if it is necessary
Not quite boolen, all variables RapidScada converts to double, this is a feature of the database implementation. However sometimes it is a hindrance 🙂 your perception is, Yes, a boolean.
Use C# help on MSDN
October 10, 2018 at 10:40 am in reply to: Modbus TCP – One Element value gives 4 Digital Inputs, #4381manjey73
ParticipantWell, I told you why you had a mistake. You need to check how to call the formula.
Getbit GetBit and it is a different name
-
This reply was modified 6 years, 12 months ago by
manjey73.
manjey73
ParticipantThe formula name must be entered correctly, as specified in the formula itself
public double GetBit(double val, int n) { UInt64 uintVal = (UInt64)val; return (uintVal >> n) & 1; }
GetBit
And so it is necessary to write for all formulas
-
This reply was modified 6 years, 12 months ago by
manjey73.
manjey73
ParticipantD.D only for displaying numbers. The database gets the full number
manjey73
Participant<Param name=”WriteMinPer” value=”60” descr=”Период записи минутных срезов, с” />
See settings of this file ScadaServerSvcConfig.xml but in this way you will increase the database in size
October 5, 2018 at 10:38 am in reply to: Modbus TCP – One Element value gives 4 Digital Inputs, #4344manjey73
ParticipantRead the channel as unsigned.
Then add calculation channels and use the GetBit formula in themRead the register as HoldingRegisters and then apply the formula in virtual channels
-
This reply was modified 7 years ago by
manjey73.
manjey73
ParticipantSorry, all timer formulas still need Tiсks formula to work
public static long Ticks() { DateTime now = DateTime.Now; long time = now.Ticks/10000; return time; }
Without this formula, all timers will give an error, and since the formula timers are different, but use the same calculation of the difference, the Ticks made a separate formula
manjey73
ParticipantYes, the register should be read once and then on the basis of the input channel of this register to apply the formula GetBit in settlement channels. You really spend a lot of time on the same type of reading.
manjey73
ParticipantThen it turns out that you have everything right. 480 parameters this is clearly more than Modbus can allow with a single request. Try to separate the query groups so that the parameters you change are often in separate groups. That is to make a logical separation.
manjey73
ParticipantTo set the settings property is an extraordinary interview after sending the command.
Also change the poll method to group, where possible
manjey73
ParticipantIn this case, you do not need a hysteresis and just a timer with a delay off. TOF with time of 20 seconds.
int[] TofNum = new int[1]; long[] TofST = new long[1]; bool[] TofFlag = new bool[1]; public double Tof(double TofIn, double TofPT) { long ET = 0L; long tof_pt = Convert.ToInt64(TofPT); bool q = Val(CnlNum) > 0; bool tof_in = TofIn > 0; int res = Array.IndexOf(TofNum, CnlNum); if (res == -1) { res = TofNum.Length; Array.Resize(ref TofNum, res+1); Array.Resize(ref TofST, res+1); Array.Resize(ref TofFlag, res+1); TofNum[res] = CnlNum; } if (tof_in) { q = true; TofFlag[res] = true; TofST[res] = 0L; ET = 0L; } else { if (TofFlag[res]) { TofFlag[res] = false; TofST[res] = Ticks(); ET = 0L; } else { if (q) ET = Ticks() - TofST[res]; } if (ET >= tof_pt) q = false; } return Convert.ToDouble(q); }
Add in the Formula of the Administrator
Configure the calculated channel formula – Tof(controlled channel, 20000)
August 31, 2018 at 7:47 am in reply to: AB driver integration for micrologix and micro800 series #4180manjey73
ParticipantC# can call functions of libraries written in C++ like. Not sure, but if I’m not mistaken, it is achieved using DllImport
manjey73
ParticipantYou use a standard command, and it takes numeric values. Probably it is necessary to use a binary command and convert the string representation to hex with a formula ?Maybe that’s the reason.
manjey73
ParticipantYou can, that’s how I wrote the driver to work with GPIO on Raspberry
manjey73
Participantin WEB Main menu-Configuration-Require password when sending command
-
This reply was modified 6 years, 12 months ago by
-
AuthorPosts