AGG Software Forums
September 20, 2024, 01:41:51 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome on our forum!
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  Online Help Center / Data loggers and plug-ins / What might cause the Script Execute module to stop running ? on: October 21, 2014, 06:08:56 PM
We have got a server running where it

periodically receives packets of data and parses them,
then runs the script execute module to check the data is valid,
then writes an OK back if the data is alright,
or discards the packet if it was corrupt,
then if the packet was not discarded it writes the values into an SQL database.

But on some occasions the script execute module does not run, so the packet gets written to the SQL database without being checked by the script execute module. Then the same packet is received again (because no OK was sent last time) and the database gets lots of duplicate data.

Eventually (Maybe 5 or 10 minutes later) the script execute module starts running again, and all returns to normal.

What could be the cause of the script execute module not running - is it likely to be related to errors in the SQL write perhaps ?


2  Online Help Center / Data loggers and plug-ins / Re: SQL DB plug-in not write NULL value on: October 11, 2013, 02:35:48 PM
I tried using the deadband filter, but found it didn't do what I needed

I solved it by changing the sql query.
It deletes the record if it wrote a null value into the Temp1 column.

 insert into ADatabaseT1
 values (:P1,:P2,:P3)   
 delete from ADatabaseT1
 where Temp1 is null 
3  Online Help Center / Data loggers and plug-ins / SQL DB plug-in not write NULL value on: October 11, 2013, 01:12:19 PM
How can I stop the SQL database plug-in from carrying out an SQL query if any of the values it needs to write is NULL ?

For example

 insert into ADatabaseT1
 values (:P1,:P2,:P3)   

if the value of P1 is NULL, I want the sql query to be skipped
4  Online Help Center / Data loggers and plug-ins / Re: TCP/IP logger check a checksum in incoming data on: October 09, 2013, 06:45:23 PM
I get
Undeclared identifier: 'DataPacket' if I try and use DataPacket() as a function.

I am using C++ script.

I searched for DataPacket in the forum posts and found the answer in another thread :

string sName1 = "DATA_PACKET";
string data;
{
   data = GetVariable(sName1);
   ShowMessage(data);
}

Thanks for the clue.
5  Online Help Center / Data loggers and plug-ins / Re: TCP/IP logger check a checksum in incoming data on: October 09, 2013, 06:01:57 PM
How do you access the whole data packet ?

I can see how to access individual variables, but not the whole packet.

6  Online Help Center / Data loggers and plug-ins / Re: TCP/IP logger check a checksum in incoming data on: October 09, 2013, 12:10:42 AM
Does the script get executed before the ascii parser and the sql database write ?

If so, I can write a script to reject bad data before it gets any further. If not, will it be too late by the time the checksum is checked in the Script execute plugin?

How do I access the incoming data in a script ?
Is there some sort of global array of received characters to process ?
7  Online Help Center / Data loggers and plug-ins / TCP/IP logger check a checksum in incoming data on: October 08, 2013, 06:04:49 PM
I am receiving data using the Advanced TCP/IP data logger like this:

$25623,25637,49414,25616,44142,54216,-68682,131008150028,0660\r\n

The last 4 digit value is a checksum of the previous 8 values.

I want to be sure the data is correct before it is put into an sql database, and reply with an OK to indicate that the data can be deleted. If the checksum is wrong, I need to discard the data and reply ERROR to get the data sent again.

What is the best way to do this?

I can change the format of the checksum if required.
Pages: [1]
Powered by SMF 1.1.21 | SMF © 2015, Simple Machines