08-07-2010 11:52 AM
Hi,
1. I have a VI attached [digital_voltage_output] that should generate a static logical true or false state at the output of say device/port0/line1. When the VI is running I click on the button many times but nothing happens at port0/lines1.
2. Similar thing happens [digital_voltage_waveform_output_square] if I try to generate a digital waveform at the same pin with the square waveform generating VI. If I connect a waveform chart to the output of the function generator VI, then the chart will show me the proper waveform I want but still nothing is written into the text file.
3. I've read the manual for X series cards but it is still unclear for me a bit how to route things in LV. I have a frequency measurement VI of low frequency measurement that I downloaded. It offers me the ports for frequency input - ctr0,1,2, etc. As far as I'm concerned the PFI ports are responsable for these kinds of actions. How can I tell the LV that I wanna connect say ctr0 and pfi0?`
I use LV 8.6.
Thanks,
Krivan
Solved! Go to Solution.
08-09-2010 07:04 AM
Hi Kirvan,
I have been looking into the problems you are having with your DAQ tasks. I have had a look through the VIs that you posted and there are a few issues that I have identified that could be causing your problems. What I would suggest is that for relatively straightforward DAQ tasks like the ones you are working on, there are examples in the NI Example Finder (Help > Find Examples... from LabVIEW) which will illustrate how to perform such tasks. You can then also use the code contained within these examples as the basis for your application. I found the following examples which should help you out with the described tasks, though I would recommend having a look through the other examples to familiarise yourself with what's available. Please let me know if you are having any problems when using these examples
1. Write Dig Chan (found at Hardware Input and Output > DAQmx > Digital Generation)
2. Cont Write Dig Chan-Burst (found at Hardware Input and Output > DAQmx > Digital Generation)
Regarding your third questions, Table 7-9 in the X Series User Manual (on page 7-48) provides the information about the default NI-DAQmx counter outputs which is essentially the PFI line used by each counter.
I hope this helps.
Best Regards,
Christian Hartshorne
NIUK
08-09-2010 07:47 AM
Hi Christian,
thanks for your suggestions. The VIs are actually the basic blocks of a big project and I thought it was necessary to concentrate only on the problematic ones...
The single digital output works now. The problem was that the DAQmx Start Task VI wasn't included.
The Cont Write Dig Chan-Burst you suggested is actually not applicable to the PXIe-6358 cards. I have tried the Cont Write Dig Port Int-Clk previously but it only outputted the sample clock signal only up to 500 kHz, and I could not change the duty cycle. How would it be possible to change the duty cycle of the output waveform using for ex that VI? And I couldn't get the point of the "Pattern" right that is used in the VI. Can it be changed to have the duty cycle changed too?
Regarding the table in the manual, thanks that was exactly I was looking for!
Krivan
08-09-2010 10:37 AM
Hi Krivan,
I have made some modifications to the Cont Write Dig Port Int-Clk example such that you can now make changes to the frequency and duty cycle of the digital waveform. This may not be the best way to do this but hopefully it should show you that you can use the examples in the Example Finder as a foundation for your application and then you can add to and modify them as you want.
I hope this helps.
Best Regards,
Christian Hartshorne
NIUK
08-09-2010 12:23 PM
Hi Christian,
thanks for that it does exactly that is necessary. I tried to change the physical channels block to be able to select one single channel but I wasn't quite successful. At the moment it is only possible to select ports and the VI doesn't run until I type in "analog1/port0/line1". Is there an option for changing this property with a right-click [I haven't found it]?
Another concern is that I noticed that if I went over than 500 Hz the VI threw an error like the one attached. I thought it was about the sampling rule so I selected 1k Hz as frequency and 10 000 as sampling rate but the error comes up constantly.
I tried to connect the auto-start of the Write VI to a "true" constant and remove the start VI but it didn't help either.
08-10-2010 06:29 AM
Hi Krivan,
The problem you were having with choosing a specific digital line as a Physical Channel is that the control which was previously used in this example was created for a DAQ task that used an entire port rather than a specific line. I was able to overcome this problem by deleting the control and re-creating it. The control now gives you the option to choose specific digital lines e.g. PXI1Slot2/port0/line0.
I was also able to overcome the -200802 error that you mentioned. I was able to do this by wiring a True constant to the auto start input of the DAQmx Write VI and then removing the DAQmx Start VI from the subsequent code. Attached is the modified code.
I hope this helps.
Best Regards,
Christian Hartshorne
NIUK
08-10-2010 10:09 AM
Hi Christian,
I have modified the VI you sent as attached. It outputs a 50% duty cycle digital waveform at a frequency of f = sample clock rate / 2 Hz .
However in the VI you sent I was able to change the duty cycle only if I started to play with the values inside the express VI but then the frequency changed too. So I rather decided to use only 50% duty cycle and this way the card is able to output an appreciatable waveform up to 5 MHz. This is actually all I need so I mark your last post as solution.
It is though not exactly clear for me how the waveform is actually generated from the programming point of view. Can you please clarify what conversion is done between the express and write VI? And however the VI is running now and working as expected can you explain how the 500 Hz digital input waveform of the Write VI becomes 1MHz at 2MS/s sampling rate? I mean 2 MS/s is nearly 2 MHz and according to the sampling rule the 1 MHz output frequency determined by the DAQmx Timing VI is straightforward so then I don't understand the role of the 500 Hz digital waveform that is provided by the express VI...
Thanks for your help.
08-11-2010 06:09 AM
Hi Krivan,
The conversion process between the Simulate Signal Express VI and the DAQmx Write VI is required since the Simulate Signal VI only outputs data in the Dynamic Data Type. This is a special data type that is only used by Express VI's. Since you are writing multiple samples to a single digital channel in the DAQmx Write VI it is expecting the data in the digital Waveform data type. I have then used a combination of functions to perform this conversion process. This is probably not the best and certainly not the only way of performing this conversion. In order to gain an understanding of each of the individual functions I would recommending using the Context Help tool.
The purpose of the Simulate Signal Express V is therefore to generate a square wave, for which you can vary it's duty cycle, which is then subsequently converted into a digital waveform which is written to your digital port. The time parameters (including sampling rate) are then defined solely by the DAQmx Timing VI in your DAQ task. When you write a digital waveform to a digital line in this way, the timing parameters inherent in the waveform are discarded.
I hope this explains things.
Best Regards,
Christian Hartshorne
NIUK
08-11-2010 10:57 AM
Hi Christian,
yes, that really makes sense now. Thanks!