LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help Using Shift Register

Dear All,
 
               Here i have attach the vi in which i have shown some parameters and here i am explaining what i want to do.
 
               There are two loops in the vi, when we start the loop no 1, it should initiate some value to the shift register and with that when elapsed time will makes the Loop no.2 true, from the loop no 2 some value must add into the shift register for the next iteration, and this will happen each time when loop no 2 becomes true, but as i ve written the logic, because loop no 1 is always true, it always initialise the shift register value to initial value i ve define in the case true of loop no 1, instead i want that it only initialise the value first time when loop no 1 becomes true else it add the values in the values of the shift register, instead of every time initialises the shift register, can you please help what i should do for that? Please give me some suggetions.
 
Thanks in Advance,
Nishant
Message 1 of 19
(4,323 Views)
Nishant,
I think you are speaking about the 2 case structures within the while loop, right?

I do not know anything about the functional background, therefore it is a little bit hard to make some suggestions...
But, one thing to improve the functionality is to use a shift register for the "Time has Elapsed" state and another thing could be to change the mechanical action of the "Boolean 2" control from "Switch When" to "Latch When Released"...

I did not program it very well, it should only show one possibility...

BR,
ThSa
         


0 Kudos
Message 2 of 19
(4,309 Views)
Nishant
 
In terms of functionality could you tell us what you want to achieve?
 
Those are case structures not loops Smiley Wink
 
Trying to help...
 
David
0 Kudos
Message 3 of 19
(4,310 Views)

Dear David,

            You are right, those are case structures and not loopsSmiley Very HappySmiley Very Happy. and sorry for the explaination i have given, let me calrify it to you.

              I want that once the First Boolean is clicked, then first case starts and it will start the timer and when that timer goes to 60 seconds it will pass the value true to the second case momentarily and in that moment second case adds some values in the previous value of shift register and stores it for the next iteration, mean i just want to initialise the shift register with some value when first case initialises , then every time when 60 seconds add, second case adds some value into the value of Shift Register, and when program ends, all the loops will be ended.

Hope this helps, and if still there is something mossing in my explaination, please tell me i will try to make it more clarify.

Thanks,

Nishant

0 Kudos
Message 4 of 19
(4,305 Views)

Dear ThSa,

         Thanks for the solution man, but i dont want my vi that way, and more specifically what i want is, i have specified in the other reply, but thanks anyways for the solution you have provided.

Thanks,

Nishant

Message 5 of 19
(4,305 Views)

Nishant

Take a look at the attached vi and see if this is closer to what you want.

I have used an event structure where the count is incremented in the timeout case. The start button value change event sets up the timer interval and resets the count. I have set this 1 second to demonstrate.

David

0 Kudos
Message 6 of 19
(4,301 Views)

Dear David,

       Thanks for the reply man, thanks very much and that is what i was looking for in my vi, to initialise the values on the click and then to start the count every periodic time, thanks very much.

          One another thing i have seen is to do it with the latch action, to latch one case at a time for and just to give simply initialisation to the other for the time being, which will initialise it to initialise the shift register value, same what u ve done but only with some more booleans, and i have used same mechenical actions, as u ve used in your boolean buttons, thanks anyways, thanks for the quick reply.

Thanks,

Nishant

Message 7 of 19
(4,294 Views)

Dear Mr. David,

      I would like to question about the shift register that is it time consuming in the loop, because i am using it for the latch action as i show you and i am giving that in the case where, at each 1 min (60 Seconds) elapse time.vi sends the true signal to log the data but as the signal comes through shift register it delays the action, for i think 1 sec at each 2 or 3 mins which gives an error in logging the data, which is not acceptable. Can you please explain this condition?

                Another question is can you explain me the method which can give me records at exact 1 min as per requirement and which can be done without elapsed time.vi (given in the Time & Dialog vis), cos i also have a doubt that it is also adding some delay into the program, and my vi is already full of code, so that is another factor, do u know any mehtod in which i dont have to use the elapsed time.vi?

Thanks,

Nishant

Message 8 of 19
(4,255 Views)

Nishant

You have not given me anything to look at. Did you mean to attach something?

David

0 Kudos
Message 9 of 19
(4,254 Views)

No Mr. David,

              I am not saying to attach anything i am just askin for the solution of how to do the logging into excel at the specific time and i should not miss the time (mean that if i am logging at 1 min then each logging must be at 1 min's time, instead i m missing the logging, logging happens at 61 seconds instead of exact 60 secs because of haeavy code in vi {that's what i think}), instead i want to log each and every data at exact 1 min with this heavy code in the vi. and i am not able to attach the vi becaus it is more than 1 MB and it is official one, so not possible to attach i still try to send u pics if possible, but else can you give me the solution about how to do the periodic logging perfectly?

Thanks,

Nishant

Message 10 of 19
(4,251 Views)