04-27-2009 04:40 AM
04-28-2009 11:28 AM
Hi,
Unfortunately I do not believe this is possible to do automatically given an application crash. It can be done programmatically but obviously once your program has crashed its too late! This can be done by manually reseting the device. How to do this depends on the platform you are on. What is your environment? e.g. OS and language
Regards,
04-28-2009 11:43 AM
Hi,
OS is redhat linux and I'm writing regular C.
I would have thought when the prog crashes, all the NI threads would diasappear which must close open fd's to the device? This should cause the OS to enter a close part of the driver?
I'm getting around it in a messy way by having a high priority "minder prog" which monitors a heartbeat in a shared memory segment. If it looses this, it does a reset on the board.
Only way I could get this to work was to create a task on the device, define an operation to it but NOT start it. Anything less seemed to prevent the board reset from working?
Have you got any better ideas?
04-30-2009 07:42 AM
Hi,
As far as I am aware the driver does not work in this way but I shall double check this fact as I am not certain. Given this it sounds like you have found a suitable if not ideal work around. Although you mention about making a task for the card. Does the reset not work without this?
Regards,
04-30-2009 10:38 AM
Hi,
No, it appeared that unless a task had been defined and loaded with something, the reset did nothing.
Maybe the code thinks "well, if I've got nothing on the go, why should I have to reset?"
On another issue, I am using the DAC 6713. At the moment I'm driving in "on demand" mode, but would prefer to drive it in clocked mode as I think it will run faster ( I'm trying to get 1Khz).
I only want to write 1 value for each channel (8 values in total) at a time. So what I really want is to be able to specify the FIFO size to be 8 and for the system to block when I write new data (I will always be early), and wait until the last 8 values have been clocked out and then take my new data and release my code.
Is this possible?
cheers
05-05-2009 04:53 AM
Hi IvoryStag,
Certainly if you want to get a reliable 1k rate you will need to use clocked mode however the buffer size you set is samples per channel and it won't allow a value as one as it requires a buffer of size 2 or more. To get the consistent rate and ensure you don't get buffer underflow errors you would be much better writing to the buffer in larger chunks anyway, would this work with your application?
Regarding on waiting for those values to be clocked out unfortunately there is no function in DAQmx Base for doing this.
Regards,
05-05-2009 06:41 AM
Hi,
I'm always using more than 1 channel, so I can set 1 sample/chan (lets me do that anyway!)
And I'm not too worried about when in the 1ms window the data goes out, as long as it's not late.
Also, i cant calculate the next sample to go out/chan till I've got a new sample/chan in from the ADC!
So, if there is no way ofgetting the DAC to hold, I'll have to use the device on demand.
However, since I've replaced the digital o/p stream with the onboard clocks, the DAC o/p waveform looks as clean as a whistle. Before, it was all screwed up. Just looked as if the DAQ subroutines were getting overloaded?
So, at the moment, I'm happy I'm able to get 1 sample in on 32 channels of ADC and 1 sample out on 8 channels of DAC at 1 Khz.
Thanks for all your help
cheers