08-11-2008 02:29 PM - edited 08-11-2008 02:30 PM
08-11-2008 02:36 PM - edited 08-11-2008 02:38 PM
08-13-2008 10:15 AM
thanks for ur reply, i tried to use spreadsheet string to array and it works, but i am facing diff probem now. In my block diagram there is another data acquition running at 100samples/sec where as the serial port is running at 10 samples/sec. i have to run them in same loop. So on making loop time as 10msec i am just getting partial parsed string. I tried to use shift registers to concatinate it but i guess i am doing something wrong. What i am trying to do is show the whole parsed string once and then show blank spaces other time to sinchronize the fast DAC with slow SERIAL PORT.
Second after parsing in array i want to convert it in word. e.g. 00502800002010000050280000201000005028000020100000502800 if this is the first index array i would like to take 0050(it is in HEX) and make it 80 in DEC. then take 2800 in hex and make it 10240 in dec and so on thus giving me 14 dec values. Using string number conversion pallet doesnt help.
Please suggest me some ideas,
Thanks
08-13-2008 10:55 AM
You could place your serial code inside a case structure that only turns true every 10th iteration. Simply divide the iteration count by 10 using "quotient&remainder" and wire "remainder" to the case terminal. Place the serial code in case "0" and make the empty case the default.
A better opntion would be to retain incomplete tails from each parsing operation and then prepend it to the newly received string so you don't need to discard split tokens.
08-13-2008 10:58 AM
08-13-2008 11:09 AM
Mathur wrote:Second after parsing in array i want to convert it in word. e.g. 00502800002010000050280000201000005028000020100000502800 if this is the first index array i would like to take 0050(it is in HEX) and make it 80 in DEC. then take 2800 in hex and make it 10240 in dec and so on thus giving me 14 dec values. Using string number conversion pallet doesnt help.
Just to be a bit more clear, Gerd's answer relates to your second question (quoted above). Notice that you simply get an array of 14 U16 numeric values. (decimal" is only a cosmetic property of the indicator and has no bearing on the underlying data.)
08-14-2008 08:56 AM
Hi, thanks for your replies but i guess i am stuck again at stage 1. On running my program with 100ms time wait i am getting little strange representation in my array.
It looks like this
00
005028000020100000
005028000020100000
0050280000201000005028000020100000
0050280000201000005028000020100000
005028000020100000502800002010000050280000
00502800002010000050280000201000005028000020100000
00502800002010000050280000201000005028000020100000502800
00502800002010000050280000201000005028000020100000502800
00502800002010000050280000201000005028000020100000502800
00502800002010000050280000201000005028000020100000502800
00502800002010000050280000201000005028000020100000502800
00
0050280000
00502800002010000050280000
00502800002010000050280000
0050280000201000005028000020100000
005028000020100000502800002010000050280000
00502800002010000050280000201000005028000020100000
00502800002010000050280000201000005028000020100000502800
00502800002010000050280000201000005028000020100000502800
00502800002010000050280000201000005028000020100000502800
00502800002010000050280000201000005028000020100000502800
00502800002010000050280000201000005028000020100000502800
it just keeps on repeating this sequence.
i think it is the buffer problem as before it gets filled i am parsing it and on increasing my wait time to 1000ms it gets little better but i can't afford to increase that. Actually i want to decrease the wait time to 10msec. But then i hardly get any data before it parses. I was just wondering if their is any other way to read serial port or any way i can fix my prog. This is my first prog in lab view and I appreciate your help. i am attaching my prog with this. Kindly let me know any suggestions or changes.
08-14-2008 09:40 AM
As I said, you need to accumulate the data in a shift register and only parse once you have sufficient bytes. and keep the leftover tails for the next parsing operation.
In addition, to avoid all these small chunks, you could activate the case if "bytes at port" is larger than a certain amount instead of every time it is not zero.
08-19-2008 10:00 AM
Thanks for reply. I am now able to parse the data and see it in desired form.
I am trying to read voltage from ueiDAQ (Data Acquisition) card using LABVIEW. These cards are in my comp as PCI cards. Also i have installed the drivers for Windows from uei website. I was just wondering how can i do that. I tried to use MAX but couldnt understand it.
Thanks,
Avi
08-19-2008 12:08 PM
Mathur wrote:I am trying to read voltage from ueiDAQ (Data Acquisition) card using LABVIEW. These cards are in my comp as PCI cards. Also i have installed the drivers for Windows from uei website. I was just wondering how can i do that. I tried to use MAX but couldnt understand it.
Since this is now an unrelated question about hardware, you should probably start a new thread over in the Multifunction DAQ forum.