11-13-2015 04:47 PM
Hello i am continously sampling data from the ADC on my micro the format my data is sending is as followed
$1,2,3,...................,$GPStime,$
i have a dollars sign at the beginning of the adc values and a dollar sign at the beginning of time and commas. I use the scan from string to separate the two but i get the following error.
11-13-2015 05:20 PM
A more exact example of your read string and what you expect as the output would help a lot here.
The $ make no sense. Just use comma seperation and then end the message with a carriage return (0xA). Then you just tell the VISA Read to read a really large number of bytes (more than your message) and it will stop reading when that CR is encountered. This makes sure you have a complete message. From there, you can use all kinds of tools to parse the string depending on the data in it. Again, we need a more precise string to help you more there.
11-14-2015 12:32 PM
okay the data is voltage values and time from a GPS reciever and it continuously sends data for as long as my micro is sampling the voltage and once i parse the data i expect the put the two into a build waveform the "t0" and "y". I am trying to get a phase angle and timestamp the data with gps. So the $ sign is there so to start the serial transmisson of the data and also cause the buffer sends 512 numbers at a time and $ indicates every 512 numbers and the $ for the time stamp works the same. It separate the two as well. t\Take a look at the read buffer of the visa read. You can see at the bottom of the picture the $ sign that indicates the time after and then on the next picture of read buffer another $ that indicates the voltages values after the time. I tried to use the scan from string to do that but i get errors and it doesnt work. I also tried the termination character on visa to catch every $ sign
11-14-2015 01:34 PM
11-14-2015 01:59 PM
That is not my problem i am able sync cause i am sending a byte to signal the beginning of the buffer which is $, and same with time, everything runs fine when i dont include the time so i know my program works. My problem is when i include the time, I just want to know what might work so i can separte the time and voltage in the data string. and also catch every $. used the termination character on visa it works just with the adc values but not when i add the time.
11-14-2015 03:19 PM
11-14-2015 05:03 PM
I could change the time haracter to !. And no the data just comes as one string and and the time is after the voltage values but still one string so I tired to use the string scan function but I get error is there another function that could possible separate them cause I tried a few and no luck or what approach could I take
11-14-2015 05:12 PM
11-14-2015 06:44 PM
what does t<LP> mean and also as you said, this is what coming
$a1,a2,....a512,$time,$a1,a2,...a512 and so forth alternating between the too and the termination character on visa would catch $ for both but when i use "split 1 d array" im not sure what index i would put to get time cause the termination character is starting the set over and over again and then how to transforming the time to time format to send to build waveform.
11-14-2015 07:38 PM