LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simultaneous analogue input and digital output

Hi there,

I am trying to control 2 solenoid valves using digital output write to line in a sequence structure as shown in the attached file. The first frame opens one valve, the second frame opens the other valve, a wait function is used in the next frame to hold the valves open (for a very short amount of time, around 15-30 milliseconds) and the next 2 frames close the valves.

The problem I have is that I need to acquire two multipoint waveforms from 2 analogue inputs (a pressure transducer and a load cell) simultaneously at about 10 milliseconds before the first valve opens. The duration for this acquisition needs to be around 60-100 milliseconds for the pressure transducer and about 200-300 milliseconds for
the load cell while the sample rate will be 1000 samples/s.

Since I have used sequence structures to execute the digital outputs, I have been unable to log data whilst the sequence structure is executing. Depending on where I chose to put the simple acquire analogue multipoint waveform function the data is either logged before the digital outputs are executing or after the digital outputs have been executed, never throughout the sequence structures execution.

I realise that sequence structures are perhaps not the best way in which to arrange my system of digital outputs, however I have very limited programming and labview knowledge. Sequence structures were the simplest way in which I could devise how to control the solenoid valve execution. I suspect using the digital output as a trigger for my acquisition could be a solution however I could not work out how to do this.


I am using a Lab-PC-1200 daq card with Labview 5.1 (although the attached program is in labview 6 as
the computer I am using to send this mail has Labview 6 on it, however I could not get my daq card to work using Labview 6 so I am actually using Labview 5.1 in my experiments).

Any help would be great,

Thanks,

Ash.
0 Kudos
Message 1 of 6
(3,372 Views)
I cannot open your example as it is in LV 6.1, and i only have LV 6.0. But from reading your post, i am thinking maybe you could run the AI waveform in a separate while loop (when you need to activate the solenoids), and on the start of this loop you can toggle a button (using a local variable) in another while loop which changes a case structure to read through your solenoid sequence. You can add a sequence at the beginning which pauses for 10ms while data is being acquired.

Does this make sense/help you? Let me know if not, and i could include an example or think again!

Kim
0 Kudos
Message 2 of 6
(3,372 Views)
Thanks for the help Kim,

I did try using a local variable in a while loop to start the data aquisition however I didn't really know how to stop the aquisition. I tried a using a case structure in a similar manner (so as only one iteration was performed) but I had no success using this method either. Labview tended to aquire the analogue data before sending out the digital signals. I was not sure about where to put the sequence that pauses for 10ms that you mentioned.

I have attached another copy of the code that is hopefully saved in labview 6.0 so that you can view it. Just to sum up exactly what I am trying to do: I wish to aquire analogue data from 2 channels while simultaneously executing a sequence of digital outputs to 2 lines.

Thanks a
gain for your help,

Ash.
0 Kudos
Message 3 of 6
(3,372 Views)
I managed to open your example this time, and have included an updated version for you. Basically i have put the case structure in a while loop which continually reads from a local variable. This local variable is set to true in the sequence structure, 10 ms before the solenoid is opened. You may have to change the 10 ms wait to more or less, depending on how long the acquisition takes to start.

This should work, but when controlling at the millisecond level timing is everything. For instance, do you know how long it takes the solenoids to open?..from setting up the digital line to the valve actually opening? If this has a significant lag, then you'll have to alter your diagram to account for this.

I hope this helps you..

Kim
0 Kudos
Message 4 of 6
(3,372 Views)
Thanks very much for your help Kim. Unfortunately I could not get the program to work using your code. Although labview does multithread applications, I don't think it is possible to acquire a multipoint waveform at the same time as a write to a digital line. The digital output timing could not be controlled when the waveform was being acquired. Perhaps I was being limited by my computers processing capability???

I ended up using two generate delayed pulse functions to control the two solenoid valves and simply place the acquire multipoint waveform in the same sequence frame. In order to do this I had to borrow a 68-pin E series daq card as the lab 1200pc card can only output one digital pulse.

Thanks again Kim,

Ash.
0 Kudos
Message 5 of 6
(3,372 Views)
If the card has two DAC outputs, a waveform could be defined with
transition to 5V when desired.

On Thu, 12 Sep 2002 19:36:26 -0500 (CDT), "ash." wrote:

>I ended up using two generate delayed pulse functions to control the
>two solenoid valves and simply place the acquire multipoint waveform
>in the same sequence frame. In order to do this I had to borrow a
>68-pin E series daq card as the lab 1200pc card can only output one
>digital pulse.
0 Kudos
Message 6 of 6
(3,372 Views)