06-09-2009 09:37 AM
All,
I have been working on a VI whose function is the following:
- Acquire data from three sources
- A block of eight displacement sensors connected via RS232 (using a USB adapter)
- An NI-USB 6210 card measuring voltages across eight batteries
- Another NI-USB 6210 card measuring voltage across four load cells (these correspond to batteries one through four).
- Data acquired at 1 Hz, written at 0.2 Hz (no buffer - simply writes one fifth of data recorded)
- Open/close a relay board based on certain inputs
- Provide basic UI functionality to control data manipulation, display data, and write data to text files
- Write data to text files
We have run four tests with this VI. Each test runs for anywhere from 24 to 48 hours. During three of these four tests, we have lost connection with one or both of our NI DAQ cards. I have attached one of the output files - notice that in the 'Current (mA)/Voltage (V)' and 'Load (N)' columns, at a certain point on of the cards starts reading 'NaN', followed soon after by the other card. Note that this has happened on two different computers, one laptop and one desktop, both of which had hibernate/sleep disabled.
For your reference, I have attached the VI. This VI will not run as there are some subVIs that I have not included; these subVIs do not do anything critical to the execution of the program. The program generally runs as follows:
- Initially, a subVI runs that aids the user in selecting the appropriate COM port and USB devices.
- The VISA device and DAQ cards are initialized, all relays are opened, variables are initialized
- In parallel, there are two producer timed loops, one consumer for loop and an event loop
- One producer loop continuously acquires voltage data from both DAQ cards. When the loop is over, basic DC voltage values are taken from all samples in each buffer, and the values are enqueued
- One producer loop acquires one reading per loop from the displacement sensor (via a VISA Write -> VISA read), and the response string is enqueued.
- The consumer loop runs at a similar timing as the producer loops (blocked using queues). It manipulates, displays, and records acquired data. It also opens relay channels if the corresponding displacement values are greater than a set threshold.
- The event loop opens text files for writing when a button is depressed, as well as performing basic tasks such as clearing graphs, etc.
What is the cause of this issue? What am I doing wrong? This error is preventing us from running tests at our company. Any help is greatly appreciated.
Thank you,
Bryan
06-09-2009 10:03 AM
Bryan,
My first suspicion would be the relays. What is driving them? Have snubbers been installed across the coils?
06-09-2009 10:39 AM
Wayne,
Thanks for your reply. Unfortunately, my knowledge is limited in this area. We are using an ADU208 USB relay from Ontrak (information here: http://www.ontrak.net/ADU208.htm). We are using the bundled subVIs to open/close each channel of the relay depending on the acquired data. How could this relay board affect the DAQ communication?
It may also be important to note - I have tried to make this VI so that all devices need not be used all of the time. That is, sometimes we choose to not use the relay, sometimes we choose to not measure load, and sometimes we choose not to measure current. This means that we do not always have the same hardware connected, but the software runs the same and deals with the resulting errors appropriately (hopefully). The previously attached output file is from a test where the relay was not connected, however the relay commands were still run (and presumably threw errors).
Thanks again for your help
Bryan
06-09-2009 10:49 AM
Bryan,
Reason I asked about relays is because when the coil of a relay is de-engergized, a large pulse of energy is produced. If not properly dealt with, this pulse can disrupt a lot of things. In this case you are using a third party device that I would assume has dealt with this issue. What are these relays switching?
On another front, any chance your computer is going into standby mode? Page 5 of manual has a warning about this.
06-09-2009 10:52 AM
Wayne,
The relays are opening/closing a circuit that is driving a low voltage battery (~.3 V) at approximately 1 mA.
Bryan
06-09-2009 10:53 AM
06-09-2009 11:30 AM
Bryan,
Does the current vi return an error indicating that the hardware can't be found?
06-09-2009 11:54 AM
Wayne,
Not sure - in order to allow the VI to adapt to different hardware configurations, the current is set to ignore errors at this point. Is there any possibility of some kind of interference/address issues due to having multiple DAQ cards running on the same PC ?
Thanks again for your help,
Bryan
06-09-2009 12:07 PM
Bryan,
You need to modify the vi so any errors/warnings generated by the DAQmx read function are captured.
06-09-2009 02:16 PM
Wayne,
Noted - I will make that change immediately.
One thing that I had just thought of - this problem seemed to originate around the same time that I set the acquisition rate to 1 Hz. My chart history length is very long - 500,000 samples - so it must be saving each data point somewhere. Measuring at 1 Hz for two days with 2 cards and 8 channels per card...is there a possibility of some kind of memory issue causing this? I read something similar to this in another thread.
Thanks,
Bryan