LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reset value between a time interval.

hi every one...

Im new to this labview and got stuck with one coding.

In my project i have 3 shift time....

i. 1st shift- 06:00:00 to 15:30:00.

ii. 2nd shift- 15:31:00 to 01:00:00(Next day early morning).

iii. 3rd shift-01:01:00 to 06:00:00.

       Now i have a text file which gives me the particular time of that text file and those text file have some datas that i will save in an database(Excel).

       i need to start a value with 1 during the starting of an shift and it should increment to 2,3,4,5,6,...etc.Now when the next shift starts the value should again reset to 1.

       Im taking the time from the text file not from the pc. because in caes if the pc is off it may miss the starting time of the shift and it may not reset.

     Im attaching the text file for ur reference.

Just help me in reseting that value if the text file comes at any time but in between the two shifts.

 

 

Hoping for ur respose 

sudhin sudh

0 Kudos
Message 1 of 8
(3,341 Views)

There is a bigger chance you get help from people, if you show some effort = attach your VI what you tried so far, and detail the actual problem with your VI, what you expect it should do, what it does instead, etc...

 

Im new to this labview and got stuck with one coding.

You can start to learn from the available resources, see the top part of the forum for links.

0 Kudos
Message 2 of 8
(3,323 Views)

Here the highlited "time" is the time that comes from text file(that i read it from it).Eg. of 1st and second shift if the "time" comes inbetween the two time shift then the count value ( a indicator r a constant)should increment from 1 to infinity upto it reaches the next shift time. if the "time" crosses the 2nd shift time and reaches the time interval between 2nd and 3rd shift then "count value" it should again start from 1 and get incremented. 

 

 

Capture123.JPG

 

 

0 Kudos
Message 3 of 8
(3,302 Views)

Hi sudh,

 

if the "time" comes inbetween the two time shift then the count value ( a indicator r a constant)should increment from 1 to infinity upto it reaches the next shift time.

So you want something like this:

IF InRange(min, time, max) THEN
  count++
ELSE
  count:=0
ENDIF

You already have the InRange comparison and so you only need to add a shiftregister to hold your count value, an Increment and a Select function…

 

Btw. why do you concatenate time strings to include "HH: MM: SS: SSS", when the seconds parts is always zero? Why not just build HH:MM and scan for this using "%<%H:%M>T"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(3,294 Views)

thank you very much for the reply...

 

But this range true will be always kept true and the increment will continously happen, since its between the range. But the increment should happen only when next text file comes .

      Also at any time between the 1st shift and 2nd shift the first text file comes the function should start with 1 snd continue incrementing all time the text file comes, until the 2nd shift reaches and after the 2nd shift starts and any text file between that time comes it should start with 1 and start incrementing.

      

0 Kudos
Message 5 of 8
(3,263 Views)

Hi sudhin,

 

the increment should happen only when next text file comes .

Ok, that's your condition. Why dont you just program it?

How do you know "the next text file comes"???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(3,243 Views)

@GerdW wrote:

Hi sudhin,

 

the increment should happen only when next text file comes .

Ok, that's your condition. Why dont you just program it?

How do you know "the next text file comes"???


I read it from the next text file ID code and each text file has a separate ID code. So the change in ID code gives me the detailes that next text fileha come.

        I have used it in my logic aswell but i want to reset this increments to 1 at the end of the shift time. If im using the PC time with "get date/time function" , der is a chance when the pc is off at that time i.e; shift end. Iss der any way i can read pc time even if pc is is off.

        Or i have to use text file time.but here also its not necessary that text file may come at that exact time specified in coding. is der any coding which we can write when the text file comes after starting time of the start and before ending of the shift, the value should reset. 

0 Kudos
Message 7 of 8
(3,235 Views)

Hi sudhin,

 

you describe a lot of conditions: all you need to do is to program them in your VI(s)!

 

When you have specific questions you should post your VI so we can examine them…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(3,224 Views)