Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

task use problem with 4channels

Dear all,
 
i would like to use 4channel of same DAQ device in such a way that one analog input and counter (PWM)output as act for one operation (pressure regulation system)
in another one analog input and one counter(pulse) output to act for synchronously for  coil activation and coil current measurement 
 
my problem is when the pressure regulation system is stabilised i have to activate the coil and get the current response back, but to do so you have to release or stop the first task
in real scenerio but what i need is when the first (pressure regulation system)is in standby only i have to activate the second(coil actvation and current measurement)
 
My question is , Is there any otherway to do this, i mean utilising the same resource for more than a channel when one channel is in running without stopping or unreserve the task
 
Thanks in advance
 
Regards
Chandru
0 Kudos
Message 1 of 6
(3,652 Views)

My question is , Is there any otherway to do this, i mean utilising the same resource for more than a channel when one channel is in running without stopping or unreserve the task
Sorry to inform you that this kind of acquisition is not possible for the set of AI channels on your DAQ card
 
By the way, which DAQ card are you using??
0 Kudos
Message 2 of 6
(3,647 Views)
Chandru,

Looking at the VI makes me wonder what you are actually trying to accomplish.  You may be able to accomplish the end functionality you require for your application, but likely you will need to take a different approach.  First, let me see if I can repeat what I think you are trying to do:

You are using one software timed (on-demand) analog input to measure pressure.  This pressure measurement is used as the input to a PID control loop that controls the PWM output that controls the pressure.

After some amount of time allowing the system to stabilize you then activate a coil and then get the current response.

The VI you attached does not quite do this for a number of reasons.  First, the analog read for the coil current measurement returns the first 1000 points in the buffer.  Since the task was started before the control loop even starts the values returned will be those before it is stabilized rather than after waiting the period of time you desire.  You are in effect waiting to pull out the samples acquired at the beginning.  The NI-DAQmx read in this case does not return the current samples but the first samples acquired into the buffer.

Second, you don't delay the pulse to the coil in any way.  It is generated the second the application begins.  I don't know if this was done intentionally to simplify the VI you posted, but I don't see this code anywhere.

Basically the limitation you are running up against is that with most DAQ boards you can only have one analog input task running if one of the analog input tasks is timed.  There are two reasons for this:
  1. The DAQ board only has 1 timing system that can be used for clocking the analog input.
  2. The DAQ board only has 1 ADC and all signals must be multiplexed to it.  When you create a timed task the clock must control the timing of this multiplexer and will in essence reserve the multiplexer (keeping other tasks from using it).
To propose a real possible solution it will be helpful to understand some more details about your application.  What DAQ device are you using?  At what rate do you need to acquire the coil current (it is 2k in the VI but I want to double check)?  How precise does the stabilization time need to be?  In the end application will the pressure information be used to determine if the pressure is stabilized or will you continue to set some arbitrary length of time?  Why is the current task a continuous task instead of a finite task if you only intend on taking 1000 samples and then ending the loop?

Let me know some more details and I will see if I can make some recommendations.

Regards,

Neil S.
Product Support Engineer
Multifunction DAQ
National Instruments
Message 3 of 6
(3,644 Views)
Dear Neil,
 
Thanks for our patience answer,
 
you have rightly understood my application
 
i willl brief my application agaiin with little more clearly;
 
i have a test system in which i want to acquire the line(pipe) pressure(Dev1/ai0) and compare the with the set pressure(in software) and the regulation will be done thro a PWM counter the PID output will vary the duty cycle of the PWM counter(Dev1/Ctr0). In order for stabilistation we use 15 sec to 1min delay in the loop(not comparing the set pressure with the incoming pressure).once the set stabilistation is over the the pressure regulation system should be in active or standby and by the same time i have to activate a solenoid valve coil for turning ON (pulse counter Dev1/Ctr1)and measure the coil current(dev1/ai1).
 
i understand before stopping or unreserving a task already running it is not possible to initiate other task because the ADC uses same one sample clock.but i should not either stop or unreserve the pressure regulation task while the pule to the valve coil been generated(single pulse).
 
in the previous attached vi, mistakenly i used the task creation out side the loopn now i have re arranged my vi and attached
 
i use NI PXI-6251  M-series multi funcional DAQ card
the rate of acquisiton can be 1000 or son no issues
 
anticipating a solution or suggestion from  you
 
let me know if you require more information
 
Thanks
 
Chandru

 

0 Kudos
Message 4 of 6
(3,630 Views)

Hello Chandru,

I have looked at the updated code you submitted and I am still curious as to why you need both a software timed AI task and a hardware timed AI task. If you mix the two you are going to run into the ADC conflict regardless of how you structure the application.

Have you thought about using software timing for the second AI read? If you combined the tasks and used software timing the limitation would be removed. You would still have access to the data on both channels and the timing for the read within the second case structure could be easily implemented with a loop structure.

An alternative question would be to ask if you need the first analog task to be software timed. If not, would it be possible use hardware timing? If you can read in the pressure voltage using the same timing as the coil current then you could use the same timed multiplexer. Once again, you would have a single task with two different channels using the same timing structure.

Mixing and matching the hardware and software timed AI tasks however will not work for the very reasons Neil mentioned in the above post. If either of the above scenarios seems reasonable we can make further suggestions on how to modify your current application.

Chris Behnke
Sr. RF Engineer
High Frequency Measurements
Message 5 of 6
(3,586 Views)

Hi chris,

Thanks for the response

i agree with you about creating both the analog channels on the same task and i have modified my vis and it seems working

see the attached one and if you have any further suggestion on the vi pls let me kno

Thanks

Chandru

0 Kudos
Message 6 of 6
(3,575 Views)