02-02-2009 01:33 AM
please see the attachment.
i need to increment V2out every second. please suggest a better way of doing it.
can i use this statemaschine saved as a subvi in another while loop?
RENN
Solved! Go to Solution.
02-02-2009 01:38 AM
Hi RENN,
you should use a shiftregister to store your value out instead of the local variable. What do you make with this value? Do you need to output it to a hardware?
Mike
02-02-2009 01:57 AM - edited 02-02-2009 02:03 AM
yes Mike.
i have to output this value to a Valve. i need to control the valve with its 0-10v output.
i need exactly 60 increments in 60 seconds. please see the edited attachment.
Renn.
02-02-2009 02:18 AM
Hi Renn,
if you have a output card which supports buffer, then you can create a waveform and send the entire data to your card. Which hardware do you use?
Mike
02-02-2009 02:28 AM
Hi Mike,
i'm using PCI 6229 Daq and another profibus card for two valves v1 and v2 respectively.
i need to control the output of v2 which depends on output of v1. i have a subroutine for (1) incrementing v2out, then another (2)to convert the 0-100%unit to 0-10volts and then a (3)Daq subroutine.
all these run in a whileloop and i dont want to change the while loop execution rate.
what i need is incrementing v2, 60 increments from 0-100%. i dont know how can i achieve this.
thanks in advance
RENN
02-02-2009 03:08 AM
Hi Renn,
i think i don't really understand what you connect where, but maybe the attachment helps.
Mike
02-02-2009 05:45 AM
02-02-2009 01:29 PM
thanks a lot Mike...
i really wanted that code.
i have saved the code inside the while loop as subvi (please see the attachment), have to use this functionality to create ramp in another while loop, using shiftregisters.
is there any ways of doing this without shift register? if i use this subvi in a while loop in which many other subvis are used and if the loop execution rate cannot change? obviously in this vi it works. i want to know if i want such a functionality can i used event structure?
can i programmatically make an event for any value change?
please reply
02-03-2009 02:10 AM
Hi Renn,
you can of course use an event structure, but then you should use two loops, one with the event structure and the other one with your ramp function. See the ProducerConsumer Design pattern for more information.
Mike