LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Acquisition Problems

Hello,
I have two external devices providing data to my program. One device provides 4 strings and the other one- bothe repeating themselves. I am only able to collect approx. 50 strings of data before their order is lost. Has anyone had such problems? I am using two Polhemus 3D tracking devices.
Thanks,
Ivanka
0 Kudos
Message 1 of 12
(3,569 Views)
How are the devices communicating with your program? Is there any error checking on the communication? Do you lose data or does it just get out of order? Without more information we will not be able to help.
0 Kudos
Message 2 of 12
(3,569 Views)
I am communicating using VISA READ and WRITE. Yes I have error checks on VISA READ, CLOSE and OPEN. Is there another kind of error I should be checking for? Initially (at a low baud rate) LabView gives me the data in the correct order for 1.25 minutes, which is 115 strings. After that, like clockwork, it reads in the incorrect order and loses some data points.
The first thing I did to correct the problem was to lower the baud rate to the lowest, however, I am not satisfied with 1.25 minutes of good data.
I really appreciate your help!
Ivanka
0 Kudos
Message 3 of 12
(3,569 Views)
Can you read each instrument alone for an indefinite time without errors? Check the Bytes at Port value. If it starts to grow before the errors occur, then you are getting some kind of communications backlog. What baud rates have you tried?

Can you communicate successfully with the devices using some kind of terminal emulation program?

Serial communications sometiems seems to be more art than science, usually because some device does not follow standard practice or is not well documented. It may take some experimentation to find out what is going on.

Lynn
0 Kudos
Message 4 of 12
(3,569 Views)
Hi Lynn,
Yes, i am able to communicate with each Polhemus for a long period of time without error. As soon as I use two Polhemii LV collects data incredibly slower! Also I get errors constantly. It seems like LV is too slow, or do you htink the speed of the computer matters?
Thanks, Ivanka
0 Kudos
Message 5 of 12
(3,569 Views)
If the slow down factor is greater than the number of devices communicating, as you describe, I suspect that there is some other problem. Perhaps it is the way you handle the dual communications. If you can post a simplified version of your program, I will take a look and see if I can spot something.
0 Kudos
Message 6 of 12
(3,569 Views)
I am attaching a simplified program. It is not working as well as the larder one, but it has the basic form of the original program.
Thanks!
IBAHKA
0 Kudos
Message 7 of 12
(3,569 Views)
Hi there,

Looking at your VI, I�m wondering why you have a �7� wired to the For Loops � how do you know that you are receiving 7 numbers every time?

What happens to the �Bytes at Port� around the time when the order changes? Try to use a Case Structure to make sure that you only read when the right amount of data is available.

Do you have an example of the data, around the time when the order got messed up? That would help us to troubleshoot.


Best regards,
Philip C.
Applications Engineer
National Instruments
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 8 of 12
(3,569 Views)
Serial communication is asynchronous, meaning that the timing is not controlled by a common clock. Suppose that one instrument sends 1.00 strings per second and the other sends 1.01 strings per second (a one percent difference). Then after about a minute and a half the numbers of srtings sent by the two instruments will be different. I think this may be part of your problem.

I would suggest two loops, one for each instrument and adding a time stamp to the received data. Then align the data by timestamps later. Or if the instruments can be synchronized, wait until you have received data from both before going to the next iteration of the loop.

If the data collection runs are long, building arrays in a
loop as you do in the simplified diagram can lead to memory allocation problems as the data sets get large.

Lynn
0 Kudos
Message 9 of 12
(3,441 Views)
Thanks Lynn,
We have sent our instruments for repair and we will be able to synch the two. Now, do you think that building arrays will significantly improve the time situation? We want to do real-time analysis, so i need to break up the data as it's being read.
Ivanka
0 Kudos
Message 10 of 12
(3,441 Views)