LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cycling analog output on and off

Solved!
Go to solution

Hi Choc,

 

Thanks for the great feedback! I am afraid that its a different Hillman - sorry. 

 

With your first question (and the code) I have altered the aspect I feel should resolve this. Basically, I would use a task done? vi from the DAQmx pallett within a while loop then use some logic to stop the loop when either the waveform has been outputted i.e. task done or the stop button has been pressed. One issue, as I can't test it, is the AO waveform is buffered in memory, so you may need to add a stop task once the logic has decided the task should end... give it ago and let me know.

 

I would have thought that it's probably an issue with the number of samples you've generated (maybe). If you could send me your code I could take a look at it for you.

 

Regards,

 

 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 11 of 24
(1,473 Views)

Hi Hillman,

 

Thanks for the VI, but I am running LabView 8.2, and I can't open it!

0 Kudos
Message 12 of 24
(1,465 Views)

Hi Choc,

 

Im sorry, forgot about that.

 

Here it is again.

 

Let me know what you think - I am around for the rest of the day, so if you have any more questions please try to contact me before I dissapear for a few days 🙂

 

Regards, 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 13 of 24
(1,459 Views)

Hi Hillman,

 

The VI you sent works great! It does indeed stop immediately when you click the STOP button. Now as for the RAMP-HOLD-RAMP issue, here is the VI I have been working on. I can produce the waveform (as seen on the graph in the VI), but the AO signal is beyond slow (i.e. it does rise, but not at the parameters the user wants). I thought it would be a simple modification from the ON-OFF VI, but as with most things regarding LabView, I was wrong! Hope you can shed some light into this. Thanks again!

0 Kudos
Message 14 of 24
(1,449 Views)

Hi Choc,

 

Im glad that works. I've made a few alterations to the vi you posted. Im not sure if this will solve your output issue though. 

 

So what output do you see excatly..and what hardware are you using?

 

Regards,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 15 of 24
(1,427 Views)

Hi Hillman,

 

The VI you sent was written in LV 8.5, but I am running 8.2 so I can't open it. As for hardware, I have a USB-6259 (Mass-Term).

 

Cheers

0 Kudos
Message 16 of 24
(1,418 Views)

Here its in LV8.2

 

Mathan

Message 17 of 24
(1,413 Views)

Hi Choc,

 

Sorry about saving the vi in the wrong version - when will I learn!

 

Anyways, how did you find the vi?

 

Regards,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 18 of 24
(1,388 Views)

Apologies for the long delay in posting...I have been away/busy with other tasks.

 

The VI works great, but since your last posting, I have been informed that my VI needs to do something else. Basically, I am trying to include a means by which to turn off the AO. So for instance, if the AO is outputting at the defined output (during the HOLD phase), when I flick a switch, it should not just turn off immediately, but rather ramp down immediately from the HOLD value (1 V in this case) to zero. I imagine this is a situation where a case structure would be used, but I can't get it to work, so I was hoping the help forum could help. Cheers for all the help I have received thus far!

0 Kudos
Message 19 of 24
(1,339 Views)

Hi Choc,

 

So what happens in the code you posted?

 

My thoughts are the code I gave you was to output a certain waveform which you produce. Thus, to alter this during run time would cause problems.

 

I think to gain the effect you need, you may need to just send the data as per sample, and then when the switch is pressed, change the data your sending to the DAQmx write task.

 

OR

 

you could stop the task (terminate the while loop). And setup another task to output the 'off' ramp.

 

Let me know what you think.

 

Regards,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 20 of 24
(1,329 Views)