11-26-2008 03:27 AM
Hello Tom ,
I am able to read correctly from the channels of ADC
and was able to configure DIO as per my requirements.
Thank you.
Hello Gaurav ,
I am not at all hesitant to post questions.
I am in development phase right now , will post questions
as i come across .
As per Tom's reply, I am currently looking into G1 Gate interrupt.
If you can share more stuff on it, it can reduce my development time.
Let me know ..
Thanks,
Irfan
11-26-2008 06:47 AM
Hello Tom,
The M Series User Manual describes DI Change Detection in Chapter 6.
There is also a mention about the following
The Change Detection Event signal can do the following:
• Drive any RTSI <0..7>, PFI <0..15>, or PXI_STAR signal
• Drive the DO Sample Clock or DI Sample Clock
• Generate an interrupt
Is there an example for DI Change Detection Generating an interrupt ..
Let me know
Thanks,
Irfan
11-27-2008 01:14 AM
Hello Tom ,
As is posted earlier , I am able to read correctly from the channels of ADC ,
getting correct outputs at DAC and able to configure DIO as per my requirements.
Thanks for the support.
Moving on ..
Q1 . Can you elaborate more on the magic number 280 in aiConvert (board,280,280,kFalse);
Q2 . Is there a way to bit address the 24 DIO lines ?
Operations like set P0.1 or P2.5 and reading the status of the same ..
I am not able to get an idea about this from your previous replies.
Q3 . I looked into the G0 or G1 Gate interrupt discussion.
My application has 7 Status Inputs (7 Bits) which i need to read on interrupt basis.
The DI Change Detection Generating an interrupt suits my requirement .
Is there any example for this case .. following the MHDDK standard ..
Else even the steps to do it would be benefcial .
Happy Thanksgiving ..
Reagrds,
Irfan
11-28-2008 01:14 AM
12-01-2008 10:45 AM
Hi Irfan-
The 280 number in aiConvert indicates the timebase divisor for creating the CONVERT clock (see STC Technical Reference Jan 1999, page 2-4) for more info. Keep in mind that you must leave enough time between START cycles for the total number of CONVERTs to occur. For example, for a scan rate of 10k with 5 channels you would need to choose a divisor of 2000 (20M/2000 = 10kHz) for aiSampleStart and at most 400 (20M/400 = 50kHz) for aiConvert. More discussion about the algorithm used by NI-DAQmx for maximal inter-channel accuracy can be found here.
P0 can only be read or written using the method shown in dioex1.cpp from the M Series MHDDK. DIO_Direction chooses line direction (where 1=output) and Static_Digital_Input and Static_Digital_Output are used to read and write from P0. P1 and P2 can only be read or written using the method shown in dioex2.cpp. My discussion in this thread on 25 November shows how to set line directions and input/output for P1 and P2. PFI_DO.writeLowerPort and writeUpperPort refer to P1 and P2, respectively. Those ports use the PFI interface and can not be addressed in the same manner as P0.
Digital change detection is not supported in the MHDDK at this time for M Series.
Let me know if you have any other specific questions. Thanks-
12-02-2008 03:57 AM - edited 12-02-2008 03:59 AM
Hello Tom,
Thanks again for the support.
Some other questions:
1. The last bit value of '1' corresponds to output and a value of '0' corresponds to input in PFI select.
What does bits 0-3 corresponds to?
2. I have connected an Analog Output to an Analog Input.
When I am writing data to the Analog Output, it’s perfectly correct when measured (say 5V).
But when the same value is read back via Analog Input, Its is not that exact (4.9XX V).
How can I increase the accuracy of Analog Input?
3. My application has 7 error status inputs (7 Bits digital), which should be creating an interrupt.
If the Digital change detection is not supported in the MHDDK,
At least is there any example pseudo code for Change Detection Generating an interrupt ..
Else , Recommend the steps to be followed.
This is the last and important part of the implementation of my application
Thanks,
Irfan
12-10-2008 10:27 AM
Hello Tom,
Was waiting for your reply ..
Would like to know the following :
1. The last bit value of '1' corresponds to output and a value of '0' corresponds
to input in PFI select.
What does bits 0-3 corresponds to?
2. How to increase the accuracy of Analog Input?
Do suggest some methods for it .
3. As soon as the PCI Card is powered up , How to set a default values for Outputs ?
Say , the DO Port P0.1 to be high when the board is powered .
4. Can I change the scale of AI or AO to act in range of 0 to 255
instead of 0 to 32767 ( 0 to +10V range ) ?
5 . Needed an example pseudo code for Change Detection Generating an interrupt .
Else At least recommend the steps to be followed.
Thanks,
Irfan
12-11-2008 01:25 PM
Hi Irfan-
1. See my first post in this thread. Let me know if you have other questions about PFI Output Select.
2. How are you measuring the analog output when it reads exactly 5.000V? There is no way to increase AI accuracy beyond the methods shown in the MHDDK, unless you are using a multi-channel scan and can increase the time between each channel is sampled (by increasing the AIConver period, see my last post for more info). It may be possible that the M Series is more accurate than your external measuring device. I find it unlikely (even though the M Series AO is very accurate) that it would read exactly 5.000V all the time on any measurement device.
3. You can accomplish this using the Programmable Power Up States feature of M Series DIO. This feature is not supported in MHDDK, so you would need to take the device to a Windows machine with NI-DAQmx installed and perform the steps described here.
4. No; there is no way to configure the M Series to act as anything other than a 16-bit (or 18-bit) device. You can adjust the PGIA range to something other than +-10Vby adjusting parameters in aiConfigureChannel() and aiGetScalingCoefficients. See comments in ai.h and scale.h for allowed values.
5. As I mentioned before, digital change detection is not supported in the MHDDK for M Series. The support files do not contain the necessary register definitions, so I can not provide an example or describe the operation. If you require this functionality please contact your NI field sales engineer and ask him/her to help you evaluate your need for this feature and provide feedback to NI R&D.
Thanks-