02-06-2012 07:53 PM
Hello,
I checked the tutorials and modified the VI but the condition is met but the VI fuctions very fast.
The valve switch too fast.
May be still some error
02-06-2012 08:16 PM
I changed a bit. Please the modifed one.
02-06-2012 09:10 PM
You probably have a race condition with your local variables. This may be causing part of your timing problem. The BYPASS VALVE local to the right of the case structure may execute before or after the case structure, probably before. Regardless of which occurs first, the other write to the local will occur within microseconds. You can use shift registers to help eliminate the locals.
If you want to set that valve false after a short time, you should add a case to reset it and call that case after any case which sets it true.
A 100 ms cycle time is rather fast for most valves.
Lynn
02-07-2012 06:21 PM
You probably have a race condition with your local variables. This may be causing part of your timing problem. The BYPASS VALVE local to the right of the case structure may execute before or after the case structure, probably before. Regardless of which occurs first, the other write to the local will occur within microseconds. You can use shift registers to help eliminate the locals.
Thanks now I realized my mistake in the VI.
If you want to set that valve false after a short time, you should add a case to reset it and call that case after any case which sets it true.
That means I need to put one more case structure for resetting each valve. I changed the VI, but then the conditions are not met. Please see.
A 100 ms cycle time is rather fast for most valves.
Ya I agree but this is a small part of the big program and oveall program should work in 100ms.
Still the valves do not stay open for long. They just switch on/off all the time. The element value can be from 0 to 5V only.
element element 2 Bypass valve Main air valve Vent valve
0 0 Open Close close
1 2 Open Close Close
2 3 Open Close Close
3 3 Close Open Close
4 1 Open Close Close
1 4 Close Close Open
etc few conditions are bein overlapped so all valves are open
Actually,
I wish the Bypass is for equalizing the pressure of two Pressure transmitter PT1 and PT2.
When PT1=PT2 the Main air valve open
when PT1 is 4 the only vent should open
Please the logic file also.
02-07-2012 07:27 PM
I do not completely understand your logic diagram or the chart in your text. What happens in the Valve Operation boxes? Do the valves open Close? Change from one state to the other? If they only open in those boxes, when do they close?
Referring to the chart in your text: What happens when the values of the elements are not integers? Also, it is generally not a good idea to do Equals? comparisons on floating point data because very tiny, physiclaly insigificant, differences can prevent two values which are very close to each other to compare as Not Equal. Use In Range & Coerce to test a small window above and below the nominal values.
Lynn
02-08-2012 12:33 AM
do not completely understand your logic diagram or the chart in your text. What happens in the Valve Operation boxes? Do the valves open Close? Change from one state to the other? If they only open in those boxes, when do they close? I think dont consider the flow chart.
Referring to the chart in your text: What happens when the values of the elements are not integers? Also, it is generally not a good idea to do Equals? comparisons on floating point data because very tiny, physiclaly insigificant, differences can prevent two values which are very close to each other to compare as Not Equal. Use In Range & Coerce to test a small window above and below the nominal values
Yes think that is better possiblity I think we cannot make the logic based on the comparisons only it needs some range.
I changed the VI but still logic is note yet met.