07-30-2015 05:56 PM
Hi,
I am having problems creating a linear scale for my Analog Input task. I want to scale up the input by 100x, and am creating a custom linear scale to do so. Here is my code:
DAQmxErrChk(DAQmxCreateTask("", &task2));
DAQmxErrChk(DAQmxCreateLinScale("cScale", 100, 0.0, DAQmx_Val_Volts, "pA"));
DAQmxErrChk(DAQmxCreateAIVoltageChan(task2, chan, "",DAQmx_Val_Diff, -1000, 1000,DAQmx_Val_FromCustomScale,"cScale"));
DAQmxErrChk(DAQmxCfgSampClkTiming(task2, "", fSamp, DAQmx_Val_Rising, DAQmx_Val_ContSamps, sampsPerChan));
DAQmxErrChk(DAQmxStartTask(task2));
However, this isn't working - it just gives the same regular input. I've played around with numbers and found that as long as the scale factor is less than 10 it works okay, as long as my "min" and "max" values are set to -10 and 10. Anything past that just causes it to be unscaled.
Any ideas why this could be happening/how to fix it? Thanks!
08-03-2015 07:54 AM
Hello nano8874,
Have you tried changing the values of your AI Voltage Channel? Right now you have it from -1000 and 1000, try and change this to a wider range.
Regards,
08-03-2015 11:56 AM
Hi,
I can't increase the range - the maximum range for my device is -10 to 10 V. So the max range for 100x that is -1000 to 1000. If I try to increase it beyond that I get an error.
08-03-2015 12:05 PM
Nano8874,
When you try to do this same thing on NI MAX, do you get the same behavior?
12-22-2020 03:46 AM
HI,
I am facing the same problem with CVI.
In NI MAX, I can adjust the "Signal Input Range" and the wave comes un-chopped, which seems good. How can I set this property in CVI.
12-23-2020 02:19 AM
I can suggest two different approaches to this problem:
12-23-2020 07:55 AM
I have applied both the approaches. The data samples are logged in .tdms file and viewed. The data samples are chopped as shown below.
However in case of NI MAX, the wave is chopped when the input range is reduced.
NI MAX allows me to set the highlighted values (in the above figure) to higher value than device limits(+-10 V) say 10000 and -10000.
But the CVI gives me an error when I configure:
DAQmxErrChk(DAQmxCreateAIVoltageChan(MY_Task, "PXISlot1/ai0" , "ChnnelNo1" ,DAQmx_Val_Diff , -10000.0, 10000.0, DAQmx_Val_FromCustomScale, "MyScale") );
How can I configure CVI to pick the max and min values +10000 and -10000 so that my waveform is not chopped?
In other words, how to set the Signal Input Range in the task (input after scaling)?
Thanks.
12-23-2020 09:09 AM - edited 12-23-2020 09:11 AM
Please let me clarify some concept: the fact tat you can set in MAX values higher than ±10V does not imply that you can input in your DAQ board such values! The ±10V limit is a hardware boundary that states the maximum input range that your board can accept and elaborate to output a meaningful value; signals exceeding this range are clipped and ultimately could damage the board (see the overvoltage protection section in AI specifications).
So question is: is you signal within the ±10V range (peak-to-peak)? If it is then you can input it in the board and it will return a meaningful measure. After that step, you can map the raw output value to a meaningful scaled measure mapping your voltage value to pair the transducer characteristics.
Just as an example, supposing you have a tachometer with 1000 rpm / 10V characteristic, you can create a x100 linear scale and have the DAQ board output e.g. a value of 500 (rpm) for a 5V input
12-23-2020 09:17 AM
My input signal to NI DAQ card is actually pure sine wave of amplitude +2 and - 2V pk.
Now the actual signal is attenuated by about 1000V / 1V.
In my calculations in NI, I want the actual values that are around 2000 units peak....
12-24-2020 12:22 AM
Even if you set input values to ±10V, you are still using a custom scale ('MyScale') and the diagram is scaled to ±1.2k.
To examine the pure original signal you must set intput range to ±10V and Custom Scaling to <No Scale>: if you are able to see your sine wave signal unclipped then it can be read by the DAQ board, otherwise it exceeds board capabilities. You can also test the signal with a multimeter: it can be measured safely if it is <= 7V RMS