From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital input and output problem

Solved!
Go to solution

Hi:

I am doing a test for the digital I/O:
to output an array of digital signal from a DAQ output to the digital input to detect the signal.
(bascially, it is like a loop going outside of the hardware)

It is fairly straightforward as the attached file_1 shows.
It is working well.
The manual switch controls the light meaning the I/O are ok.

Then, I went to the low level DAQ for the better speed, as in attached file_2.
But this one doesnt work. Especially when I pressed stop to leave the loop, an error occured:

To speed up, I went to the low level DAQ, as the attached file_2.
But this one doesnt work. Espeically when I press the "stop" to leave the loop, the error occurs.

Possible reason(s):

Requested value is not a supported value for this property. 
The property value may be invalid because it conflicts with another property.

Property: SampTimingType
Requested Value:Sample Clock
You Can Select: On Demand

I dont understand why the sampling time has a conflict here.
(Probably it is just a very simple thing in DAQ, but I have checked few examples, and didnt find a clue.)
Hope anyone can give me a suggestion.


In the end, my goal is to do the attached file_3.
In this one, I generate a digital output, then lead to the input.
Then, I can take it as a signal to trigger my other task.


Note:

I am using a conti analoge signal to control one of my device.
I need to syncronize this with my another task.
So I am thinking to generate a digital output (which shares the same clock as the analoge signal on the DAQ device), then put it to one of the digital input.
By detecting this digital input, I can trigger my task, and sync with this analoge signal.
My device is USB-6211.
I am aware of the USB latency, but once the latency is a constant value, then the sync is still good for me.
Actually I was using a analog input to do so before, it can work, but the sync error is too big for me.
I need to do some calculation/judgement for this analog value, which makes the time difference varies.
So I am trying digital input now, and hope the digital input can trigger my task with stable latency.


Many thanks

 

 

Download All
0 Kudos
Message 1 of 9
(4,546 Views)

js777,

 

I noted in your desired behavior VI (the third one) you ultimatly want to generate and/or recieve a digital pattern (waveform).  As far as I am aware the DIO on the USB-6211 cannot do pattern generation or receive..  They are static and each state (1 or 0) must be written to the line or port one at a time.  Is that what you are trying to do?  

 

As for making the second version work the same as the first, you need to change the sample clock type.  As described above, I don't believe the DIO on that DAQ card supports pattern generation, so the sample rate must be set to Hardware Timed Single Point instead of Continuous samples.  That is likely where the error is coming from (the card not supporting the Continuous Samples).  To confirm, you can run the code with Highlight Execution on and verify that the error is occuring at the Sample Clock VI.

 

Let me know if changing the sample clock type works or not.  I don't have a card handy to test your code with at the moment, but can set one up if the above doesn't answer your questions.

 

Troy.

 

Troy
0 Kudos
Message 2 of 9
(4,522 Views)

Hi Tory:

Thank you for the reply.

I have tried the "hardware timed single point", and I still get the error.

As for what you said: the DIO in DAQ doesnt support pattern generation.

Does the "pattern" mean an array of signal (with a of certain sample rate, and a certain of sample number)?

It doesn't make sense to me if it doesnt support.
I have tried analog I/O, and it works well.
For the digital I/O, it is just change the signal to digital 1/0 (or say 0/5V). This should be easier than the analog s/n, so I think it should be supported. 
Although I dont know the detail about the DAQ hardward part.

btw
The digital signal I want to generate is like 100000100000100000....with a certain sample rate, say 4kHz, repeatedly. So I can just write , say 6 sample, and then run it continually.


Many thanks, js777

0 Kudos
Message 3 of 9
(4,496 Views)
Solution
Accepted by topic author js777
Have you looked at the specs? It clearly states that digital I/O is software timed. You don't have any hardware clock at all. The best rate that you could possibly achieve is around 1kHz and that would have considerable jitter due to windows non-determimistic nature.
0 Kudos
Message 4 of 9
(4,489 Views)

Hi Dennis:

Thank you for the reply.

Actually, I thought the clock can be shared between analog and digital I/O, and I am wrong. 
You are right that the timing for digital I/O is software controlled.
I thought the clock used for the analog s/n can be used for the digital s/n, it is just changed to digital s/n (010101....).

But how about the counter, the counter can support to Mhz, and the  "DAQmx Timing (VI)" seems to support referring to the on-device counter.

Many thanks, js777

0 Kudos
Message 5 of 9
(4,482 Views)
Yes, you can use a counter output but that, of course, does not have a pattern output.
0 Kudos
Message 6 of 9
(4,479 Views)

Thank you fro the suggestion.

the counter works well, like normal digital sqaure wave with tunable duty cycle.

I have two questions here:

1. how to use the software control for the digital I/O? since it doesnt support "pattern".  
note: there are 4 digital outputs, so if it is possible to use it to generate square s/n as the counter does, that would be helpful.

2. I need to sync this counter signal with my anglog output signal.
Do they share the same clock on the board? (I still need to test it, but maybe some advice is helpful.)

Many thanks

0 Kudos
Message 7 of 9
(4,467 Views)
Digital I/O is simply a matter of writing a true/false. You would use a DAQmx write set for single sample.

The counter and analog output use different clocks. I'm not that familiar with synching a counter and analog out. There might be a shipping example.
0 Kudos
Message 8 of 9
(4,462 Views)

I see, it is very helpful, I will find some information.
I guess probably I might simply buy a better board.

Many thanks again

0 Kudos
Message 9 of 9
(4,460 Views)