Time Array Comparison Logix5000

whussain6

Member
Join Date
Oct 2013
Location
Newcastle
Posts
108
Hi

I have a system where a sampler takes samples of material at regular intervals (may be hour) with datetime stamp which is stored in Logix5000 PLC.

After few hours the laboratory data will be returned with same datetime stamp entered by operator. This will update data in PLC with laboratory data i.e. %age, conc etc.

Now the idea I have is to compare the datetime in PLC with Datetime entered and update that data.

Now in logix5000 as most of you may know that we have to create array
DateTime[0] to DateTime[7] for date time

In my case DateTime is part of another array so it looks like this

Sample[x].DateTime[0-7] = Entered_DateTime[0-7]

If equal then replace data in Sample[x] array with Lab Data.

Sample[x] has DateTime[y] and other elements i.e. Concentration

Any Ideas how can I compare the Date time in Sample Array for all the samples.
 
The actual array needed has a length of 7 giving you Date_Time[0] through Date_Time[6].

The last one is in microseconds, how obsessed are you being with the values being the same? To the second? To the minute?
 
I am interested up to seconds level

It is basically

Compare an Array of Timedate with (lets say 5) Arrays of Timedate stamp

DateTime[0] to DateTime[6] compare with Sample[1].DateTime[0] to Sample[1].DateTime[6]
.
.
.
.
Sample[5].DateTime[0] to Sample[5].DateTime[6]

If found in one of the Sample[x]
Update Sample Data with Lab Data.
 
Last edited:
Just start comparing starting at the 'year' portion. Stop on the first non-compare or after comparing the seconds. Then take whatever action needed. Make it an AOI if you would like the code to look cleaner.

EQU DateTime[0] Sample[x].DateTime[0] AND EQU DateTime[1] Sample[x].DateTime[1] AND .. all the way through to seconds. If it's true all the way then update else to your next sample.
 
Last edited:

Similar Topics

Hello everyone, I'm working on a project that involves controlling an array of nozzles within a CNC environment, where the nozzles travel along a...
Replies
5
Views
138
Hi. I'm using a Modbus ProSoft where I basically map data to a big INT array. Example, where GX_I_63HPU is a REAL, MNETC.DATA.WriteData[200] an...
Replies
21
Views
345
Logix 5000 v32 on 1769-L16ER I used the FBC instruction to scan an array of DINTs for true bits and it works but I found a thing that just...
Replies
2
Views
69
Greetings, I am trying shift data in an array (such as Array[0] is shifted into Array[1], Array[1] is shifted into Array[2]......all...
Replies
10
Views
337
Howdy, I am currently struggling with an array of values that I want to re-arrange in a programmatic way. My program is a mix of ladder and STX...
Replies
6
Views
365
Back
Top Bottom