02-20-2012 12:08 PM
@johnsold wrote:
That article on the high res timer is quite old. Search the Forum for that topic. Within the past week or so someone posted a modern version. Note that these are Windows-only VIs.
Lynn
As a matter of fact- someone did as I recall Here is a link. Funny, I hadn't seen that article and was doing some intensive searching.
04-13-2015 05:06 AM
Hi
I have a similar problem, I trying to get data from a laser (SICK) that can works in continous mode sendind strings of data.
It saise 1 readind each ms and can take data at 2kHz rate.
The problem is that string seems the numbers rotating from is positition between readings and i only can get about 400 wrong readings/s.
Can somebody please help me increase the rate of readings and that readings arrive has a complete string.
In a simple program (SEEIT has hyperterminal) I send a comand and it arrives in continous mode about 2000samples/sec
Attach is a file 2nd colunm is number, last is the string, at the beggining the number is good than a chacater change its position
Please see right down coner of datasheet
best regards
cpalha
04-13-2015 05:23 AM
cpalka wrote:
The problem is that string seems the numbers rotating from is positition between readings and i only can get about 400 wrong readings/s.
How many wrong readings per second do you require?
Seriously though, I think you're just not using a termination character (check to see if the data being sent includes a termination character).
04-13-2015 07:32 AM
It is too dificult, imagine 1 reading each ms
Below is an extract froma a file and the string lenght seems to bee 48.8850\0D and I only need the number 48.8850.
If I configure the visa read to 10 byte count it only change the character position seems to be a time syncro between laser and pc?
0.129007 | 36\0D48.8848 | |
0.132008 | \0D48.8850\0D4 | |
0.134007 | 8.8854\0D48. | |
0.136008 | 8849\0D48.88 | |
0.139008 | 49\0D48.8853 | |
0.141008 | \0D48.8838\0D4 | |
0.143008 | 8.8852\0D48. | |
0.144008 | 8853\0D48.88 | |
0.146008 | 40\0D48.8860 | |
0.149008 | \0D48.8851\0D4 | |
0.151009 | 8.8852\0D48. | |
0.153008 | 8843\0D48.88 | |
0.155009 | 50\0D48.8850 | |
0.157009 | \0D48.8847\0D4 | |
0.160009 | 8.8852\0D48. | |
0.162009 | 8835\0D48.88 |
04-13-2015 07:37 AM
What do you think the \0D is?
It's the <CR> Termination character lsited in your data sheet.
Set up VISA to recognise this as a termination character and all your troubles will be gone.
Plus, ALWAYS keep an ASCII table handy when programming Serial.
Shane.
04-13-2015 08:32 AM
Hi Intaris
Thats it ! Thanks a lot
Now you can help me find a easy way to transform this string into a number?
I use scan from string but sometimes crashs.
04-13-2015 09:29 AM
Hi
Now is perfect, but in continous mode I only get about 450sample/s.
In visa configurations the sample rate can change data acquisition?
The bd maximum for laser, 7800.
I stiil have many diference between LB and the simple program (seeit) that can read about 2000S/s
Best regards
CPalha
04-13-2015 09:39 AM
04-13-2015 09:39 AM
You are also writing to file 450 times a second. That's probably too often. Try buffering the values (storing into a pre-allocated Array) and save only when the array is full.
If the Max baud for your laser is 7800 then you will only get approximately 780 Characters per second. Given a response length of 8 Characters, that will yield a maximum of approximately 100 values per second, I don't know where your 480 is coming from.
04-13-2015 10:52 AM
I put a while loop but does not work.
Can you make the changes in the vi? When You have time?
Thanks
Best
cpalha