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

Hi, I'm having an issue in crimson 3.0 when I create a programme using a case statement referencing a fault word that each bit needs to change the...
Replies
1
Views
75
I am trying to copy an array of real numbers into a UDT with a real data type element. I have attached a snip below showing my COP instruction...
Replies
4
Views
194
I have an array of 55 REAL values. Is there a way to multiply based on the array location ? I have 55 transfer belts that are equally spaced...
Replies
3
Views
146
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
175
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
410
Back
Top Bottom