01-17-2011 03:57 AM
Hello,
I am looking to solve the following problem:
I need to output either "low" voltage or high Z on a digital output line. From what I understand so far, a counter can only output "high" and "low", and in order to change it to tristate the task has to be cleared. This means that if I want to do it in a loop, I will have to redefine the whole task each iteration.
Is there any other more elegant solution to this?
(I am using a USB-6229 DAQ)
Thanks a lot in advance 🙂
Michal
01-17-2011 05:43 AM
Hey Michal,
Unfortunately I think the only way how to set counter to be in High impedance is either cleat task or set counter to input mode (not output). I can't see other, nice or elegant solution
regards,
stefo
01-17-2011 05:37 PM
If you want to tri-state the line it has to come from a software call, but you don't need to restart the whole task to do so. The attached code uses the DO.Tristate property along with a DO task to set the line to tri-state.
Best Regards,
01-18-2011 05:21 AM
John,
I believe you usually without question , but - will it affect counter operation as well? I mean in case you have commited counter output task, can you set the PFI output to DO-tristate?
stefo
01-18-2011 01:39 PM
Hi Stefo,
Thanks for bringing this up--my post isn't using the counters but instead is using a Digital Output task. If Michal wants to alternate between low voltage and tri-state there isn't really a purpose to use the counters so this is what I would recommend.
It's actually pretty tricky to tri-state a counter output task. Calling DAQmx Tristate.vi attempts to route "Tristate" to the PFI line, but when you're using a Counter Output task this route would already be reserved. You can tri-state the line on X Series by configuring a watchdog task to timeout and set the line to tri-state, but I couldn't find a good way to turn the line back to output without restarting the counter task.
Best Regards,
01-19-2011 11:09 AM
Thanks, John 🙂
The diagram you sent looks like what will do the trick... I don't need the line as counter, so I will just do this with DO task.
Can't check it right now (not working, sick a bit...), but it looks promising.
Have a nice week, everyone 🙂
Michal