LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate total time for state machine cycle time

Hi attached
is a simplify program to solve the total elapsed time issue..............

the purpose : i want to calculate the total elapsed time for the whole vi to complete running
1.However there is some problem in doing that, after the execution of every case, the elapsed time returns to 0

As u see, i will required the program to run 2 times, i will need the elapsed time to return the total time required
for the 2 cycle but in the program i attached, it doesn't happen............

Labview Experts out there
Please give me some advice

thks
0 Kudos
Message 1 of 16
(8,719 Views)
Hi,
I just took a look into your diagram. If you need the total elapsed time, you should add the differences you calculated from the start time (-> "total elapsed time" variable) instead of overwriting them. I can't start your VI because there are some type definitions missing ("PCR.ctl").
Greetings
Olli
0 Kudos
Message 2 of 16
(8,708 Views)
right-click on the top shift register and "replace with tunnels".
 
Optionally remove all uneeded wires (e.g. delete the two rightmost time tunnels and the right time tunnels in the while loops, then hit control+B to remive all bad wires).
Message 3 of 16
(8,704 Views)
included the missing file
Download All
0 Kudos
Message 4 of 16
(8,698 Views)
Hi,
replacing with tunnel is the better way...then you should  replace also the "equal 5" with "equal or greater than 5", because often you won't get the exact 5.0 from the substraction the counter values....then your VI will not stop.
greetings
Olli


Message 5 of 16
(8,691 Views)
Hi guys
thks
it was such a simple solution yet i spend 1 day trying to solve it............... 😞
should brush up my "skills"

0 Kudos
Message 6 of 16
(8,673 Views)

Hi Yongster,

I was just looking at your VI ( testing.vi) and I think you are using this to bring out PCR thermal cycling.I have developed a VI where I can control one temperature using PID but need to do thermal cycling as I am bit new,I will really appreciate your help if i can look into the final VI you have for thermal cycling in order to understand how it works.

Thanks,

Ahsan

0 Kudos
Message 7 of 16
(8,332 Views)

Hi Ahsan

i will gladly help but i will have problem sending my VI

let me know which portion u need help and hopefully i can explain how to do it..... 

0 Kudos
Message 8 of 16
(8,317 Views)

Thanks,I really appreciate.

Basically I have a VI which controls temperature using PID.It takes in volatage difference across the thermsitor using one of the analog input of niusb6009.Than using a formula mode it converts into corresponding temperature after that it checks whether the desired temperature has been reached if not that it send signal out using output channel of DAQ to the relay,causing relay to switch on which causes power to go in to the heater to heat it up once desired signal is reached the relay is off and power no longer supplied to heater.In this way it tries to control the heater temperature.

Now what I need to do further is perform PCR thermal cycling,so if you can help me in setting up the VI for that than that would be great.what i need would be after one temperature as been reached say 95 deg C the program should controll it for desired length of time for simplicity say 1 min,After this the temperature should drop to 55 deg C and once it reaches it should in similar fashion stay there for desired length of time after that it should shoot up to 75deg C and once it reaches there it should stay there too for desired lnegth of time so once one cycle is completed the program should run for desired number of cycles in similar fashion.I hope you get my point.Please let me know how to go about it knowing that I have a VI which is basically getting signals from DAQ and able to control one temperature.

I even saw your VI ( revitoheat.zip ) but got bit confused where I guess you have 4 sensors but in my case i just have one sensor for feedback signal.

Thanks,

bye

Ahsan

0 Kudos
Message 9 of 16
(8,301 Views)
Hi Ahsan
 
for me, i used the state machine format for writing my code as recommended by the NI engineers
 
so for every state, it is running at 1 temp and when the condition u set for each state is met , it will move on the next stage e.g. state 1--purpose to heat up to 90 deg C(set point) and maintain for 30 sec (condition). so when it is at 90 deg C and run for 30s at this temp, it will move to the next state determined by u before hand
 
the basic idea is as above
 
lets do it step by step........
0 Kudos
Message 10 of 16
(8,262 Views)