06-08-2016 02:01 PM
Hi all,
I am trying to change the pressure value on a regulator for certain time intervals, i.e, 5 sec 20 psi then 2 sec 5 psi. Since this is an easy task, I decided to use a flat sequence but I could not take the value of the pressure and feed it into the Arduino pin. I am sure that this is an easy job but I am not good in Labview. How can I do this?
Thanks in advance.
Solved! Go to Solution.
06-08-2016 02:17 PM
1. Clean up block diagram. You have some wires and tunnels that are connected, but don't appear to be.
2. Don't use property nodes, you'd be better of using local variables.
3. Sequence structures are often a bad idea, but it may be necessary in your case.
4. Why don't you wire the value out of the sequence structure like you are showing now? What wire do you wan that black undefined wire to be connect to?
06-08-2016 02:51 PM
I think it was not clear, sorry about that. That black wire is the wire to the arduino. It is not connected to a specific node because I did not now where to connect it. And that is my problem. So, can using a local variable solve my problem?
06-08-2016 03:06 PM
Instead of a sequence structure use a state machine. Two states (Switch (or/off), wait for next state). and switch states according to the timing
06-08-2016 03:15 PM - edited 06-08-2016 03:18 PM
Here's a very primitive solution (I don't have the arduino stuff, so I left that out.
Note that this is not very scalable. To have better control use a wait state and poll the elapsed time express VI to determine when to go to the next state.
06-08-2016 04:02 PM
Hi Altenbach,
Thanks for your reply. I will try this but I have a question in my mind. It looks like Pressure 1 and 2 make up an array of doubles. When this array is passed to the loop, is it going to be read one at a time? This is important because the pressure should be set to the certain value every time the loop runs.
06-08-2016 04:12 PM
Autoindexing tunnels are one of the cornerstones of LabVIEW. Maybe you should start with a few easy tutorials first.
In any case, just wire it up as shown without the arduino stuff and run it. Enter different pressures into the controls. See how it behaves 😄
06-10-2016 11:24 AM
Hi altenbach
I tried what you suggested but the pressure value does not change and I cannot see the timer value as well. What may be the reason?
Once I got this vi working, it will be easy to adapt it to Arduino.
06-10-2016 11:28 AM - edited 06-10-2016 11:28 AM
Why are you multiplying the waits with an empty array? That gives you an empty array and the FOR loop iterates zero times. Multiply with a scalar 1000 instead.
06-10-2016 12:20 PM
oh, I thought right clicking the multiplication node and creating a constant (i.e 1000) would do that but it did not. Thanks for the help now it works:) I will try to adapt the arduino stuff as well.