Hi All
So as promised I have tried Mikhail’s code on my new RS set up .
Well it works and it works well , so well indeed I have I now have 10 x ‘minute real’ channels reading in the data from the .txt files .
So this is how I did it , I have written a simple program ‘getdata.exe’ using QB64 , this reads the RS232 port and takes the received 36 ASCII characters and chops them up using mid$ in the code and writes out 10 different .txt files with the individual numbers stored in them .
Then in RS I have a formula called by a minute real channel
double GetData()
{
System.Diagnostics.Process.Start(“C:\\Scada\\getdata.exe”);
return 0 ;
}
Then I use the 10 x minute real channels to call in the data
(this is just one of the formulas
This part was the code Mikhail designed
double ReadNickelA()
{
try
{
string s = System.IO.File.ReadAllText(@”C:\DataRecorder\NickleA.txt”);
double val;
return double.TryParse(s,out val) ? val : 0;
}
catch
{
return -2;
}
}
Now I’m sure that lots of this is wrong , C# is still new to me but it all works fine and I don’t get any errors or lag on the server . So I am happy with it !
Thanks for every one who made suggestions and help
Rich