LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I change a variable in a flat sequence and pass it through the sequence to the Arduino output?

Solved!
Go to solution

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.

0 Kudos
Message 1 of 13
(5,200 Views)

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?

0 Kudos
Message 2 of 13
(5,195 Views)

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?

0 Kudos
Message 3 of 13
(5,181 Views)

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

0 Kudos
Message 4 of 13
(5,172 Views)
Solution
Accepted by topic author akifyalcinkaya

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.

Message 5 of 13
(5,165 Views)

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. 

0 Kudos
Message 6 of 13
(5,150 Views)

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 😄

0 Kudos
Message 7 of 13
(5,144 Views)

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.

0 Kudos
Message 8 of 13
(5,100 Views)

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.

0 Kudos
Message 9 of 13
(5,097 Views)

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. 

0 Kudos
Message 10 of 13
(5,088 Views)