How can I set up a digital input task to read continuous samples?
I am trying to create an exclusively digital task that will make digital readings at a rate timed by the material using a PCIe-6509. However, when I try to put the task timing as follows (which works on a PCIe-6509), I get the following error:
Requested value is not supported for this property value. The value of the property may be invalid because it is in conflict with another property.
Property: NationalInstruments.DAQmx.Timing.SampleTimingType
Required value: NationalInstruments.DAQmx.SampleTimingType.SampleClock
Possible values: NationalInstruments.DAQmx.SampleTimingType.OnDemand, NationalInstruments.DAQmx.SampleTimingType.ChangeDetection
Task name: DigitalInputTask
State code:-200077
The relevant parts of my code are:
public class DigitalInputReader: IDisposable
{
public DigitalInputReader()
{
dataReadyHandler = new System.AsyncCallback (DataReadyEventHandler);
daqmxTask = new DigitalInputTask();
daqmxTask.Configure (Globals.NI);daqmxTask.Control (TaskAction.Verify);
daqmxTask.Control (TaskAction.Commit);daqmxReader = new DigitalMultiChannelReader (daqmxTask.Stream);
}public class DigitalInputTask: task
{public DigitalInputTask(): {base ("DigitalInputTask")}
public virtual void Configure (NiConfiguration niConfig)
{
<= niconfig.digitalinputs.count="" -="" 1;="">=>
{
String physicalChannelName = niConfig.Device + "/ port" + niConfig.DigitalInputs [i]. Port.ToString () + "/ line" + niConfig.DigitalInputs [i]. Channel.ToString ();
String nameToAssignToChannel = niConfig.DigitalInputs [i]. Name;DIChannel ch is this. DIChannels.CreateChannel (physicalChannelName, nameToAssignToChannel, ChannelLineGrouping.OneChannelForEachLine);
c. InvertLines = niConfig.DigitalInputs [i]. InvertLines;
}
var signalSource = "";
This. Timing.ConfigureSampleClock (signalSource, Globals.MachineSettings.SampleRate, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples);// Globals.MachineSettings.SamplesPerChannel);
}
}
The last call to Task.Timing.ConfigureSampleClock, it's which throw errors.
Of the options available, or SampleTimingType.OnDemand or NationalInstruments.DAQmx.SampleTimingType.ChangeDetection provide the same precisely timed calls that I am familiar with the analog input interruptions.
How is it possible in a digital task? I mean, it seems that I could set up another task to do call by material for the production of a clock signal and use the ChangeDetection synchronization mode, but this seems a bit complicated for what should be easy to do. What Miss me?
Update: I thought about it. You cannot call ConfigureSampleClock when the digital input card is a device of 650 x, because these devices have any automated examples of clock. They are configured to run in mode default finite samples. You must make all sample synchronizing with these devices in the software.
Be cautious, however, because the .NET timers ensure they put any faster than their scheduled interval. In practice, they are usually 5 to 10 ms slow by tick. This means that if you want to read samples every 100 ms by sample clock, you'd end up reading all 108 ms samples. All counters based on the elapsed time and number of samples would be away after a few seconds of it.
Instead, you must do one of four things: write a doggone driver that runs in ring 0 and interfaces with the PCIe card in the required interval (i.e. on NC, not you, in practice), tolerate the inclination of the clock, use a multimedia timer as an interruption audio or video that is more likely to respond to the correct interval, or , my solution, an accurate clock allows you to set the interval of the timer. I wrote the following code to the timer:
var CorrectiveStopwatch = new System.Diagnostics.Stopwatch();
var CorrectedTimer = new System.Timers.Timer()
{
Interval = targetInterval,
AutoReset = true,
};
CorrectedTimer.Elapsed += (o, e) =>
{
var actualMilliseconds =;
Adjust the next tick so that it's accurate
EG: Stopwatch says we're at 2015 ms, we should be at 2000 ms
2000 + 100 - 2015 = 85 and should trigger at the right time
var StopwatchCorrectedElapsedMilliseconds = newInterval +.
targetInterval-
CorrectiveStopwatch.ElapsedMilliseconds;
If we're over 1 target interval too slow, trigger ASAP!
<=>=>
{
NvelIntervalle = 1;
}
CorrectedTimer.Interval = NvelIntervalle;
StopwatchCorrectedElapsedMilliseconds += targetInterval;
};
I hope this helps someone.
Tags: NI Software
Similar Questions
-
I installed Adobe Reader on my tablet, 4.4.2 Android OS and I am able to view the PDF. Files but wh I'm going to print it wants to print to Adobe cloud. How can I get out of my printer wireless?
Hello
Open the pdf file to print. Select Print Options from the options menu. Print dialog box appears. The option all printers in the first drop-down list. Now select your wireless printer. Now press the "print" key.
Thank you
Adobe Acrobat team
-
How can I set default values to set the Mode in the config of the AO?
Hi, how can I set default values to allocate mode in the config of the AO. To be precise, in the attached vi, I need to set the Mode allocate in the AO Config to ' use FIFO memory (6) ' if the value inside the structure of my case is false and 'no change (0)' if the value inside the strusture case is true.
Create two constants for Mode allocate input (right click > create > constant). A place in the real case of the structure of the case and place it in the case of false. Their son in the same tunnel (border of the structure of the case), then the tunnel of wire to the pole to allocate the AO Config Mode. I do not have traditional DAQ installed, but who should do it.
-
How can I set up a daily playlist for podcasts on Iphone 5
How can I set up a daily playlist for podcasts on Iphone 5
Without further explanation of what you want the list of reading to do, it is difficult to suggest something specific...
You can just go down the list of the Unplayed episodes and start listening to. That you have finished playing the episode, it disappears from the list, so it is always "fresh" next time.
-
At the launch of Thunderbird, how can I set a password that prevents viewing of my emails if someone uses my computer?
100% this addons can help you
https://addons.Mozilla.org/en-us/Thunderbird/addon/master-password/Look at my Thunderbird when I open
-
How can I set the default download locations
How can I set the default download locations?
You can watch here:
- Tools > Options > general: downloads
-
It's my 1st iPhone. How can I set up my voicemail? Thank you!
It's my 1st iPhone. How can I set up my voicemail? Thank you!
nonnamac wrote:
It's my 1st iPhone. How can I set up my voicemail? Thank you!
To set up Visual voicemail on your iphone, you will need to contact your cell phone provider to implement.
-
How can I set a password for firefox so that everyone must enter the password before running firefox
My younger sister run my firefox just to this afternoon (she origin use IE), and she saw something that is not visible. How can I set a password for firefox so that everyone must enter the password before running firefox?
Another option is the master password + extension.
You must first make sure that Firefox uses a master password, for more details on how to do that see use a master password to protect stored logins and passwords. Then with the master password + extension in its options, go to the getting started section and make sure that "ask for password at startup" and "Exit if cancelled" is selected both.
As with all extensions, this protection is quite weak and can be bypassed if start you Firefox in safe mode that disables extensions.
-
I remember my Skype ID but I don't remember my password? How can I set a new password?
I remember my Skype ID but I don't remember my password? How can I set a new password?
If you are still using the same email account, that you used when you created your Skype name, you can have your password of rest through this link:
https://login.Skype.com/account/password-reset-request
Please note: I do not answer requests for help via private Message. -
How can I set contact ringtone purchased on multiple devices?
I have a few iPhones: 5, 6, and 6... How can I set ringtone touch purchased on iTunes Store on multiple devices?
Because you can not download again for free, you will have to try to sync them with your devices, see this article:
-
How can you set it up to play 2 songs always together?
How can you set it up to play 2 songs always together in iTunes, downloaded on your ipod?
You can reach consecutive tracks whole CD you rip a CD, a file which has two songs, otherwise you can not really do. There is an iTunes feature called Shuffle by grouping, but it is not the iPod.
TT2
-
How can I set up my new Officejet Pro 8600 more printing on paper photo 4 x 6?
How can I set up my new Officejet Pro 8600 more printing on paper photo 4 x 6? I'm running on Windows 7 64 bit.
It's strange. Looks like you have a second paper tray and put it to the default tray. The second paper tray only supports the types of paper that show on your list. It's strange because unless you have purchased a second tray paper, plus model has one. Does only the high-end model. Other than that, only certain types of media can be duplex, so if you have double-sided printing, it can limit the selection. I'll watch what else could be the cause and get back to you.
-
How can I set the time axis on my waveform table to show run time that is to say whenever I start the program I should have 0 as the starting point. I've been messing around with the without success. I'm under Labview 2012.
Thank you!
Townes wrote:
I can't understand what you mean. I have no formal training with labview. It took me a long time to write the simple program that I joined. Any guidance would be greatly appreciated!
Its pretty normal for a beginner to take the time to write code. Right-click the map of waveform > Create > property node > historical data, you will get a property node, keep this at the beginning of the code and create a constant. You can also go to the VI properties and > run and select "clear indicators when it is called.
I recommend you to go through the basic materials of LabVIEW which will give you an understanding on the basics of bases/components of LabVIEW.
-
How can I set up a website that charges a small fee when landed on?
Original title: Mother Mary
How can I set up a website that charges a small fee when landed on? I have something to show to the world & I, that the award is not unreasonable
[Moved from the community centre of Participation]
First of all, this is not the arena for that. Do some research on Google and Bing.
Then, if someone has to pay a fee, it should be their choice, whether they pay or not. It'snot automatic. You will need to research the acceptance of credit card, merchant gateways, set bit. And it won't be cheap.
-
How can I set up a wifi connection?
Programs Application Applications Apps game games Legacy Crash crashes Hang Application Compatibility hangs
How can I set up a wifi connectionHello jamesjones882
Please see the link below for setup of wireless networks. Thank you.
Maybe you are looking for
-
Satellite L350D PSLE8E stuck on windows startup screen 7
Help! Unable to get the computer to spend the start of Windows 7 screen. Just upgraded from Vista to 64-bit Windows 7... bad idea, any help please?
-
With the help of outlook express.
-
Preview of images or wallpapers
I can't preview photos or background images to display. While I was a disc cleaning performance,I accidentally deleted the program from the Windows Gallery which was in the D: drive. I reinstalled the gallery and tried to fix the damage I had done. W
-
disable cookies so that I can get on a web site _
disable cookies so that I can get on a web site
-
Hello I did a new install of Win 7 homebasic SP1 64 bit and installed all the latest drivers of Lenovo for my E320. The UltraNav driver version is 15.3.27.1. If I push the TrackPoint, right, the cursor moves to the low right direction If I push the T