contact
support
Download
order
news
AGG Software Forums
November 24, 2024, 05:00:12 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Welcome on our forum!
Home
Help
Search
Login
Register
AGG Software Forums
>
Online Help Center
>
Data loggers and plug-ins
>
TCP/IP logger check a checksum in incoming data
Pages: [
1
]
« previous
next »
Print
Author
Topic: TCP/IP logger check a checksum in incoming data (Read 21924 times)
jamesant
Jr. Member
Karma: +0/-0
Posts: 7
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.
Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
Karma: +0/-0
Posts: 806
Re: TCP/IP logger check a checksum in incoming data
«
Reply #1 on:
November 12, 2024, 02:00:00 PM »
In Advanced TCP/IP Data Logger Enterprise (or trial) you can do it using the "Script Execute" plugin. But. of course, you need to write a script that will calculate and verify the checksum.
Logged
jamesant
Jr. Member
Karma: +0/-0
Posts: 7
Re: TCP/IP logger check a checksum in incoming data
«
Reply #2 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 ?
Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
Karma: +0/-0
Posts: 806
Re: TCP/IP logger check a checksum in incoming data
«
Reply #3 on:
November 15, 2024, 02:00:00 PM »
1. The Script Execute plugin will be called after the parser and before any data export plugin.
2. You can access parsed data and a whole data packet from a script. Also, you can discard invalid data packet and they will not be exported. Look at the plugin's folder for examples.
Logged
jamesant
Jr. Member
Karma: +0/-0
Posts: 7
Re: TCP/IP logger check a checksum in incoming data
«
Reply #4 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.
Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
Karma: +0/-0
Posts: 806
Re: TCP/IP logger check a checksum in incoming data
«
Reply #5 on:
October 09, 2013, 06:15:02 PM »
Use "DataPacket" function.
Logged
jamesant
Jr. Member
Karma: +0/-0
Posts: 7
Re: TCP/IP logger check a checksum in incoming data
«
Reply #6 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.
Logged
Arthur Grasin
Tech. Support
Administrator
Hero Member
Karma: +0/-0
Posts: 806
Re: TCP/IP logger check a checksum in incoming data
«
Reply #7 on:
October 10, 2013, 07:41:51 AM »
Sorry, this is my mistake. Also you may use the "FULL_DATA_PACKET" variable, because "DATA_PACKET" does not include beginning and ending characters of a data packet.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
News & Feedbacks
-----------------------------
=> News and Updates
=> Site Comments
-----------------------------
Online Help Center
-----------------------------
=> Advanced Serial Port Monitor
=> Data loggers and plug-ins
=> Data loggers ActiveX
=> Advanced USB Port Monitor
=> Virtual Null Modem
=> Software for DNC and CNC
=> Other questions
-----------------------------
Development
-----------------------------
=> Feature Requests
Loading...