08-28-2012 03:03 AM
Hello,
I am using a counter on NI-6351 namely PFI13 which outputs a certain frequency. It works fine as I am able to start and stop the task.
My question is how to bring this channel in high impedence state (hochohmig). I try to do it by calling the function DAQmxTristateOutputTerm("Dev1\ctr1"), but it returns me an error code: -89129 and "Terminal for the device is invalid" as respective error message.
Any clue why I can not perform this function?
Regards
RB
Solved! Go to Solution.
08-28-2012 03:39 AM
Hi RB,
I found a similar thread on the forum. the solution discussed there could maybe help you:
http://forums.ni.com/t5/Digital-I-O/PCIe-6537-signal-routing/m-p/575621?requireLogin=False
Regards
08-28-2012 03:46 AM
Alternatively, what happens if you use the function DAQmxResetDevice ?
08-28-2012 06:42 AM
I saw the thread but I am not doing any signal routing. Reseting the device is not an option for me as its digital ports are driving another device.
I am using the following code (ignore syntax):
Actually I have 2 problems:
1. I have to keep the task running till I need aFrequency at the ctr1
2. DAQmxTristateOutputTerm throws the error that I mentioed earlier.
/* For Starting task. This outputs aFrequency at PFI13 */ aPFIPortName = "Dev2/ctr1"; DAQmxCreateTask("", &g_FreqTaskHandle); DAQmxCreateCOPulseChanFreq(g_FreqTaskHandle, aPFIPortName,"",DAQmx_Val_Hz, DAQmx_Val_High, 0.0, aFrequency, aDutyCycle); DAQmxCfgImplicitTiming(g_FreqTaskHandle,DAQmx_Val_ContSamps, 1000); DAQmxStartTask(g_FreqTaskHandle); /* For Stopping task. This stops aFrequency at PFI13 and sets it to DAQmx_Val_High */ if(g_FreqTaskHandle) { DAQmxStopTask(g_FreqTaskHandle); DAQmxClearTask(g_FreqTaskHandle); g_FreqTaskHandle = 0; } /* For setting aPFIPortName in High impedance state */ DAQmxTristateOutputTerm(aPFIPortName);
08-28-2012 07:50 AM
Hi RB,
I am not sure I understand the goal you are trying to achieve. Waht I understood is that you want to use a PFI port for pulse generation until a time T where the generation should stop and you want to start a measurment task on the same port, this without having to reset the device. Is it correct?
bers regards
08-28-2012 08:06 AM
Parially correct. I have a test point (a wire) coming out of my device. I can either measure voltage at this test-point(using AI port) or I can input a noise signal at this point (using PFI port). So I have connected my testpoint to PFI port and AI port as well.
In one of my test cases, I create noise signal at this port and observe device behaviour. Now I have to run another test case I measure Volts at the test point, without manually disconnecting the test-point from PFI port. For this purpose it is very important for me that PFI port goes into high impedance mode.
08-28-2012 09:11 AM
I could not find a lot of information on this toppic on our internal DB.
However I found a DO property that allow you to set a digital line in Tristate. First question would be:
* What happen if you modify your code that way:
/* For setting aPFIPortName in High impedance state */ aPFIPortName = "Dev1/port2/line5"; // PFI13 and P2.5 are the same line DAQmxTristateOutputTerm(aPFIPortName);
as the tristate property are only for digital lines, adressing the port by his line name could maybe help.
* The second idea would be to commit a dummy digital task to set the digital out tristate property to TRUE. The syntax is the following:
DAQmxSetChanAttribute (taskHandle, "Dev1/port2/line5", DAQmx_DO_Tristate, 1);
I hope this is of some help for you.
Best regards
08-28-2012 10:42 AM
Hi,
Thanks for replying so soon. I appreciate it.
I liked the second idea and implemented it after stopping and clearing my frequency task with the following code. I declared a channel P2.5 as a DI channel in MAX. But I am still not getting the High impedance on the channel after stopping my dummy task. Any idea what I am doing wrong?
DAQmxCreateTask("", &g_TaskHandle); DAQmxAddGlobalChansToTask(g_TaskHandle, "TriState"); DAQmxSetChanAttribute (g_TaskHandle, "TriState", DAQmx_DO_Tristate, 1); DAQmxStartTask(g_TaskHandle); DAQmxStopTask(g_TaskHandle); DAQmxClearTask(g_TaskHandle); g_TaskHandle = 0;
08-28-2012 10:55 AM
Sorry, got the error. Was using wrong handle.
Many thanks, from my team mates too 🙂
08-28-2012 04:28 PM
You're welcome. Good luck for the development.